Merge "Now `name` is a positional argument in cluster creation"

This commit is contained in:
Zuul 2017-10-03 17:28:38 +00:00 committed by Gerrit Code Review
commit b9f9e1c529
4 changed files with 11 additions and 11 deletions

View File

@ -71,7 +71,7 @@ class CreateClusterTemplate(command.ShowOne):
parser = super(CreateClusterTemplate, self).get_parser(prog_name)
parser.add_argument(
'--name',
'name',
metavar='<name>',
help=_('Name of the cluster template to create.'))
parser.add_argument(

View File

@ -86,7 +86,7 @@ class CreateCluster(command.Command):
default=1,
metavar='<master-count>',
help='The number of master nodes for the cluster.')
parser.add_argument('--name',
parser.add_argument('name',
metavar='<name>',
help='Name of the cluster to create.')
parser.add_argument('--node-count',

View File

@ -91,7 +91,7 @@ class TestClusterTemplateCreate(TestClusterTemplate):
'--coe', self.new_ct.coe,
'--external-network', self.new_ct.external_network_id,
'--image', self.new_ct.image_id,
'--name', self.new_ct.name
self.new_ct.name
]
verifylist = [
('coe', self.new_ct.coe),
@ -109,13 +109,11 @@ class TestClusterTemplateCreate(TestClusterTemplate):
arglist = [
'--external-network', self.new_ct.external_network_id,
'--image', self.new_ct.image_id,
'--name', self.new_ct.name
'--image', self.new_ct.image_id
]
verifylist = [
('external_network', self.new_ct.external_network_id),
('image', self.new_ct.image_id),
('name', self.new_ct.name)
('image', self.new_ct.image_id)
]
self.assertRaises(magnum_fakes.MagnumParseException,
self.check_parser, self.cmd, arglist, verifylist)

View File

@ -46,7 +46,7 @@ class TestClusterCreate(TestCluster):
'labels': {},
'keypair': None,
'master_count': 1,
'name': None,
'name': 'fake-cluster-1',
'node_count': 1
}
@ -69,10 +69,12 @@ class TestClusterCreate(TestCluster):
"""Verifies required arguments."""
arglist = [
'--cluster-template', self._cluster.cluster_template_id
'--cluster-template', self._cluster.cluster_template_id,
self._cluster.name
]
verifylist = [
('cluster_template', self._cluster.cluster_template_id)
('cluster_template', self._cluster.cluster_template_id),
('name', self._cluster.name)
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
self.cmd.take_action(parsed_args)
@ -82,7 +84,7 @@ class TestClusterCreate(TestCluster):
"""Verifies missing required arguments."""
arglist = [
'--name', self._cluster.name
self._cluster.name
]
verifylist = [
('name', self._cluster.name)