summaryrefslogtreecommitdiff
path: root/openstackclient/compute
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/compute')
-rw-r--r--openstackclient/compute/v2/server.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index c11f4b57..d0edaf07 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -2621,7 +2621,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)'
@@ -2631,7 +2631,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)'
@@ -2693,6 +2692,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 = _(