From 951f7ee5195fa8a6b63355e1d155533ae3e95b41 Mon Sep 17 00:00:00 2001 From: tengqm Date: Sat, 27 Aug 2016 09:48:55 -0400 Subject: [PATCH] Fix cluster-policy-list The 'enabled' field has been renamed to 'is_enabled' by the sdk, this patch changes the field name for listing. Change-Id: Ia020226bb20522d7eb03af02bd69dfa5845876ce --- senlinclient/tests/unit/v1/test_cluster_policy.py | 2 +- senlinclient/tests/unit/v1/test_shell.py | 2 +- senlinclient/v1/cluster_policy.py | 2 +- senlinclient/v1/shell.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/senlinclient/tests/unit/v1/test_cluster_policy.py b/senlinclient/tests/unit/v1/test_cluster_policy.py index 568617fd..b0d342ad 100644 --- a/senlinclient/tests/unit/v1/test_cluster_policy.py +++ b/senlinclient/tests/unit/v1/test_cluster_policy.py @@ -25,7 +25,7 @@ class TestClusterPolicy(fakes.TestClusteringv1): class TestClusterPolicyList(TestClusterPolicy): - columns = ['policy_id', 'policy_name', 'policy_type', 'enabled'] + columns = ['policy_id', 'policy_name', 'policy_type', 'is_enabled'] response = {"cluster_policies": [ { "cluster_id": "7d85f602-a948-4a30-afd4-e84f47471c15", diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index 5e2e9162..79cfb0af 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -1009,7 +1009,7 @@ class ShellTest(testtools.TestCase): @mock.patch.object(utils, 'print_list') def test_do_cluster_policy_list(self, mock_print): - fields = ['policy_id', 'policy_name', 'policy_type', 'enabled'] + fields = ['policy_id', 'policy_name', 'policy_type', 'is_enabled'] service = mock.Mock() args = { 'id': 'C1', diff --git a/senlinclient/v1/cluster_policy.py b/senlinclient/v1/cluster_policy.py index b950526f..40714238 100644 --- a/senlinclient/v1/cluster_policy.py +++ b/senlinclient/v1/cluster_policy.py @@ -63,7 +63,7 @@ class ClusterPolicyList(command.Lister): self.log.debug("take_action(%s)", parsed_args) senlin_client = self.app.client_manager.clustering - columns = ['policy_id', 'policy_name', 'policy_type', 'enabled'] + columns = ['policy_id', 'policy_name', 'policy_type', 'is_enabled'] cluster = senlin_client.get_cluster(parsed_args.cluster) queries = { 'sort': parsed_args.sort, diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index 1bf68c4d..88b9f460 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -828,7 +828,7 @@ def do_cluster_policy_list(service, args): """List policies from cluster.""" show_deprecated('senlin cluster-policy-list', 'openstack cluster policy binding list') - fields = ['policy_id', 'policy_name', 'policy_type', 'enabled'] + fields = ['policy_id', 'policy_name', 'policy_type', 'is_enabled'] cluster = service.get_cluster(args.id) queries = {