summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Rocha <rocha.porto@gmail.com>2017-08-01 14:44:52 +0000
committerRicardo Rocha <rocha.porto@gmail.com>2017-12-15 14:32:17 +0000
commitdd0958860d5df5b7da9be50a294912a47e016087 (patch)
tree9b4bbd9ac2c9d01716f2e3fcf5bfd0660fc8b326
parente814523685dc2ef3c914f4535898a7604311d284 (diff)
OSC: Add --flavor to coe cluster create
Add a flavor override parameter on osc cluster create to override the value present on the cluster template. Partial-Bug: #1699245 Depends-On: Ib60c05cce1cf2639ca4740abdd264403033433f9 Change-Id: Ib00514b66ee2d0a2ee4ddafb5b8c2ff8fa82de77
Notes
Notes (review): Code-Review+2: Spyros Trigazis (strigazi) <strigazi@gmail.com> Code-Review+2: yatin <ykarel@redhat.com> Workflow+1: yatin <ykarel@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sun, 17 Dec 2017 12:43:19 +0000 Reviewed-on: https://review.openstack.org/489627 Project: openstack/python-magnumclient Branch: refs/heads/master
-rw-r--r--magnumclient/osc/v1/clusters.py7
-rw-r--r--magnumclient/tests/osc/unit/v1/fakes.py1
-rw-r--r--magnumclient/tests/osc/unit/v1/test_clusters.py1
-rw-r--r--magnumclient/v1/clusters.py1
4 files changed, 10 insertions, 0 deletions
diff --git a/magnumclient/osc/v1/clusters.py b/magnumclient/osc/v1/clusters.py
index 27d3cae..3a92acd 100644
--- a/magnumclient/osc/v1/clusters.py
+++ b/magnumclient/osc/v1/clusters.py
@@ -44,6 +44,7 @@ CLUSTER_ATTRIBUTES = [
44 'container_version', 44 'container_version',
45 'name', 45 'name',
46 'master_flavor_id', 46 'master_flavor_id',
47 'flavor_id',
47] 48]
48 49
49 50
@@ -108,6 +109,11 @@ class CreateCluster(command.Command):
108 metavar='<master-flavor>', 109 metavar='<master-flavor>',
109 help=_('The nova flavor name or UUID to use when launching the ' 110 help=_('The nova flavor name or UUID to use when launching the '
110 'master node of the Cluster.')) 111 'master node of the Cluster.'))
112 parser.add_argument(
113 '--flavor',
114 metavar='<flavor>',
115 help=_('The nova flavor name or UUID to use when launching the '
116 'Cluster.'))
111 117
112 return parser 118 return parser
113 119
@@ -125,6 +131,7 @@ class CreateCluster(command.Command):
125 'name': parsed_args.name, 131 'name': parsed_args.name,
126 'node_count': parsed_args.node_count, 132 'node_count': parsed_args.node_count,
127 'master_flavor_id': parsed_args.master_flavor, 133 'master_flavor_id': parsed_args.master_flavor,
134 'flavor_id': parsed_args.flavor,
128 } 135 }
129 136
130 if parsed_args.labels is not None: 137 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 034dfe7..703e3c4 100644
--- a/magnumclient/tests/osc/unit/v1/fakes.py
+++ b/magnumclient/tests/osc/unit/v1/fakes.py
@@ -203,6 +203,7 @@ class FakeCluster(object):
203 'container_version': None, 203 'container_version': None,
204 'name': 'fake-cluster', 204 'name': 'fake-cluster',
205 'master_flavor_id': None, 205 'master_flavor_id': None,
206 'flavor_id': 'm1.medium',
206 } 207 }
207 208
208 # Overwrite default attributes. 209 # Overwrite default attributes.
diff --git a/magnumclient/tests/osc/unit/v1/test_clusters.py b/magnumclient/tests/osc/unit/v1/test_clusters.py
index 065f8ee..62f7671 100644
--- a/magnumclient/tests/osc/unit/v1/test_clusters.py
+++ b/magnumclient/tests/osc/unit/v1/test_clusters.py
@@ -44,6 +44,7 @@ class TestClusterCreate(TestCluster):
44 'discovery_url': None, 44 'discovery_url': None,
45 'docker_volume_size': None, 45 'docker_volume_size': None,
46 'labels': {}, 46 'labels': {},
47 'flavor_id': None,
47 'keypair': None, 48 'keypair': None,
48 'master_count': 1, 49 'master_count': 1,
49 'name': 'fake-cluster-1', 50 'name': 'fake-cluster-1',
diff --git a/magnumclient/v1/clusters.py b/magnumclient/v1/clusters.py
index df5ebfe..cdb599a 100644
--- a/magnumclient/v1/clusters.py
+++ b/magnumclient/v1/clusters.py
@@ -22,6 +22,7 @@ CREATION_ATTRIBUTES.append('keypair')
22CREATION_ATTRIBUTES.append('docker_volume_size') 22CREATION_ATTRIBUTES.append('docker_volume_size')
23CREATION_ATTRIBUTES.append('labels') 23CREATION_ATTRIBUTES.append('labels')
24CREATION_ATTRIBUTES.append('master_flavor_id') 24CREATION_ATTRIBUTES.append('master_flavor_id')
25CREATION_ATTRIBUTES.append('flavor_id')
25 26
26 27
27class Cluster(baseunit.BaseTemplate): 28class Cluster(baseunit.BaseTemplate):