summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Rocha <rocha.porto@gmail.com>2017-08-01 14:36:24 +0000
committerSpyros Trigazis (strigazi) <strigazi@gmail.com>2017-11-01 09:22:18 +0000
commitc035f9299ffcb474021732429d1277ed844abab2 (patch)
tree5e92ac4d80fe0fc7616a07f807101aad91f696c7
parent056e57deba44e6671110d8b5916fd588f0c12e64 (diff)
OSC: Add --master-flavor to coe cluster create
Add a master-flavor override parameter on osc cluster create to override the value present on the cluster template. Partial-Bug: #1699247 Depends-On: Id1d973167b381538121583a0a9691304b39e98de Change-Id: I7ef1c2d7c19be96089fbe0f0847294073ccab04e
Notes
Notes (review): Code-Review+2: Spyros Trigazis (strigazi) <strigazi@gmail.com> Code-Review+2: Madhuri Kumari <madhuri.kumari@intel.com> Workflow+1: Madhuri Kumari <madhuri.kumari@intel.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 22 Nov 2017 10:24:35 +0000 Reviewed-on: https://review.openstack.org/489623 Project: openstack/python-magnumclient Branch: refs/heads/master
-rw-r--r--magnumclient/osc/v1/clusters.py10
-rw-r--r--magnumclient/tests/osc/unit/v1/fakes.py3
-rw-r--r--magnumclient/tests/osc/unit/v1/test_clusters.py3
3 files changed, 13 insertions, 3 deletions
diff --git a/magnumclient/osc/v1/clusters.py b/magnumclient/osc/v1/clusters.py
index bb3e75c..27d3cae 100644
--- a/magnumclient/osc/v1/clusters.py
+++ b/magnumclient/osc/v1/clusters.py
@@ -42,7 +42,8 @@ CLUSTER_ATTRIBUTES = [
42 'discovery_url', 42 'discovery_url',
43 'master_count', 43 'master_count',
44 'container_version', 44 'container_version',
45 'name' 45 'name',
46 'master_flavor_id',
46] 47]
47 48
48 49
@@ -101,6 +102,12 @@ class CreateCluster(command.Command):
101 metavar='<timeout>', 102 metavar='<timeout>',
102 help=('The timeout for cluster creation time. The ' 103 help=('The timeout for cluster creation time. The '
103 'default is 60 minutes.')) 104 'default is 60 minutes.'))
105 parser.add_argument(
106 '--master-flavor',
107 dest='master_flavor',
108 metavar='<master-flavor>',
109 help=_('The nova flavor name or UUID to use when launching the '
110 'master node of the Cluster.'))
104 111
105 return parser 112 return parser
106 113
@@ -117,6 +124,7 @@ class CreateCluster(command.Command):
117 'master_count': parsed_args.master_count, 124 'master_count': parsed_args.master_count,
118 'name': parsed_args.name, 125 'name': parsed_args.name,
119 'node_count': parsed_args.node_count, 126 'node_count': parsed_args.node_count,
127 'master_flavor_id': parsed_args.master_flavor,
120 } 128 }
121 129
122 if parsed_args.labels is not None: 130 if parsed_args.labels is not None:
diff --git a/magnumclient/tests/osc/unit/v1/fakes.py b/magnumclient/tests/osc/unit/v1/fakes.py
index cabfb85..076aaac 100644
--- a/magnumclient/tests/osc/unit/v1/fakes.py
+++ b/magnumclient/tests/osc/unit/v1/fakes.py
@@ -200,7 +200,8 @@ class FakeCluster(object):
200 'discovery_url': 'https://fake.cluster', 200 'discovery_url': 'https://fake.cluster',
201 'master_count': 1, 201 'master_count': 1,
202 'container_version': None, 202 'container_version': None,
203 'name': 'fake-cluster' 203 'name': 'fake-cluster',
204 'master_flavor_id': None,
204 } 205 }
205 206
206 # Overwrite default attributes. 207 # Overwrite default attributes.
diff --git a/magnumclient/tests/osc/unit/v1/test_clusters.py b/magnumclient/tests/osc/unit/v1/test_clusters.py
index fe11764..065f8ee 100644
--- a/magnumclient/tests/osc/unit/v1/test_clusters.py
+++ b/magnumclient/tests/osc/unit/v1/test_clusters.py
@@ -47,7 +47,8 @@ class TestClusterCreate(TestCluster):
47 'keypair': None, 47 'keypair': None,
48 'master_count': 1, 48 'master_count': 1,
49 'name': 'fake-cluster-1', 49 'name': 'fake-cluster-1',
50 'node_count': 1 50 'node_count': 1,
51 'master_flavor_id': None,
51 } 52 }
52 53
53 self.clusters_mock.create = mock.Mock() 54 self.clusters_mock.create = mock.Mock()