Merge "Fix log-enable high priority error"

This commit is contained in:
Zuul 2018-01-23 16:26:56 +00:00 committed by Gerrit Code Review
commit 0bc788e55c
3 changed files with 6 additions and 5 deletions

View File

@ -70,7 +70,7 @@ openstack.database.v1 =
database_limit_list = troveclient.osc.v1.database_limits:ListDatabaseLimits
database_quota_show = troveclient.osc.v1.database_quota:ShowDatabaseQuota
database_quota_update = troveclient.osc.v1.database_quota:UpdateDatabaseQuota
database_log_enable = troveclient.osc.v1.database_limits:EnableDatabaseInstanceLog
database_log_enable = troveclient.osc.v1.database_instances:EnableDatabaseInstanceLog
database_root_disable = troveclient.osc.v1.database_root:DisableDatabaseRoot
database_root_enable = troveclient.osc.v1.database_root:EnableDatabaseRoot
database_root_show = troveclient.osc.v1.database_root:ShowDatabaseRoot

View File

@ -447,7 +447,7 @@ class UpgradeDatabaseInstance(command.Command):
db_instances.upgrade(instance, parsed_args.datastore_version)
class EnableDatabaseInstanceLog(command.Command):
class EnableDatabaseInstanceLog(command.ShowOne):
_description = _("Instructs Trove guest to start collecting log details.")
@ -471,7 +471,9 @@ class EnableDatabaseInstanceLog(command.Command):
db_instances = self.app.client_manager.database.instances
instance = osc_utils.find_resource(db_instances,
parsed_args.instance)
db_instances.log_enable(instance, parsed_args.log_name)
log_info = db_instances.log_enable(instance, parsed_args.log_name)
result = log_info._info
return zip(*sorted(six.iteritems(result)))
class ResizeDatabaseInstanceVolume(command.Command):

View File

@ -279,10 +279,9 @@ class TestDatabaseInstanceEnableLog(TestInstances):
args = ['instance1', 'log_name']
mock_find.side_effect = ['instance1']
parsed_args = self.check_parser(self.cmd, args, [])
result = self.cmd.take_action(parsed_args)
self.cmd.take_action(parsed_args)
self.instance_client.log_enable.assert_called_with('instance1',
'log_name')
self.assertIsNone(result)
class TestDatabaseInstanceRestart(TestInstances):