Revert "Revert "Fix openstack cluster profile validate bug""

This reverts commit 130a522cad.

Let's do it again because the global requirements version is bumped now.

Change-Id: I41a0384527fa76c1747628651a771d012426b86c
This commit is contained in:
Qiming Teng
2016-12-23 09:22:49 +00:00
parent 130a522cad
commit 3525aef3a6
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)