Merge "Put 'policy' out of params for do_cluster_policy_attach"
This commit is contained in:
@@ -1014,7 +1014,6 @@ class ShellTest(testtools.TestCase):
|
||||
}
|
||||
args = self._make_args(args)
|
||||
kwargs = {
|
||||
'policy_id': 'policy1',
|
||||
'priority': 50,
|
||||
'level': 60,
|
||||
'cooldown': 120,
|
||||
@@ -1024,7 +1023,7 @@ class ShellTest(testtools.TestCase):
|
||||
client.conn.cluster.cluster_attach_policy.return_value = resp
|
||||
sh.do_cluster_policy_attach(client, args)
|
||||
client.conn.cluster.cluster_attach_policy.assert_called_once_with(
|
||||
'cluster1', **kwargs)
|
||||
'cluster1', 'policy1', **kwargs)
|
||||
|
||||
def test_do_cluster_policy_detach(self):
|
||||
args = {
|
||||
|
||||
@@ -782,14 +782,14 @@ def do_cluster_policy_show(sc, args):
|
||||
def do_cluster_policy_attach(sc, args):
|
||||
"""Attach policy to cluster."""
|
||||
kwargs = {
|
||||
'policy_id': args.policy,
|
||||
'priority': args.priority,
|
||||
'level': args.enforcement_level,
|
||||
'cooldown': args.cooldown,
|
||||
'enabled': args.enabled,
|
||||
}
|
||||
|
||||
resp = sc.conn.cluster.cluster_attach_policy(args.id, **kwargs)
|
||||
policy = args.policy
|
||||
resp = sc.conn.cluster.cluster_attach_policy(args.id, policy, **kwargs)
|
||||
print('Request accepted by action: %s' % resp['action'])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user