diff options
| author | Zuul <zuul@review.openstack.org> | 2018-11-02 18:59:27 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2018-11-02 18:59:27 +0000 |
| commit | 28797fe8753201057b855baf8d453018dd7b741c (patch) | |
| tree | ba1b6a12cf2d73a1ff4bf43cdfb4cc85f59cb091 /openstackclient/compute | |
| parent | 9437dffadab10856c9e161b89940393cf01f57e0 (diff) | |
| parent | 46074312583febe948c8ec8780aacd6850617cf5 (diff) | |
| download | python-openstackclient-28797fe8753201057b855baf8d453018dd7b741c.tar.gz | |
Merge "Default --nic to 'auto' if creating a server with >= 2.37" into stable/queens
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/server.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 88dd7cdd..135953aa 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -755,9 +755,14 @@ class CreateServer(command.ShowOne): raise exceptions.CommandError(msg) nics = nics[0] else: - # Default to empty list if nothing was specified, let nova side to - # decide the default behavior. - nics = [] + # Compute API version >= 2.37 requires a value, so default to + # 'auto' to maintain legacy behavior if a nic wasn't specified. + if compute_client.api_version >= api_versions.APIVersion('2.37'): + nics = 'auto' + else: + # Default to empty list if nothing was specified, let nova + # side to decide the default behavior. + nics = [] # Check security group exist and convert ID to name security_group_names = [] |
