Fix openstack cluster profile validate bug

This patch fix project_id and user_id show bug in
command `openstack  cluster profile validate`.

Change-Id: I603a818721ea5f702df34115a15abb4f80c16d8b
Closes-Bug: #1650119
This commit is contained in:
jonnary
2016-12-15 12:53:47 +08:00
parent 1fb8573f8a
commit 82771162c9
2 changed files with 13 additions and 2 deletions

View File

@@ -457,3 +457,14 @@ class TestProfileValidate(TestProfile):
parsed_args = self.check_parser(self.cmd, arglist, [])
self.cmd.take_action(parsed_args)
self.mock_client.validate_profile.assert_called_with(**self.defaults)
profile = self.mock_client.validate_profile(**self.defaults)
self.assertEqual(self.response['profile']['project'],
profile.project_id)
self.assertEqual(self.response['profile']['user'],
profile.user_id)
self.assertEqual(self.response['profile']['id'], profile.id)
self.assertEqual(self.response['profile']['metadata'],
profile.metadata)
self.assertEqual(self.response['profile']['name'], profile.name)
self.assertEqual(self.response['profile']['spec'], profile.spec)
self.assertEqual(self.response['profile']['type'], profile.type)

View File

@@ -368,11 +368,11 @@ class ValidateProfile(command.ShowOne):
'id',
'metadata',
'name',
'project',
'project_id',
'spec',
'type',
'updated_at',
'user'
'user_id'
]
return columns, utils.get_dict_properties(profile.to_dict(), columns,
formatters=formatters)