From 87120ea3d0909fa239f525844fe04f5353f2eff5 Mon Sep 17 00:00:00 2001 From: xu-haiwei Date: Fri, 29 Jan 2016 19:35:19 +0900 Subject: [PATCH] Remove nested cluster support Nested cluster is not used at all currently and will make user confusing, so remove it. Change-Id: I927b2327d48f38c0bda95ae723e267cac33375f0 --- senlinclient/tests/unit/v1/test_shell.py | 5 +---- senlinclient/v1/shell.py | 12 ------------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index 5ad0fa73..83f1cb19 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -589,12 +589,11 @@ class ShellTest(testtools.TestCase): @mock.patch.object(utils, 'print_list') def test_do_cluster_list(self, mock_print): service = mock.Mock() - fields = ['id', 'name', 'status', 'created_at', 'updated_at', 'parent'] + fields = ['id', 'name', 'status', 'created_at', 'updated_at'] args = { 'limit': 20, 'marker': 'fake_id', 'sort': 'key:dir', - 'show_nested': True, 'global_project': False, 'filters': ['status=ACTIVE'], } @@ -641,7 +640,6 @@ class ShellTest(testtools.TestCase): 'min_size': 1, 'max_size': 10, 'desired_capacity': 5, - 'parent': 'CLUSTER', 'metadata': ['user=demo'], 'timeout': 200, } @@ -682,7 +680,6 @@ class ShellTest(testtools.TestCase): args = { 'profile': 'test_profile', 'name': 'CLUSTER1', - 'parent': 'parent_cluster', 'metadata': ['user=demo'], 'timeout': 100, } diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index 75e78124..9f3dadcd 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -354,8 +354,6 @@ def do_policy_delete(service, args): # CLUSTERS -@utils.arg('-n', '--show-nested', default=False, action="store_true", - help=_('Include nested clusters if any.')) @utils.arg('-f', '--filters', metavar='', help=_('Filter parameters to apply on returned clusters. ' 'This can be specified multiple times, or once with ' @@ -383,15 +381,11 @@ def do_cluster_list(service, args=None): 'limit': args.limit, 'marker': args.marker, 'sort': args.sort, - 'show_nested': args.show_nested, 'global_project': args.global_project, } if args.filters: queries.update(utils.format_parameters(args.filters)) - if args.show_nested: - fields.append('parent') - sortby_index = None if args.sort else 3 clusters = service.clusters(**queries) @@ -426,8 +420,6 @@ def _show_cluster(service, cluster_id): @utils.arg('-c', '--desired-capacity', metavar='', default=0, help=_('Desired capacity of the cluster. Default to min_size if ' 'min_size is specified else 0.')) -@utils.arg('-o', '--parent', metavar='', - help=_('ID of the parent cluster, if exists.')) @utils.arg('-t', '--timeout', metavar='', type=int, help=_('Cluster creation timeout in seconds.')) @utils.arg('-M', '--metadata', metavar='', @@ -447,7 +439,6 @@ def do_cluster_create(service, args): 'min_size': args.min_size, 'max_size': args.max_size, 'desired_capacity': args.desired_capacity, - 'parent': args.parent, 'metadata': utils.format_parameters(args.metadata), 'timeout': args.timeout } @@ -479,8 +470,6 @@ def do_cluster_delete(service, args): help=_('ID of new profile to use.')) @utils.arg('-t', '--timeout', metavar='', help=_('New timeout (in seconds) value for the cluster.')) -@utils.arg('-r', '--parent', metavar='', - help=_('ID of parent cluster for the cluster.')) @utils.arg('-M', '--metadata', metavar='', help=_('Metadata values to be attached to the cluster. ' 'This can be specified multiple times, or once with ' @@ -496,7 +485,6 @@ def do_cluster_update(service, args): attrs = { 'name': args.name, 'profile_id': args.profile, - 'parent': args.parent, 'metadata': utils.format_parameters(args.metadata), 'timeout': args.timeout, }