compute: Use correct command class for 'show migration'

We should be inheriting from 'ShowOne'. Failure to do so results in a
tuple being dumped to the screen. Not what we intended.

While we're here, we update the docstring of this command to clarify the
command's intent. Nova does not provide an API to retrieve an individual
migration record for a cold migration or completed live migration. As
such, the 'server migration show' command only works for in-progress
live-migrations.

Change-Id: I2e2fe3da7d642b9e8e3d930603dcde178cd68cde
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2009658
Task: 43837
This commit is contained in:
Stephen Finucane 2021-11-02 09:34:32 +00:00
parent 8cb0a28607
commit 442838ed15
1 changed files with 7 additions and 2 deletions

View File

@ -2967,8 +2967,13 @@ class ListMigration(command.Lister):
return self.print_migrations(parsed_args, compute_client, migrations)
class ShowMigration(command.Command):
"""Show a migration for a given server."""
class ShowMigration(command.ShowOne):
"""Show an in-progress live migration for a given server.
Note that it is not possible to show cold migrations or completed
live-migrations. Use 'openstack server migration list' to get details for
these.
"""
def get_parser(self, prog_name):
parser = super().get_parser(prog_name)