Revert "Add support continuously-optimization"
This reverts commit 888a58fd2a62628d970e7088d4f74e4642bacc17. Will restore it once related changes in watcher get merged. Change-Id: Icdde1678598867c5e1ce68c8bd4c189f7a37bedc Closes-Bug: #1595368
This commit is contained in:
parent
d36d835d08
commit
f9fb0875e0
watcherclient
@ -48,7 +48,6 @@ AUDIT_1 = {
|
|||||||
'created_at': datetime.datetime.now().isoformat(),
|
'created_at': datetime.datetime.now().isoformat(),
|
||||||
'updated_at': None,
|
'updated_at': None,
|
||||||
'deleted_at': None,
|
'deleted_at': None,
|
||||||
'period': 3600,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AUDIT_2 = {
|
AUDIT_2 = {
|
||||||
@ -61,7 +60,6 @@ AUDIT_2 = {
|
|||||||
'created_at': datetime.datetime.now().isoformat(),
|
'created_at': datetime.datetime.now().isoformat(),
|
||||||
'updated_at': None,
|
'updated_at': None,
|
||||||
'deleted_at': None,
|
'deleted_at': None,
|
||||||
'period': 3600,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -227,7 +225,7 @@ class AuditShellTest(base.CommandTestCase):
|
|||||||
result)
|
result)
|
||||||
self.m_audit_mgr.create.assert_called_once_with(
|
self.m_audit_mgr.create.assert_called_once_with(
|
||||||
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
||||||
type='ONESHOT', period=3600)
|
type='ONESHOT')
|
||||||
|
|
||||||
def test_do_audit_create_with_audit_template_name(self):
|
def test_do_audit_create_with_audit_template_name(self):
|
||||||
audit = resource.Audit(mock.Mock(), AUDIT_1)
|
audit = resource.Audit(mock.Mock(), AUDIT_1)
|
||||||
@ -243,7 +241,7 @@ class AuditShellTest(base.CommandTestCase):
|
|||||||
result)
|
result)
|
||||||
self.m_audit_mgr.create.assert_called_once_with(
|
self.m_audit_mgr.create.assert_called_once_with(
|
||||||
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
||||||
type='ONESHOT', period=3600)
|
type='ONESHOT')
|
||||||
|
|
||||||
def test_do_audit_create_with_deadline(self):
|
def test_do_audit_create_with_deadline(self):
|
||||||
audit = resource.Audit(mock.Mock(), AUDIT_1)
|
audit = resource.Audit(mock.Mock(), AUDIT_1)
|
||||||
@ -261,8 +259,7 @@ class AuditShellTest(base.CommandTestCase):
|
|||||||
self.m_audit_mgr.create.assert_called_once_with(
|
self.m_audit_mgr.create.assert_called_once_with(
|
||||||
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
||||||
type='ONESHOT',
|
type='ONESHOT',
|
||||||
deadline='2016-04-28T10:48:32.064802',
|
deadline='2016-04-28T10:48:32.064802')
|
||||||
period=3600)
|
|
||||||
|
|
||||||
def test_do_audit_create_with_type(self):
|
def test_do_audit_create_with_type(self):
|
||||||
audit = resource.Audit(mock.Mock(), AUDIT_1)
|
audit = resource.Audit(mock.Mock(), AUDIT_1)
|
||||||
@ -279,4 +276,4 @@ class AuditShellTest(base.CommandTestCase):
|
|||||||
result)
|
result)
|
||||||
self.m_audit_mgr.create.assert_called_once_with(
|
self.m_audit_mgr.create.assert_called_once_with(
|
||||||
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
audit_template_uuid='f8e47706-efcf-49a4-a5c4-af604eb492f2',
|
||||||
type='ONESHOT', period=3600)
|
type='ONESHOT')
|
||||||
|
@ -18,7 +18,7 @@ from watcherclient.common import base
|
|||||||
from watcherclient.common import utils
|
from watcherclient.common import utils
|
||||||
from watcherclient import exceptions as exc
|
from watcherclient import exceptions as exc
|
||||||
|
|
||||||
CREATION_ATTRIBUTES = ['audit_template_uuid', 'deadline', 'type', 'period']
|
CREATION_ATTRIBUTES = ['audit_template_uuid', 'deadline', 'type']
|
||||||
|
|
||||||
|
|
||||||
class Audit(base.Resource):
|
class Audit(base.Resource):
|
||||||
|
@ -132,19 +132,13 @@ class CreateAudit(command.ShowOne):
|
|||||||
metavar='<type>',
|
metavar='<type>',
|
||||||
default='ONESHOT',
|
default='ONESHOT',
|
||||||
help=_("Audit type."))
|
help=_("Audit type."))
|
||||||
parser.add_argument(
|
|
||||||
'-p', '--period',
|
|
||||||
dest='period',
|
|
||||||
metavar='<period>',
|
|
||||||
default=3600,
|
|
||||||
help=_("Audit period."))
|
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
client = getattr(self.app.client_manager, "infra-optim")
|
client = getattr(self.app.client_manager, "infra-optim")
|
||||||
|
|
||||||
field_list = ['audit_template_uuid', 'type', 'deadline', 'period']
|
field_list = ['audit_template_uuid', 'type', 'deadline']
|
||||||
fields = dict((k, v) for (k, v) in vars(parsed_args).items()
|
fields = dict((k, v) for (k, v) in vars(parsed_args).items()
|
||||||
if k in field_list and v is not None)
|
if k in field_list and v is not None)
|
||||||
if fields.get('audit_template_uuid'):
|
if fields.get('audit_template_uuid'):
|
||||||
|
@ -35,11 +35,11 @@ AUDIT_TEMPLATE_SHORT_LIST_FIELD_LABELS = ['UUID', 'Name', 'Goal', 'Strategy']
|
|||||||
# Audit
|
# Audit
|
||||||
AUDIT_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at',
|
AUDIT_FIELDS = ['uuid', 'created_at', 'updated_at', 'deleted_at',
|
||||||
'deadline', 'state', 'type', 'audit_template_uuid',
|
'deadline', 'state', 'type', 'audit_template_uuid',
|
||||||
'audit_template_name', 'period']
|
'audit_template_name']
|
||||||
|
|
||||||
AUDIT_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At',
|
AUDIT_FIELD_LABELS = ['UUID', 'Created At', 'Updated At', 'Deleted At',
|
||||||
'Deadline', 'State', 'Type', 'Audit Template uuid',
|
'Deadline', 'State', 'Type', 'Audit Template uuid',
|
||||||
'Audit Template Name', 'Period']
|
'Audit Template Name']
|
||||||
|
|
||||||
AUDIT_SHORT_LIST_FIELDS = ['uuid', 'type', 'audit_template_name', 'state']
|
AUDIT_SHORT_LIST_FIELDS = ['uuid', 'type', 'audit_template_name', 'state']
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user