From 7024d84e258199d51607e176bb4d8ad5e44f6991 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Wed, 26 Jul 2017 12:44:34 -0400 Subject: [PATCH] Be clear about hypevisors.search used in a few CLIs The following CLIs are doing a pattern match on the hypervisor hostname when getting servers: 1. nova host-evacuate 2. nova host-evacuate-live (terrible name) 3. nova host-servers-migrate 4. nova host-meta (terrible name) The fact that the hypervisor host(s) are looked up using a pattern match is not clear in the help string for the host argument. This makes the help more clear and adds a warning about being specific if you only want to target a specific host for these operations. In a later change we may modify the behavior in these CLIs which allow you to find hypervisors via pattern matching, but for now we should at least update the help text so we can backport it. Change-Id: Icec03326bb4d9f898c04e10199038167ce5e3cce Partial-Bug: #1667794 --- novaclient/v2/shell.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index 947fc31a3..1740bb1e1 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -4750,7 +4750,10 @@ def _server_evacuate(cs, server, args): "error_message": error_message}) -@utils.arg('host', metavar='', help='Name of host.') +@utils.arg('host', metavar='', + help='The hypervisor hostname (or pattern) to search for. ' + 'WARNING: Use a fully qualified domain name if you only ' + 'want to evacuate from a specific host.') @utils.arg( '--target_host', metavar='', @@ -4813,7 +4816,10 @@ def _server_live_migrate(cs, server, args): error_message) -@utils.arg('host', metavar='', help='Name of host.') +@utils.arg('host', metavar='', + help='The hypervisor hostname (or pattern) to search for. ' + 'WARNING: Use a fully qualified domain name if you only ' + 'want to live migrate from a specific host.') @utils.arg( '--target-host', metavar='', @@ -4886,7 +4892,10 @@ def _server_migrate(cs, server): "error_message": error_message}) -@utils.arg('host', metavar='', help='Name of host.') +@utils.arg('host', metavar='', + help='The hypervisor hostname (or pattern) to search for. ' + 'WARNING: Use a fully qualified domain name if you only ' + 'want to cold migrate from a specific host.') def do_host_servers_migrate(cs, args): """Cold migrate all instances off the specified host to other available hosts. @@ -4963,10 +4972,10 @@ def do_list_extensions(cs, _args): utils.print_list(extensions, fields) -@utils.arg( - 'host', - metavar='', - help=_('Name of host.')) +@utils.arg('host', metavar='', + help='The hypervisor hostname (or pattern) to search for. ' + 'WARNING: Use a fully qualified domain name if you only ' + 'want to update metadata for servers on a specific host.') @utils.arg( 'action', metavar='',