From 86c1a9d77f840242babba29fb56b3725dd4c7851 Mon Sep 17 00:00:00 2001 From: Taylor Peoples Date: Wed, 27 Jan 2016 04:38:40 +0100 Subject: [PATCH] Remove references to SERVERS_CONSOLIDATION Change I6c43eba941022a88851a199b56a6c20f017b9e71 seemed to have remove most references to the SERVERS_CONSOLIDATION goal. Since this goal does not currently exist in the actual code and all usages of it are for samples or for tests, it is replaced with the DUMMY goal to avoid confusion. Change-Id: I4d2240d3b22c42ebf4e6120e2cd7677ec49d8e98 Closes-Bug: #1538388 --- doc/source/deploy/user-guide.rst | 2 +- watcher/api/controllers/v1/audit_template.py | 2 +- watcher/db/api.py | 2 +- watcher/tests/db/test_audit.py | 4 ++-- watcher/tests/db/test_audit_template.py | 6 +++--- watcher/tests/objects/test_audit_template.py | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/source/deploy/user-guide.rst b/doc/source/deploy/user-guide.rst index db0b23cce..e3161dab5 100644 --- a/doc/source/deploy/user-guide.rst +++ b/doc/source/deploy/user-guide.rst @@ -60,7 +60,7 @@ This goal should be declared in the Watcher service configuration file .. 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 env[OS_USERNAME]*" you may have to verify your credentials. diff --git a/watcher/api/controllers/v1/audit_template.py b/watcher/api/controllers/v1/audit_template.py index a6abbf5aa..3870e0433 100644 --- a/watcher/api/controllers/v1/audit_template.py +++ b/watcher/api/controllers/v1/audit_template.py @@ -149,7 +149,7 @@ class AuditTemplate(base.APIBase): name='My Audit Template', description='Description of my audit template', host_aggregate=5, - goal='SERVERS_CONSOLIDATION', + goal='DUMMY', extra={'automatic': True}, created_at=datetime.datetime.utcnow(), deleted_at=None, diff --git a/watcher/db/api.py b/watcher/db/api.py index 467b3b315..4ee65c65c 100644 --- a/watcher/db/api.py +++ b/watcher/db/api.py @@ -71,7 +71,7 @@ class BaseConnection(object): 'name': 'example', 'description': 'free text description' 'host_aggregate': 'nova aggregate name or id' - 'goal': 'SERVER_CONSOLiDATION' + 'goal': 'DUMMY' 'extra': {'automatic': True} } :returns: An audit template. diff --git a/watcher/tests/db/test_audit.py b/watcher/tests/db/test_audit.py index e104b774d..08ef91390 100644 --- a/watcher/tests/db/test_audit.py +++ b/watcher/tests/db/test_audit.py @@ -92,7 +92,7 @@ class DbAuditTestCase(base.DbTestCase): name='My Audit Template 1', description='Description of my audit template 1', host_aggregate=5, - goal='SERVERS_CONSOLIDATION', + goal='DUMMY', extra={'automatic': True}) ) @@ -118,7 +118,7 @@ class DbAuditTestCase(base.DbTestCase): name='My Audit Template 1', description='Description of my audit template 1', host_aggregate=5, - goal='SERVERS_CONSOLIDATION', + goal='DUMMY', extra={'automatic': True}) ) diff --git a/watcher/tests/db/test_audit_template.py b/watcher/tests/db/test_audit_template.py index 17eadc6b1..76f57094e 100644 --- a/watcher/tests/db/test_audit_template.py +++ b/watcher/tests/db/test_audit_template.py @@ -47,7 +47,7 @@ class DbAuditTemplateTestCase(base.DbTestCase): name='My Audit Template 1', description='Description of my audit template 1', host_aggregate=5, - goal='SERVERS_CONSOLIDATION', + goal='DUMMY', extra={'automatic': True}) audit_template2 = self._create_test_audit_template( id=2, @@ -55,7 +55,7 @@ class DbAuditTemplateTestCase(base.DbTestCase): name='My Audit Template 2', description='Description of my audit template 2', host_aggregate=3, - goal='SERVERS_CONSOLIDATION', + goal='DUMMY', extra={'automatic': True}) res = self.dbapi.get_audit_template_list(self.context, @@ -68,7 +68,7 @@ class DbAuditTemplateTestCase(base.DbTestCase): res = self.dbapi.get_audit_template_list( self.context, - filters={'goal': 'SERVERS_CONSOLIDATION'}) + filters={'goal': 'DUMMY'}) self.assertEqual([audit_template1['id'], audit_template2['id']], [r.id for r in res]) diff --git a/watcher/tests/objects/test_audit_template.py b/watcher/tests/objects/test_audit_template.py index 1227e529a..5d9b14325 100644 --- a/watcher/tests/objects/test_audit_template.py +++ b/watcher/tests/objects/test_audit_template.py @@ -112,19 +112,19 @@ class TestAuditTemplateObject(base.DbTestCase): as mock_update_audit_template: audit_template = objects.AuditTemplate.get_by_uuid( self.context, uuid) - audit_template.goal = 'SERVERS_CONSOLIDATION' + audit_template.goal = 'DUMMY' audit_template.save() mock_get_audit_template.assert_called_once_with( self.context, uuid) mock_update_audit_template.assert_called_once_with( - uuid, {'goal': 'SERVERS_CONSOLIDATION'}) + uuid, {'goal': 'DUMMY'}) self.assertEqual(self.context, audit_template._context) def test_refresh(self): uuid = self.fake_audit_template['uuid'] returns = [dict(self.fake_audit_template, - goal="SERVERS_CONSOLIDATION"), + goal="DUMMY"), dict(self.fake_audit_template, goal="BALANCE_LOAD")] expected = [mock.call(self.context, uuid), mock.call(self.context, uuid)] @@ -132,7 +132,7 @@ class TestAuditTemplateObject(base.DbTestCase): side_effect=returns, autospec=True) as mock_get_audit_template: audit_template = objects.AuditTemplate.get(self.context, uuid) - self.assertEqual("SERVERS_CONSOLIDATION", audit_template.goal) + self.assertEqual("DUMMY", audit_template.goal) audit_template.refresh() self.assertEqual("BALANCE_LOAD", audit_template.goal) self.assertEqual(expected, mock_get_audit_template.call_args_list)