Put 'policy' out of params for do_cluster_policy_attach

In openstackSDK cluster_attach_policy method has 'cluster'
and 'policy' parameters out of **params, so senlinclient
should do the same thing for calling SDK.

Change-Id: I18d3c499467daf371f64c2a883af7c710d16db87
Closes-bug: #1530751
This commit is contained in:
Haiwei Xu
2016-01-04 11:56:24 +09:00
parent ec375cf551
commit 414ad237b6
2 changed files with 3 additions and 4 deletions

View File

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

View File

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