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)