Skip to content

Commit

Permalink
Make nova CLI use term "server" where possible
Browse files Browse the repository at this point in the history
nova client was using terms "server" and "instance" interchangeably
which was very confusing.

This patch uses "server" where possible without touching the API.

Note that there are actions (instance-action, instance-action-list) and
arguments (--instance-name, --num-instances, ...) with "instance" in their
name which can't be changed easily.

Closes bug 1156648

Change-Id: I0570aa1c4dc9ad1852af307a2a4896f16073a6ab
  • Loading branch information
Jakub Ruzicka committed Sep 23, 2013
1 parent 8deaf37 commit aee366c
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 72 deletions.
72 changes: 36 additions & 36 deletions novaclient/v1_1/shell.py
Expand Up @@ -313,7 +313,7 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
default=None,
type=int,
metavar='<number>',
help="boot multi instances at a time (limited by quota).")
help="boot multiple servers at a time (limited by quota).")
@utils.arg('--meta',
metavar="<key=value>",
action='append',
Expand Down Expand Up @@ -343,7 +343,7 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
@utils.arg('--availability-zone',
default=None,
metavar='<availability-zone>',
help="The availability zone for instance placement.")
help="The availability zone for server placement.")
@utils.arg('--availability_zone',
help=argparse.SUPPRESS)
@utils.arg('--security-groups',
Expand Down Expand Up @@ -413,7 +413,7 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
dest='poll',
action="store_true",
default=False,
help='Blocks while instance builds so progress can be reported.')
help='Blocks while server builds so progress can be reported.')
def do_boot(cs, args):
"""Boot a new server."""
boot_args, boot_kwargs = _boot(cs, args)
Expand Down Expand Up @@ -476,10 +476,10 @@ def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
"""
def print_progress(progress):
if show_progress:
msg = ('\rInstance %(action)s... %(progress)s%% complete'
msg = ('\rServer %(action)s... %(progress)s%% complete'
% dict(action=action, progress=progress))
else:
msg = '\rInstance %(action)s...' % dict(action=action)
msg = '\rServer %(action)s...' % dict(action=action)

sys.stdout.write(msg)
sys.stdout.flush()
Expand All @@ -503,7 +503,7 @@ def print_progress(progress):
break
elif status == "error":
if not silent:
print("\nError %s instance" % action)
print("\nError %s server" % action)
break

if not silent:
Expand Down Expand Up @@ -1021,7 +1021,7 @@ def do_image_delete(cs, args):
dest='reservation_id',
metavar='<reservation-id>',
default=None,
help='Only return instances that match reservation-id.')
help='Only return servers that match reservation-id.')
@utils.arg('--reservation_id',
help=argparse.SUPPRESS)
@utils.arg('--ip',
Expand All @@ -1043,7 +1043,7 @@ def do_image_delete(cs, args):
dest='instance_name',
metavar='<name-regexp>',
default=None,
help='Search with regular expression match by instance name (Admin only).')
help='Search with regular expression match by server name (Admin only).')
@utils.arg('--instance_name',
help=argparse.SUPPRESS)
@utils.arg('--status',
Expand All @@ -1065,7 +1065,7 @@ def do_image_delete(cs, args):
dest='host',
metavar='<hostname>',
default=None,
help='Search instances by hostname to which they are assigned '
help='Search servers by hostname to which they are assigned '
'(Admin only).')
@utils.arg('--all-tenants',
dest='all_tenants',
Expand Down Expand Up @@ -1173,7 +1173,7 @@ def do_list(cs, args):
dest='poll',
action="store_true",
default=False,
help='Blocks while instance is rebooting.')
help='Blocks while server is rebooting.')
def do_reboot(cs, args):
"""Reboot a server."""
server = _find_server(cs, args.server)
Expand All @@ -1190,19 +1190,19 @@ def do_reboot(cs, args):
dest='rebuild_password',
metavar='<rebuild-password>',
default=False,
help="Set the provided password on the rebuild instance.")
help="Set the provided password on the rebuild server.")
@utils.arg('--rebuild_password',
help=argparse.SUPPRESS)
@utils.arg('--poll',
dest='poll',
action="store_true",
default=False,
help='Blocks while instance rebuilds so progress can be reported.')
help='Blocks while server rebuilds so progress can be reported.')
@utils.arg('--minimal',
dest='minimal',
action="store_true",
default=False,
help='Skips flavor/image lookups when showing instances')
help='Skips flavor/image lookups when showing servers')
def do_rebuild(cs, args):
"""Shutdown, re-image, and re-boot a server."""
server = _find_server(cs, args.server)
Expand Down Expand Up @@ -1235,7 +1235,7 @@ def do_rename(cs, args):
dest='poll',
action="store_true",
default=False,
help='Blocks while instance resizes so progress can be reported.')
help='Blocks while servers resizes so progress can be reported.')
def do_resize(cs, args):
"""Resize a server."""
server = _find_server(cs, args.server)
Expand Down Expand Up @@ -1264,7 +1264,7 @@ def do_resize_revert(cs, args):
dest='poll',
action="store_true",
default=False,
help='Blocks while instance migrates so progress can be reported.')
help='Blocks while server migrates so progress can be reported.')
def do_migrate(cs, args):
"""Migrate a server. The new host will be selected by the scheduler."""
server = _find_server(cs, args.server)
Expand Down Expand Up @@ -1361,7 +1361,7 @@ def do_root_password(cs, args):
dest='poll',
action="store_true",
default=False,
help='Blocks while instance snapshots so progress can be reported.')
help='Blocks while server snapshots so progress can be reported.')
def do_image_create(cs, args):
"""Create a new image by taking a snapshot of a running server."""
server = _find_server(cs, args.server)
Expand Down Expand Up @@ -1394,7 +1394,7 @@ def do_image_create(cs, args):
@utils.arg('rotation', metavar='<rotation>',
help='Int parameter representing how many backups to keep around.')
def do_backup(cs, args):
"""Backup a instance by create a 'backup' type snapshot."""
"""Backup a server by creating a 'backup' type snapshot."""
_find_server(cs, args.server).backup(args.name,
args.backup_type,
args.rotation)
Expand Down Expand Up @@ -1469,7 +1469,7 @@ def _print_server(cs, args):
dest='minimal',
action="store_true",
default=False,
help='Skips flavor/image lookups when showing instances')
help='Skips flavor/image lookups when showing servers')
@utils.arg('server', metavar='<server>', help='Name or ID of server.')
def do_show(cs, args):
"""Show details about the given server."""
Expand Down Expand Up @@ -1741,7 +1741,7 @@ def do_volume_snapshot_show(cs, args):
@utils.arg('--force',
metavar='<True|False>',
help='Optional flag to indicate whether to snapshot a volume even if its '
'attached to an instance. (Default=False)',
'attached to a server. (Default=False)',
default=False)
@utils.arg('--display-name',
metavar='<display-name>',
Expand Down Expand Up @@ -1858,7 +1858,7 @@ def do_clear_password(cs, args):


def _print_floating_ip_list(floating_ips):
utils.print_list(floating_ips, ['Ip', 'Instance Id', 'Fixed Ip', 'Pool'])
utils.print_list(floating_ips, ['Ip', 'Server Id', 'Fixed Ip', 'Pool'])


@utils.arg('server', metavar='<server>', help='Name or ID of server.')
Expand Down Expand Up @@ -2032,7 +2032,7 @@ def do_dns_delete_domain(cs, args):
@utils.arg('--availability-zone',
metavar='<availability-zone>',
default=None,
help='Limit access to this domain to instances '
help='Limit access to this domain to servers '
'in the specified availability zone.')
@utils.arg('--availability_zone',
help=argparse.SUPPRESS)
Expand Down Expand Up @@ -2304,7 +2304,7 @@ def do_secgroup_delete_group_rule(cs, args):
@utils.arg('--pub_key',
help=argparse.SUPPRESS)
def do_keypair_add(cs, args):
"""Create a new key pair for use with instances."""
"""Create a new key pair for use with servers."""
name = args.name
pub_key = args.pub_key

Expand Down Expand Up @@ -2387,7 +2387,7 @@ def do_rate_limits(cs, args):
def do_usage_list(cs, args):
"""List usage data for all tenants."""
dateformat = "%Y-%m-%d"
rows = ["Tenant ID", "Instances", "RAM MB-Hours", "CPU Hours",
rows = ["Tenant ID", "Servers", "RAM MB-Hours", "CPU Hours",
"Disk GB-Hours"]

now = timeutils.utcnow()
Expand Down Expand Up @@ -2434,7 +2434,7 @@ def simplify_usage(u):
def do_usage(cs, args):
"""Show usage data for a single tenant."""
dateformat = "%Y-%m-%d"
rows = ["Instances", "RAM MB-Hours", "CPU Hours", "Disk GB-Hours"]
rows = ["Servers", "RAM MB-Hours", "CPU Hours", "Disk GB-Hours"]

now = timeutils.utcnow()

Expand Down Expand Up @@ -2690,7 +2690,7 @@ def _print_aggregate_details(aggregate):
action='store_true',
help=argparse.SUPPRESS)
def do_live_migration(cs, args):
"""Migrate running instance to a new machine."""
"""Migrate running server to a new machine."""
_find_server(cs, args.server).live_migrate(args.host,
args.block_migrate,
args.disk_over_commit)
Expand All @@ -2699,16 +2699,16 @@ def do_live_migration(cs, args):
@utils.arg('server', metavar='<server>', help='Name or ID of server.')
@utils.arg('--active', action='store_const', dest='state',
default='error', const='active',
help='Request the instance be reset to "active" state instead '
help='Request the server be reset to "active" state instead '
'of "error" state (the default).')
def do_reset_state(cs, args):
"""Reset the state of an instance."""
"""Reset the state of a server."""
_find_server(cs, args.server).reset_state(args.state)


@utils.arg('server', metavar='<server>', help='Name or ID of server.')
def do_reset_network(cs, args):
"""Reset network of an instance."""
"""Reset network of a server."""
_find_server(cs, args.server).reset_network()


Expand Down Expand Up @@ -2884,7 +2884,7 @@ def do_hypervisor_list(cs, args):
@utils.arg('hostname', metavar='<hostname>',
help='The hypervisor hostname (or pattern) to search for.')
def do_hypervisor_servers(cs, args):
"""List instances belonging to specific hypervisors."""
"""List servers belonging to specific hypervisors."""
hypers = cs.hypervisors.search(args.hostname, servers=True)

class InstanceOnHyper(object):
Expand Down Expand Up @@ -2982,13 +2982,13 @@ def do_credentials(cs, _args):
action='store_true',
default=False,
help='Optional flag to indicate whether to use private address '
'attached to an instance. (Default=False)')
'attached to a server. (Default=False)')
@utils.arg('--ipv6',
dest='ipv6',
action='store_true',
default=False,
help='Optional flag to indicate whether to use an IPv6 address '
'attached to an instance. (Defaults to IPv4 address)')
'attached to a server. (Defaults to IPv4 address)')
@utils.arg('--login', metavar='<login>', help='Login to use.', default="root")
@utils.arg('-i', '--identity',
dest='identity',
Expand Down Expand Up @@ -3307,13 +3307,13 @@ def do_quota_class_update(cs, args):
dest='password',
metavar='<password>',
default=None,
help="Set the provided password on the evacuated instance. Not applicable "
help="Set the provided password on the evacuated server. Not applicable "
"with on-shared-storage flag")
@utils.arg('--on-shared-storage',
dest='on_shared_storage',
action="store_true",
default=False,
help='Specifies whether instance files located on shared storage')
help='Specifies whether server files are located on shared storage')
def do_evacuate(cs, args):
"""Evacuate server from failed host to specified one."""
server = _find_server(cs, args.server)
Expand All @@ -3340,7 +3340,7 @@ def __init__(self, interface):

@utils.arg('server', metavar='<server>', help='Name or ID of server.')
def do_interface_list(cs, args):
"""List interfaces attached to an instance."""
"""List interfaces attached to a server."""
server = _find_server(cs, args.server)

res = server.interface_list()
Expand All @@ -3355,7 +3355,7 @@ def do_interface_list(cs, args):
@utils.arg('--fixed-ip', metavar='<fixed_ip>', help='Requested fixed IP.',
default=None, dest="fixed_ip")
def do_interface_attach(cs, args):
"""Attach a network interface to an instance."""
"""Attach a network interface to a server."""
server = _find_server(cs, args.server)

res = server.interface_attach(args.port_id, args.net_id, args.fixed_ip)
Expand All @@ -3366,7 +3366,7 @@ def do_interface_attach(cs, args):
@utils.arg('server', metavar='<server>', help='Name or ID of server.')
@utils.arg('port_id', metavar='<port_id>', help='Port ID.')
def do_interface_detach(cs, args):
"""Detach a network interface from an instance."""
"""Detach a network interface from a server."""
server = _find_server(cs, args.server)

res = server.interface_detach(args.port_id)
Expand Down

0 comments on commit aee366c

Please sign in to comment.