summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-10-03 17:28:38 +0000
committerGerrit Code Review <review@openstack.org>2017-10-03 17:28:39 +0000
commitb9f9e1c52976518ef3f48fbad81c4abdbd2475ea (patch)
treededf48ed95971a72454cec9dc4a7704d05cc6733
parent8a39691c109dccd36462e1042fbdb535a891904c (diff)
parente9f17af05c6e1cb9cc50654a0e31c871aa8339a6 (diff)
Merge "Now `name` is a positional argument in cluster creation"
-rw-r--r--magnumclient/osc/v1/cluster_templates.py2
-rw-r--r--magnumclient/osc/v1/clusters.py2
-rw-r--r--magnumclient/tests/osc/unit/v1/test_cluster_templates.py8
-rw-r--r--magnumclient/tests/osc/unit/v1/test_clusters.py10
4 files changed, 11 insertions, 11 deletions
diff --git a/magnumclient/osc/v1/cluster_templates.py b/magnumclient/osc/v1/cluster_templates.py
index 0b45b9f..c61cce6 100644
--- a/magnumclient/osc/v1/cluster_templates.py
+++ b/magnumclient/osc/v1/cluster_templates.py
@@ -71,7 +71,7 @@ class CreateClusterTemplate(command.ShowOne):
71 parser = super(CreateClusterTemplate, self).get_parser(prog_name) 71 parser = super(CreateClusterTemplate, self).get_parser(prog_name)
72 72
73 parser.add_argument( 73 parser.add_argument(
74 '--name', 74 'name',
75 metavar='<name>', 75 metavar='<name>',
76 help=_('Name of the cluster template to create.')) 76 help=_('Name of the cluster template to create.'))
77 parser.add_argument( 77 parser.add_argument(
diff --git a/magnumclient/osc/v1/clusters.py b/magnumclient/osc/v1/clusters.py
index edae6cf..cbfbfff 100644
--- a/magnumclient/osc/v1/clusters.py
+++ b/magnumclient/osc/v1/clusters.py
@@ -86,7 +86,7 @@ class CreateCluster(command.Command):
86 default=1, 86 default=1,
87 metavar='<master-count>', 87 metavar='<master-count>',
88 help='The number of master nodes for the cluster.') 88 help='The number of master nodes for the cluster.')
89 parser.add_argument('--name', 89 parser.add_argument('name',
90 metavar='<name>', 90 metavar='<name>',
91 help='Name of the cluster to create.') 91 help='Name of the cluster to create.')
92 parser.add_argument('--node-count', 92 parser.add_argument('--node-count',
diff --git a/magnumclient/tests/osc/unit/v1/test_cluster_templates.py b/magnumclient/tests/osc/unit/v1/test_cluster_templates.py
index be5a8fa..ac8e2c5 100644
--- a/magnumclient/tests/osc/unit/v1/test_cluster_templates.py
+++ b/magnumclient/tests/osc/unit/v1/test_cluster_templates.py
@@ -91,7 +91,7 @@ class TestClusterTemplateCreate(TestClusterTemplate):
91 '--coe', self.new_ct.coe, 91 '--coe', self.new_ct.coe,
92 '--external-network', self.new_ct.external_network_id, 92 '--external-network', self.new_ct.external_network_id,
93 '--image', self.new_ct.image_id, 93 '--image', self.new_ct.image_id,
94 '--name', self.new_ct.name 94 self.new_ct.name
95 ] 95 ]
96 verifylist = [ 96 verifylist = [
97 ('coe', self.new_ct.coe), 97 ('coe', self.new_ct.coe),
@@ -109,13 +109,11 @@ class TestClusterTemplateCreate(TestClusterTemplate):
109 109
110 arglist = [ 110 arglist = [
111 '--external-network', self.new_ct.external_network_id, 111 '--external-network', self.new_ct.external_network_id,
112 '--image', self.new_ct.image_id, 112 '--image', self.new_ct.image_id
113 '--name', self.new_ct.name
114 ] 113 ]
115 verifylist = [ 114 verifylist = [
116 ('external_network', self.new_ct.external_network_id), 115 ('external_network', self.new_ct.external_network_id),
117 ('image', self.new_ct.image_id), 116 ('image', self.new_ct.image_id)
118 ('name', self.new_ct.name)
119 ] 117 ]
120 self.assertRaises(magnum_fakes.MagnumParseException, 118 self.assertRaises(magnum_fakes.MagnumParseException,
121 self.check_parser, self.cmd, arglist, verifylist) 119 self.check_parser, self.cmd, arglist, verifylist)
diff --git a/magnumclient/tests/osc/unit/v1/test_clusters.py b/magnumclient/tests/osc/unit/v1/test_clusters.py
index f64794c..fe11764 100644
--- a/magnumclient/tests/osc/unit/v1/test_clusters.py
+++ b/magnumclient/tests/osc/unit/v1/test_clusters.py
@@ -46,7 +46,7 @@ class TestClusterCreate(TestCluster):
46 'labels': {}, 46 'labels': {},
47 'keypair': None, 47 'keypair': None,
48 'master_count': 1, 48 'master_count': 1,
49 'name': None, 49 'name': 'fake-cluster-1',
50 'node_count': 1 50 'node_count': 1
51 } 51 }
52 52
@@ -69,10 +69,12 @@ class TestClusterCreate(TestCluster):
69 """Verifies required arguments.""" 69 """Verifies required arguments."""
70 70
71 arglist = [ 71 arglist = [
72 '--cluster-template', self._cluster.cluster_template_id 72 '--cluster-template', self._cluster.cluster_template_id,
73 self._cluster.name
73 ] 74 ]
74 verifylist = [ 75 verifylist = [
75 ('cluster_template', self._cluster.cluster_template_id) 76 ('cluster_template', self._cluster.cluster_template_id),
77 ('name', self._cluster.name)
76 ] 78 ]
77 parsed_args = self.check_parser(self.cmd, arglist, verifylist) 79 parsed_args = self.check_parser(self.cmd, arglist, verifylist)
78 self.cmd.take_action(parsed_args) 80 self.cmd.take_action(parsed_args)
@@ -82,7 +84,7 @@ class TestClusterCreate(TestCluster):
82 """Verifies missing required arguments.""" 84 """Verifies missing required arguments."""
83 85
84 arglist = [ 86 arglist = [
85 '--name', self._cluster.name 87 self._cluster.name
86 ] 88 ]
87 verifylist = [ 89 verifylist = [
88 ('name', self._cluster.name) 90 ('name', self._cluster.name)