Browse Source

Merge "Fix resource update issues"

changes/58/405158/1
Jenkins 4 years ago
committed by Gerrit Code Review
parent
commit
3a120b0791
2 changed files with 8 additions and 8 deletions
  1. +4
    -4
      senlinclient/tests/unit/v1/test_shell.py
  2. +4
    -4
      senlinclient/v1/shell.py

+ 4
- 4
senlinclient/tests/unit/v1/test_shell.py View File

@ -263,7 +263,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')
@ -663,7 +663,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):
@ -973,7 +973,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')
@ -1538,7 +1538,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')


+ 4
- 4
senlinclient/v1/shell.py View File

@ -220,7 +220,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)
@ -416,7 +416,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)
@ -782,7 +782,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)
@ -1265,7 +1265,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)


Loading…
Cancel
Save