diff options
| author | Zuul <zuul@review.opendev.org> | 2022-11-16 09:20:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-11-16 09:20:21 +0000 |
| commit | 16f18d4a8064e0477a29ac741f2413944748720e (patch) | |
| tree | b02abb04c1ef9deeeb534ef43c5e3067d8dd351d /openstackclient/compute | |
| parent | 348eb796321c8475af73b727a310c3a09f519ffa (diff) | |
| parent | ed0d568b948a04e893270d297c538773d058b73e (diff) | |
| download | python-openstackclient-16f18d4a8064e0477a29ac741f2413944748720e.tar.gz | |
Merge "compute: Fix '--network none/auto' handling"
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/server.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 39b2bdc8..1d072463 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -721,11 +721,6 @@ class NICAction(argparse.Action): if getattr(namespace, self.dest, None) is None: setattr(namespace, self.dest, []) - # Handle the special auto/none cases - if values in ('auto', 'none'): - getattr(namespace, self.dest).append(values) - return - if self.key: if ',' in values or '=' in values: msg = _( @@ -735,6 +730,12 @@ class NICAction(argparse.Action): raise argparse.ArgumentTypeError(msg % values) values = '='.join([self.key, values]) + else: + # Handle the special auto/none cases but only when a key isn't set + # (otherwise those could be valid values for the key) + if values in ('auto', 'none'): + getattr(namespace, self.dest).append(values) + return # We don't include 'tag' here by default since that requires a # particular microversion |
