compute: Don't warn if disk overcommit params unset
Due to a small logic error, we were emitting a warning about a deprecated option when the user tried to live migrate an instance using microversion 2.25 even though the user hadn't actually set that option. Correct this. Change-Id: Ib61e817bd4ced9b5533e7c7f9d8f0b45fe81c211 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2009657 Task: 43836
This commit is contained in:
parent
f824e13bc5
commit
8cb0a28607
openstackclient
@ -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 = _(
|
||||
|
@ -4812,7 +4812,7 @@ class TestServerMigrate(TestServer):
|
||||
verifylist = [
|
||||
('live_migration', False),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -4834,7 +4834,7 @@ class TestServerMigrate(TestServer):
|
||||
('live_migration', False),
|
||||
('host', 'fakehost'),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -4856,7 +4856,7 @@ class TestServerMigrate(TestServer):
|
||||
verifylist = [
|
||||
('live_migration', False),
|
||||
('block_migration', True),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -4897,7 +4897,7 @@ class TestServerMigrate(TestServer):
|
||||
('live_migration', False),
|
||||
('host', 'fakehost'),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -4923,7 +4923,7 @@ class TestServerMigrate(TestServer):
|
||||
('live_migration', True),
|
||||
('host', None),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -4947,7 +4947,7 @@ class TestServerMigrate(TestServer):
|
||||
('live_migration', True),
|
||||
('host', 'fakehost'),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -4975,7 +4975,7 @@ class TestServerMigrate(TestServer):
|
||||
('live_migration', True),
|
||||
('host', 'fakehost'),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -5002,7 +5002,7 @@ class TestServerMigrate(TestServer):
|
||||
verifylist = [
|
||||
('live_migration', True),
|
||||
('block_migration', True),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', False),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -5088,7 +5088,7 @@ class TestServerMigrate(TestServer):
|
||||
verifylist = [
|
||||
('live_migration', False),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', True),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
@ -5108,7 +5108,7 @@ class TestServerMigrate(TestServer):
|
||||
verifylist = [
|
||||
('live_migration', False),
|
||||
('block_migration', None),
|
||||
('disk_overcommit', False),
|
||||
('disk_overcommit', None),
|
||||
('wait', True),
|
||||
]
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
|
Loading…
x
Reference in New Issue
Block a user