diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index a924828..6c89eb7 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -262,7 +262,7 @@ class ShellTest(testtools.TestCase): 'name': 'stack_spec', 'metadata': {'user': 'demo'}, } - service.update_profile.assert_called_once_with(profile_id, **params) + service.update_profile.assert_called_once_with(profile, **params) mock_show.assert_called_once_with(service, profile_id) @mock.patch.object(utils, 'format_parameters') @@ -662,7 +662,7 @@ class ShellTest(testtools.TestCase): sh.do_policy_update(service, args) service.get_policy.assert_called_once_with('policy_id') service.update_policy.assert_called_once_with( - 'policy_id', **params) + policy, **params) mock_show(service, policy_id=policy.id) def test_do_policy_delete(self): @@ -972,7 +972,7 @@ class ShellTest(testtools.TestCase): sh.do_cluster_update(service, args) service.get_cluster.assert_called_once_with('CID') - service.update_cluster.assert_called_once_with('CID', **attrs) + service.update_cluster.assert_called_once_with(cluster, **attrs) mock_show.assert_called_once_with(service, 'CID') @mock.patch.object(sh, '_show_cluster') @@ -1537,7 +1537,7 @@ class ShellTest(testtools.TestCase): service.get_node.return_value = node sh.do_node_update(service, args) service.get_node.assert_called_once_with('node_id') - service.update_node.assert_called_once_with('node_id', **attrs) + service.update_node.assert_called_once_with(node, **attrs) mock_show.assert_called_once_with(service, 'node_id') @mock.patch.object(utils, 'print_list') diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index ff93e25..38214ae 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -217,7 +217,7 @@ def do_profile_update(service, args): profile = service.get_profile(args.id) except sdk_exc.ResourceNotFound: raise exc.CommandError(_('Profile not found: %s') % args.id) - service.update_profile(profile.id, **params) + service.update_profile(profile, **params) _show_profile(service, profile.id) @@ -408,7 +408,7 @@ def do_policy_update(service, args): policy = service.get_policy(args.id) if policy is not None: - service.update_policy(policy.id, **params) + service.update_policy(policy, **params) _show_policy(service, policy_id=policy.id) @@ -768,7 +768,7 @@ def do_cluster_update(service, args): 'timeout': args.timeout, } - service.update_cluster(cluster.id, **attrs) + service.update_cluster(cluster, **attrs) _show_cluster(service, cluster.id) @@ -1247,7 +1247,7 @@ def do_node_update(service, args): 'metadata': utils.format_parameters(args.metadata), } - service.update_node(args.id, **attrs) + service.update_node(node, **attrs) _show_node(service, node.id)