Fix profile update parameters passing error
Currently profile udpate fails due to parameters passing problem. Change-Id: I1d31cd675b58ea1f941c6fd2486c7042739a9229 Closes-bug: #1521832
This commit is contained in:
@@ -249,9 +249,8 @@ class ShellTest(testtools.TestCase):
|
||||
'name': 'stack_spec',
|
||||
'permission': 'ok',
|
||||
'metadata': {'user': 'demo'},
|
||||
'id': profile_id,
|
||||
}
|
||||
client.update_profile.assert_called_once_with(params)
|
||||
client.update_profile.assert_called_once_with(profile_id, **params)
|
||||
mock_show.assert_called_once_with(client, profile_id)
|
||||
|
||||
# specified profile can't be found
|
||||
|
||||
@@ -56,6 +56,7 @@ class Client(object):
|
||||
return self.get(models.Profile, dict(id=value))
|
||||
|
||||
def update_profile(self, value, **attrs):
|
||||
attrs['id'] = value
|
||||
return self.update(models.Profile, attrs)
|
||||
|
||||
def delete_profile(self, value, ignore_missing=True):
|
||||
|
||||
@@ -193,8 +193,7 @@ def do_profile_update(sc, args):
|
||||
except exc.HTTPNotFound:
|
||||
raise exc.CommandError(_('Profile not found: %s') % args.id)
|
||||
|
||||
params['id'] = profile.id
|
||||
sc.update_profile(params)
|
||||
sc.update_profile(profile.id, **params)
|
||||
_show_profile(sc, profile.id)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user