diff options
| author | Zuul <zuul@review.opendev.org> | 2022-02-09 20:42:33 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-02-09 20:42:33 +0000 |
| commit | b072118afc645a54bbaa3518b09a266332b27979 (patch) | |
| tree | 6852aba5315ab8ff37f4506bb2b7641d5f1b64d0 /openstackclient/compute | |
| parent | 27843fc232622a756d0c6a0e7d4ddecbddb2ae11 (diff) | |
| parent | 8cb0a28607e7f8b9eb4bb71a95b39230d43a969c (diff) | |
| download | python-openstackclient-b072118afc645a54bbaa3518b09a266332b27979.tar.gz | |
Merge "compute: Don't warn if disk overcommit params unset"
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/server.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py index 380c0649..a46fb904 100644 --- a/openstackclient/compute/v2/server.py +++ b/openstackclient/compute/v2/server.py @@ -2691,7 +2691,7 @@ revert to release the new server and restart the old one.""") disk_group.add_argument( '--disk-overcommit', action='store_true', - default=False, + default=None, help=_( 'Allow disk over-commit on the destination host' '(supported with --os-compute-api-version 2.24 or below)' @@ -2701,7 +2701,6 @@ revert to release the new server and restart the old one.""") '--no-disk-overcommit', dest='disk_overcommit', action='store_false', - default=False, help=_( 'Do not over-commit disk on the destination host (default)' '(supported with --os-compute-api-version 2.24 or below)' @@ -2763,6 +2762,11 @@ revert to release the new server and restart the old one.""") if compute_client.api_version < api_versions.APIVersion('2.25'): kwargs['disk_over_commit'] = parsed_args.disk_overcommit + # We can't use an argparse default value because then we can't + # distinguish between explicit 'False' and unset for the below + # case (microversion >= 2.25) + if kwargs['disk_over_commit'] is None: + kwargs['disk_over_commit'] = False elif parsed_args.disk_overcommit is not None: # TODO(stephenfin): Raise an error here in OSC 7.0 msg = _( |
