Map neutron_management_network to net_id in CLI
The JSON representation of a cluster uses neutron_management_network as a property name. The CLI allows for JSON injest, which is then translated into a ClusterManager.create call. The injest maps property names to parameter names to ClusterManager.create. This works in all cases except neutron_management_network, which is the net_id parameter to create. To address this, the CLI accepts neutron_management_network and maps it to the net_id parameter. Change-Id: I69799d0108740f0e79c82e45714fd946e9a2a4b0 Closes-bug: #1273500
This commit is contained in:
@@ -287,6 +287,11 @@ def do_cluster_create(cs, args):
|
||||
"""Create a cluster."""
|
||||
# TODO(mattf): improve template validation, e.g. template w/o name key
|
||||
template = json.loads(args.json.read())
|
||||
# The neutron_management_network parameter to clusters.create is
|
||||
# called net_id. Therefore, we must translate before invoking
|
||||
# create w/ **template. It may be desirable to simple change
|
||||
# clusters.create in the future.
|
||||
template['net_id'] = template.get('neutron_management_network', None)
|
||||
valid_args = inspect.getargspec(cs.clusters.create).args
|
||||
for name in template.keys():
|
||||
if name not in valid_args:
|
||||
|
||||
Reference in New Issue
Block a user