Merge "Fix openstack cluster policy vaildate bug"

This commit is contained in:
Jenkins
2016-12-24 06:26:47 +00:00
committed by Gerrit Code Review
2 changed files with 14 additions and 2 deletions

View File

@@ -421,3 +421,15 @@ class TestPolicyValidate(TestPolicy):
parsed_args = self.check_parser(self.cmd, arglist, [])
self.cmd.take_action(parsed_args)
self.mock_client.validate_policy.assert_called_with(**self.defaults)
policy = self.mock_client.validate_policy(**self.defaults)
self.assertEqual(self.response['policy']['project'],
policy.project_id)
self.assertEqual(self.response['policy']['data'], policy.data)
self.assertEqual(self.response['policy']['id'], policy.id)
self.assertEqual(self.response['policy']['name'], policy.name)
self.assertEqual(self.response['policy']['project'],
policy.project_id)
self.assertEqual(self.response['policy']['spec'], policy.spec)
self.assertEqual(self.response['policy']['type'], policy.type)
self.assertEqual(self.response['policy']['updated_at'],
policy.updated_at)

View File

@@ -144,11 +144,11 @@ def _show_policy(senlin_client, policy_id):
'domain',
'id',
'name',
'project',
'project_id',
'spec',
'type',
'updated_at',
'user'
'user_id'
]
return columns, utils.get_dict_properties(policy.to_dict(), columns,
formatters=formatters)