Merge "Remove references to SERVERS_CONSOLIDATION"
This commit is contained in:
@@ -60,7 +60,7 @@ This goal should be declared in the Watcher service configuration file
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
$ watcher audit-template-create my_first_audit SERVERS_CONSOLIDATION
|
$ watcher audit-template-create my_first_audit DUMMY
|
||||||
|
|
||||||
If you get "*You must provide a username via either --os-username or via
|
If you get "*You must provide a username via either --os-username or via
|
||||||
env[OS_USERNAME]*" you may have to verify your credentials.
|
env[OS_USERNAME]*" you may have to verify your credentials.
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ class AuditTemplate(base.APIBase):
|
|||||||
name='My Audit Template',
|
name='My Audit Template',
|
||||||
description='Description of my audit template',
|
description='Description of my audit template',
|
||||||
host_aggregate=5,
|
host_aggregate=5,
|
||||||
goal='SERVERS_CONSOLIDATION',
|
goal='DUMMY',
|
||||||
extra={'automatic': True},
|
extra={'automatic': True},
|
||||||
created_at=datetime.datetime.utcnow(),
|
created_at=datetime.datetime.utcnow(),
|
||||||
deleted_at=None,
|
deleted_at=None,
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class BaseConnection(object):
|
|||||||
'name': 'example',
|
'name': 'example',
|
||||||
'description': 'free text description'
|
'description': 'free text description'
|
||||||
'host_aggregate': 'nova aggregate name or id'
|
'host_aggregate': 'nova aggregate name or id'
|
||||||
'goal': 'SERVER_CONSOLiDATION'
|
'goal': 'DUMMY'
|
||||||
'extra': {'automatic': True}
|
'extra': {'automatic': True}
|
||||||
}
|
}
|
||||||
:returns: An audit template.
|
:returns: An audit template.
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class DbAuditTestCase(base.DbTestCase):
|
|||||||
name='My Audit Template 1',
|
name='My Audit Template 1',
|
||||||
description='Description of my audit template 1',
|
description='Description of my audit template 1',
|
||||||
host_aggregate=5,
|
host_aggregate=5,
|
||||||
goal='SERVERS_CONSOLIDATION',
|
goal='DUMMY',
|
||||||
extra={'automatic': True})
|
extra={'automatic': True})
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ class DbAuditTestCase(base.DbTestCase):
|
|||||||
name='My Audit Template 1',
|
name='My Audit Template 1',
|
||||||
description='Description of my audit template 1',
|
description='Description of my audit template 1',
|
||||||
host_aggregate=5,
|
host_aggregate=5,
|
||||||
goal='SERVERS_CONSOLIDATION',
|
goal='DUMMY',
|
||||||
extra={'automatic': True})
|
extra={'automatic': True})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class DbAuditTemplateTestCase(base.DbTestCase):
|
|||||||
name='My Audit Template 1',
|
name='My Audit Template 1',
|
||||||
description='Description of my audit template 1',
|
description='Description of my audit template 1',
|
||||||
host_aggregate=5,
|
host_aggregate=5,
|
||||||
goal='SERVERS_CONSOLIDATION',
|
goal='DUMMY',
|
||||||
extra={'automatic': True})
|
extra={'automatic': True})
|
||||||
audit_template2 = self._create_test_audit_template(
|
audit_template2 = self._create_test_audit_template(
|
||||||
id=2,
|
id=2,
|
||||||
@@ -55,7 +55,7 @@ class DbAuditTemplateTestCase(base.DbTestCase):
|
|||||||
name='My Audit Template 2',
|
name='My Audit Template 2',
|
||||||
description='Description of my audit template 2',
|
description='Description of my audit template 2',
|
||||||
host_aggregate=3,
|
host_aggregate=3,
|
||||||
goal='SERVERS_CONSOLIDATION',
|
goal='DUMMY',
|
||||||
extra={'automatic': True})
|
extra={'automatic': True})
|
||||||
|
|
||||||
res = self.dbapi.get_audit_template_list(self.context,
|
res = self.dbapi.get_audit_template_list(self.context,
|
||||||
@@ -68,7 +68,7 @@ class DbAuditTemplateTestCase(base.DbTestCase):
|
|||||||
|
|
||||||
res = self.dbapi.get_audit_template_list(
|
res = self.dbapi.get_audit_template_list(
|
||||||
self.context,
|
self.context,
|
||||||
filters={'goal': 'SERVERS_CONSOLIDATION'})
|
filters={'goal': 'DUMMY'})
|
||||||
self.assertEqual([audit_template1['id'], audit_template2['id']],
|
self.assertEqual([audit_template1['id'], audit_template2['id']],
|
||||||
[r.id for r in res])
|
[r.id for r in res])
|
||||||
|
|
||||||
|
|||||||
@@ -112,19 +112,19 @@ class TestAuditTemplateObject(base.DbTestCase):
|
|||||||
as mock_update_audit_template:
|
as mock_update_audit_template:
|
||||||
audit_template = objects.AuditTemplate.get_by_uuid(
|
audit_template = objects.AuditTemplate.get_by_uuid(
|
||||||
self.context, uuid)
|
self.context, uuid)
|
||||||
audit_template.goal = 'SERVERS_CONSOLIDATION'
|
audit_template.goal = 'DUMMY'
|
||||||
audit_template.save()
|
audit_template.save()
|
||||||
|
|
||||||
mock_get_audit_template.assert_called_once_with(
|
mock_get_audit_template.assert_called_once_with(
|
||||||
self.context, uuid)
|
self.context, uuid)
|
||||||
mock_update_audit_template.assert_called_once_with(
|
mock_update_audit_template.assert_called_once_with(
|
||||||
uuid, {'goal': 'SERVERS_CONSOLIDATION'})
|
uuid, {'goal': 'DUMMY'})
|
||||||
self.assertEqual(self.context, audit_template._context)
|
self.assertEqual(self.context, audit_template._context)
|
||||||
|
|
||||||
def test_refresh(self):
|
def test_refresh(self):
|
||||||
uuid = self.fake_audit_template['uuid']
|
uuid = self.fake_audit_template['uuid']
|
||||||
returns = [dict(self.fake_audit_template,
|
returns = [dict(self.fake_audit_template,
|
||||||
goal="SERVERS_CONSOLIDATION"),
|
goal="DUMMY"),
|
||||||
dict(self.fake_audit_template, goal="BALANCE_LOAD")]
|
dict(self.fake_audit_template, goal="BALANCE_LOAD")]
|
||||||
expected = [mock.call(self.context, uuid),
|
expected = [mock.call(self.context, uuid),
|
||||||
mock.call(self.context, uuid)]
|
mock.call(self.context, uuid)]
|
||||||
@@ -132,7 +132,7 @@ class TestAuditTemplateObject(base.DbTestCase):
|
|||||||
side_effect=returns,
|
side_effect=returns,
|
||||||
autospec=True) as mock_get_audit_template:
|
autospec=True) as mock_get_audit_template:
|
||||||
audit_template = objects.AuditTemplate.get(self.context, uuid)
|
audit_template = objects.AuditTemplate.get(self.context, uuid)
|
||||||
self.assertEqual("SERVERS_CONSOLIDATION", audit_template.goal)
|
self.assertEqual("DUMMY", audit_template.goal)
|
||||||
audit_template.refresh()
|
audit_template.refresh()
|
||||||
self.assertEqual("BALANCE_LOAD", audit_template.goal)
|
self.assertEqual("BALANCE_LOAD", audit_template.goal)
|
||||||
self.assertEqual(expected, mock_get_audit_template.call_args_list)
|
self.assertEqual(expected, mock_get_audit_template.call_args_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user