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:
Haiwei Xu
2015-12-02 11:39:23 +09:00
parent f3236b6232
commit 598e881aea
3 changed files with 3 additions and 4 deletions

View File

@@ -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

View File

@@ -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):

View File

@@ -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)