summaryrefslogtreecommitdiff
path: root/openstackclient/compute
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2021-01-21 11:45:38 +0000
committerStephen Finucane <sfinucan@redhat.com>2021-01-22 13:00:46 +0000
commit8868c77a201703edaded5d06aa1734265431f786 (patch)
tree698fbf9764913ed07f9113baad2e2650f4df6be5 /openstackclient/compute
parent2bdf34dcc3f8957ff78709467197b5fcb44e07c3 (diff)
downloadpython-openstackclient-8868c77a201703edaded5d06aa1734265431f786.tar.gz
compute: Stop silently ignore --(no-)disk-overcommit
These options are not supported from Nova API microversion 2.25 and above. This can be a source of confusion. Start warning, with an eye on erroring out in the future. Change-Id: I53f27eb3e3c1a84d0d77a1672c008d0e8bb8536f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/compute')
-rw-r--r--openstackclient/compute/v2/server.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index c42486d9..111c4a6b 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -2519,7 +2519,10 @@ revert to release the new server and restart the old one.""")
'--disk-overcommit',
action='store_true',
default=False,
- help=_('Allow disk over-commit on the destination host'),
+ help=_(
+ 'Allow disk over-commit on the destination host'
+ '(supported with --os-compute-api-version 2.24 or below)'
+ ),
)
disk_group.add_argument(
'--no-disk-overcommit',
@@ -2528,6 +2531,7 @@ revert to release the new server and restart the old one.""")
default=False,
help=_(
'Do not over-commit disk on the destination host (default)'
+ '(supported with --os-compute-api-version 2.24 or below)'
),
)
parser.add_argument(
@@ -2603,6 +2607,15 @@ 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
+ elif parsed_args.disk_overcommit is not None:
+ # TODO(stephenfin): Raise an error here in OSC 7.0
+ msg = _(
+ 'The --disk-overcommit and --no-disk-overcommit '
+ 'options are only supported by '
+ '--os-compute-api-version 2.24 or below; this will '
+ 'be an error in a future release'
+ )
+ self.log.warning(msg)
server.live_migrate(**kwargs)
else: