diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index 08cd1ceb..f16b35ea 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -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 = { diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index 4cabfc72..df134b08 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -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'])