Merge "In strings/comments change Ip/ip to IP"
This commit is contained in:
commit
664608200d
|
@ -863,7 +863,7 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||||
return (202, {}, self.get_flavors_2_os_flavor_access()[2])
|
return (202, {}, self.get_flavors_2_os_flavor_access()[2])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Floating ips
|
# Floating IPs
|
||||||
#
|
#
|
||||||
|
|
||||||
def get_os_floating_ip_pools(self):
|
def get_os_floating_ip_pools(self):
|
||||||
|
|
|
@ -89,12 +89,12 @@ class FloatingIPDNSEntryManager(base.Manager):
|
||||||
resource_class = FloatingIPDNSEntry
|
resource_class = FloatingIPDNSEntry
|
||||||
|
|
||||||
def get(self, domain, name):
|
def get(self, domain, name):
|
||||||
"""Return a list of entries for the given domain and ip or name."""
|
"""Return a list of entries for the given domain and IP or name."""
|
||||||
return self._get("/os-floating-ip-dns/%s/entries/%s" %
|
return self._get("/os-floating-ip-dns/%s/entries/%s" %
|
||||||
(_quote_domain(domain), name), "dns_entry")
|
(_quote_domain(domain), name), "dns_entry")
|
||||||
|
|
||||||
def get_for_ip(self, domain, ip):
|
def get_for_ip(self, domain, ip):
|
||||||
"""Return a list of entries for the given domain and ip or name."""
|
"""Return a list of entries for the given domain and IP or name."""
|
||||||
qparams = {'ip': ip}
|
qparams = {'ip': ip}
|
||||||
params = "?%s" % parse.urlencode(qparams)
|
params = "?%s" % parse.urlencode(qparams)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ from novaclient import base
|
||||||
class FloatingIP(base.Resource):
|
class FloatingIP(base.Resource):
|
||||||
def delete(self):
|
def delete(self):
|
||||||
"""
|
"""
|
||||||
Delete this floating ip
|
Delete this floating IP
|
||||||
"""
|
"""
|
||||||
self.manager.delete(self)
|
self.manager.delete(self)
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class FloatingIPManager(base.ManagerWithFind):
|
||||||
|
|
||||||
def list(self, all_tenants=False):
|
def list(self, all_tenants=False):
|
||||||
"""
|
"""
|
||||||
List floating ips
|
List floating IPs
|
||||||
"""
|
"""
|
||||||
url = '/os-floating-ips'
|
url = '/os-floating-ips'
|
||||||
if all_tenants:
|
if all_tenants:
|
||||||
|
@ -39,21 +39,21 @@ class FloatingIPManager(base.ManagerWithFind):
|
||||||
|
|
||||||
def create(self, pool=None):
|
def create(self, pool=None):
|
||||||
"""
|
"""
|
||||||
Create (allocate) a floating ip for a tenant
|
Create (allocate) a floating IP for a tenant
|
||||||
"""
|
"""
|
||||||
return self._create("/os-floating-ips", {'pool': pool}, "floating_ip")
|
return self._create("/os-floating-ips", {'pool': pool}, "floating_ip")
|
||||||
|
|
||||||
def delete(self, floating_ip):
|
def delete(self, floating_ip):
|
||||||
"""
|
"""
|
||||||
Delete (deallocate) a floating ip for a tenant
|
Delete (deallocate) a floating IP for a tenant
|
||||||
|
|
||||||
:param floating_ip: The floating ip address to delete.
|
:param floating_ip: The floating IP address to delete.
|
||||||
"""
|
"""
|
||||||
self._delete("/os-floating-ips/%s" % base.getid(floating_ip))
|
self._delete("/os-floating-ips/%s" % base.getid(floating_ip))
|
||||||
|
|
||||||
def get(self, floating_ip):
|
def get(self, floating_ip):
|
||||||
"""
|
"""
|
||||||
Retrieve a floating ip
|
Retrieve a floating IP
|
||||||
"""
|
"""
|
||||||
return self._get("/os-floating-ips/%s" % base.getid(floating_ip),
|
return self._get("/os-floating-ips/%s" % base.getid(floating_ip),
|
||||||
"floating_ip")
|
"floating_ip")
|
||||||
|
|
|
@ -50,7 +50,7 @@ class SecurityGroupDefaultRuleManager(base.Manager):
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
raise exceptions.CommandError(_("To port must be an integer."))
|
raise exceptions.CommandError(_("To port must be an integer."))
|
||||||
if ip_protocol.upper() not in ['TCP', 'UDP', 'ICMP']:
|
if ip_protocol.upper() not in ['TCP', 'UDP', 'ICMP']:
|
||||||
raise exceptions.CommandError(_("Ip protocol must be 'tcp', 'udp'"
|
raise exceptions.CommandError(_("IP protocol must be 'tcp', 'udp'"
|
||||||
", or 'icmp'."))
|
", or 'icmp'."))
|
||||||
|
|
||||||
body = {"security_group_default_rule": {
|
body = {"security_group_default_rule": {
|
||||||
|
|
|
@ -55,7 +55,7 @@ class SecurityGroupRuleManager(base.Manager):
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
raise exceptions.CommandError(_("To port must be an integer."))
|
raise exceptions.CommandError(_("To port must be an integer."))
|
||||||
if ip_protocol.upper() not in ['TCP', 'UDP', 'ICMP']:
|
if ip_protocol.upper() not in ['TCP', 'UDP', 'ICMP']:
|
||||||
raise exceptions.CommandError(_("Ip protocol must be 'tcp', 'udp'"
|
raise exceptions.CommandError(_("IP protocol must be 'tcp', 'udp'"
|
||||||
", or 'icmp'."))
|
", or 'icmp'."))
|
||||||
|
|
||||||
body = {"security_group_rule": {
|
body = {"security_group_rule": {
|
||||||
|
|
|
@ -125,7 +125,7 @@ class Server(base.Resource):
|
||||||
"""
|
"""
|
||||||
Add floating IP to an instance
|
Add floating IP to an instance
|
||||||
|
|
||||||
:param address: The ip address or FloatingIP to add to the instance
|
:param address: The IP address or FloatingIP to add to the instance
|
||||||
:param fixed_address: The fixedIP address the FloatingIP is to be
|
:param fixed_address: The fixedIP address the FloatingIP is to be
|
||||||
associated with (optional)
|
associated with (optional)
|
||||||
"""
|
"""
|
||||||
|
@ -135,7 +135,7 @@ class Server(base.Resource):
|
||||||
"""
|
"""
|
||||||
Remove floating IP from an instance
|
Remove floating IP from an instance
|
||||||
|
|
||||||
:param address: The ip address or FloatingIP to remove
|
:param address: The IP address or FloatingIP to remove
|
||||||
"""
|
"""
|
||||||
self.manager.remove_floating_ip(self, address)
|
self.manager.remove_floating_ip(self, address)
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ class ServerManager(base.BootingManagerWithFind):
|
||||||
this server.
|
this server.
|
||||||
:param nics: (optional extension) an ordered list of nics to be
|
:param nics: (optional extension) an ordered list of nics to be
|
||||||
added to this server, with information about
|
added to this server, with information about
|
||||||
connected networks, fixed ips, etc.
|
connected networks, fixed IPs, etc.
|
||||||
:param scheduler_hints: (optional extension) arbitrary key-value pairs
|
:param scheduler_hints: (optional extension) arbitrary key-value pairs
|
||||||
specified by the client to help boot an instance.
|
specified by the client to help boot an instance.
|
||||||
:param config_drive: (optional extension) If True, enable config drive
|
:param config_drive: (optional extension) If True, enable config drive
|
||||||
|
@ -639,7 +639,7 @@ class ServerManager(base.BootingManagerWithFind):
|
||||||
|
|
||||||
def add_floating_ip(self, server, address, fixed_address=None):
|
def add_floating_ip(self, server, address, fixed_address=None):
|
||||||
"""
|
"""
|
||||||
Add a floating ip to an instance
|
Add a floating IP to an instance
|
||||||
|
|
||||||
:param server: The :class:`Server` (or its ID) to add an IP to.
|
:param server: The :class:`Server` (or its ID) to add an IP to.
|
||||||
:param address: The FloatingIP or string floating address to add.
|
:param address: The FloatingIP or string floating address to add.
|
||||||
|
@ -886,7 +886,7 @@ class ServerManager(base.BootingManagerWithFind):
|
||||||
device mappings for this server.
|
device mappings for this server.
|
||||||
:param nics: (optional extension) an ordered list of nics to be
|
:param nics: (optional extension) an ordered list of nics to be
|
||||||
added to this server, with information about
|
added to this server, with information about
|
||||||
connected networks, fixed ips, port etc.
|
connected networks, fixed IPs, port etc.
|
||||||
:param scheduler_hints: (optional extension) arbitrary key-value pairs
|
:param scheduler_hints: (optional extension) arbitrary key-value pairs
|
||||||
specified by the client to help boot an instance
|
specified by the client to help boot an instance
|
||||||
:param config_drive: (optional extension) value for config drive
|
:param config_drive: (optional extension) value for config drive
|
||||||
|
|
|
@ -2331,7 +2331,7 @@ def _print_floating_ip_list(floating_ips):
|
||||||
_translate_keys(floating_ips, convert)
|
_translate_keys(floating_ips, convert)
|
||||||
|
|
||||||
utils.print_list(floating_ips,
|
utils.print_list(floating_ips,
|
||||||
['Id', 'Ip', 'Server Id', 'Fixed Ip', 'Pool'])
|
['Id', 'IP', 'Server Id', 'Fixed IP', 'Pool'])
|
||||||
|
|
||||||
|
|
||||||
@cliutils.arg('server', metavar='<server>', help=_('Name or ID of server.'))
|
@cliutils.arg('server', metavar='<server>', help=_('Name or ID of server.'))
|
||||||
|
@ -2436,14 +2436,14 @@ def do_floating_ip_create(cs, args):
|
||||||
_print_floating_ip_list([cs.floating_ips.create(pool=args.pool)])
|
_print_floating_ip_list([cs.floating_ips.create(pool=args.pool)])
|
||||||
|
|
||||||
|
|
||||||
@cliutils.arg('address', metavar='<address>', help=_('IP of Floating Ip.'))
|
@cliutils.arg('address', metavar='<address>', help=_('IP of Floating IP.'))
|
||||||
def do_floating_ip_delete(cs, args):
|
def do_floating_ip_delete(cs, args):
|
||||||
"""De-allocate a floating IP."""
|
"""De-allocate a floating IP."""
|
||||||
floating_ips = cs.floating_ips.list()
|
floating_ips = cs.floating_ips.list()
|
||||||
for floating_ip in floating_ips:
|
for floating_ip in floating_ips:
|
||||||
if floating_ip.ip == args.address:
|
if floating_ip.ip == args.address:
|
||||||
return cs.floating_ips.delete(floating_ip.id)
|
return cs.floating_ips.delete(floating_ip.id)
|
||||||
raise exceptions.CommandError(_("Floating ip %s not found.") %
|
raise exceptions.CommandError(_("Floating IP %s not found.") %
|
||||||
args.address)
|
args.address)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2453,12 +2453,12 @@ def do_floating_ip_delete(cs, args):
|
||||||
default=False,
|
default=False,
|
||||||
help=_('Display floatingips from all tenants (Admin only).'))
|
help=_('Display floatingips from all tenants (Admin only).'))
|
||||||
def do_floating_ip_list(cs, args):
|
def do_floating_ip_list(cs, args):
|
||||||
"""List floating ips."""
|
"""List floating IPs."""
|
||||||
_print_floating_ip_list(cs.floating_ips.list(args.all_tenants))
|
_print_floating_ip_list(cs.floating_ips.list(args.all_tenants))
|
||||||
|
|
||||||
|
|
||||||
def do_floating_ip_pool_list(cs, _args):
|
def do_floating_ip_pool_list(cs, _args):
|
||||||
"""List all floating ip pools."""
|
"""List all floating IP pools."""
|
||||||
utils.print_list(cs.floating_ip_pools.list(), ['name'])
|
utils.print_list(cs.floating_ip_pools.list(), ['name'])
|
||||||
|
|
||||||
|
|
||||||
|
@ -2466,7 +2466,7 @@ def do_floating_ip_pool_list(cs, _args):
|
||||||
'--host', dest='host', metavar='<host>', default=None,
|
'--host', dest='host', metavar='<host>', default=None,
|
||||||
help=_('Filter by host'))
|
help=_('Filter by host'))
|
||||||
def do_floating_ip_bulk_list(cs, args):
|
def do_floating_ip_bulk_list(cs, args):
|
||||||
"""List all floating ips."""
|
"""List all floating IPs."""
|
||||||
utils.print_list(cs.floating_ips_bulk.list(args.host), ['project_id',
|
utils.print_list(cs.floating_ips_bulk.list(args.host), ['project_id',
|
||||||
'address',
|
'address',
|
||||||
'instance_uuid',
|
'instance_uuid',
|
||||||
|
@ -2482,13 +2482,13 @@ def do_floating_ip_bulk_list(cs, args):
|
||||||
'--interface', metavar='<interface>', default=None,
|
'--interface', metavar='<interface>', default=None,
|
||||||
help=_('Interface for new Floating IPs'))
|
help=_('Interface for new Floating IPs'))
|
||||||
def do_floating_ip_bulk_create(cs, args):
|
def do_floating_ip_bulk_create(cs, args):
|
||||||
"""Bulk create floating ips by range."""
|
"""Bulk create floating IPs by range."""
|
||||||
cs.floating_ips_bulk.create(args.ip_range, args.pool, args.interface)
|
cs.floating_ips_bulk.create(args.ip_range, args.pool, args.interface)
|
||||||
|
|
||||||
|
|
||||||
@cliutils.arg('ip_range', metavar='<range>', help=_('Address range to delete'))
|
@cliutils.arg('ip_range', metavar='<range>', help=_('Address range to delete'))
|
||||||
def do_floating_ip_bulk_delete(cs, args):
|
def do_floating_ip_bulk_delete(cs, args):
|
||||||
"""Bulk delete floating ips by range."""
|
"""Bulk delete floating IPs by range."""
|
||||||
cs.floating_ips_bulk.delete(args.ip_range)
|
cs.floating_ips_bulk.delete(args.ip_range)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2508,10 +2508,10 @@ def do_dns_domains(cs, args):
|
||||||
|
|
||||||
|
|
||||||
@cliutils.arg('domain', metavar='<domain>', help=_('DNS domain'))
|
@cliutils.arg('domain', metavar='<domain>', help=_('DNS domain'))
|
||||||
@cliutils.arg('--ip', metavar='<ip>', help=_('ip address'), default=None)
|
@cliutils.arg('--ip', metavar='<ip>', help=_('IP address'), default=None)
|
||||||
@cliutils.arg('--name', metavar='<name>', help=_('DNS name'), default=None)
|
@cliutils.arg('--name', metavar='<name>', help=_('DNS name'), default=None)
|
||||||
def do_dns_list(cs, args):
|
def do_dns_list(cs, args):
|
||||||
"""List current DNS entries for domain and ip or domain and name."""
|
"""List current DNS entries for domain and IP or domain and name."""
|
||||||
if not (args.ip or args.name):
|
if not (args.ip or args.name):
|
||||||
raise exceptions.CommandError(
|
raise exceptions.CommandError(
|
||||||
_("You must specify either --ip or --name"))
|
_("You must specify either --ip or --name"))
|
||||||
|
@ -2524,7 +2524,7 @@ def do_dns_list(cs, args):
|
||||||
_print_dns_list(entries)
|
_print_dns_list(entries)
|
||||||
|
|
||||||
|
|
||||||
@cliutils.arg('ip', metavar='<ip>', help=_('ip address'))
|
@cliutils.arg('ip', metavar='<ip>', help=_('IP address'))
|
||||||
@cliutils.arg('name', metavar='<name>', help=_('DNS name'))
|
@cliutils.arg('name', metavar='<name>', help=_('DNS name'))
|
||||||
@cliutils.arg('domain', metavar='<domain>', help=_('DNS domain'))
|
@cliutils.arg('domain', metavar='<domain>', help=_('DNS domain'))
|
||||||
@cliutils.arg(
|
@cliutils.arg(
|
||||||
|
@ -2533,7 +2533,7 @@ def do_dns_list(cs, args):
|
||||||
help=_('dns type (e.g. "A")'),
|
help=_('dns type (e.g. "A")'),
|
||||||
default='A')
|
default='A')
|
||||||
def do_dns_create(cs, args):
|
def do_dns_create(cs, args):
|
||||||
"""Create a DNS entry for domain, name and ip."""
|
"""Create a DNS entry for domain, name and IP."""
|
||||||
cs.dns_entries.create(args.domain, args.name, args.ip, args.type)
|
cs.dns_entries.create(args.domain, args.name, args.ip, args.type)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3483,7 +3483,7 @@ def do_service_delete(cs, args):
|
||||||
|
|
||||||
@cliutils.arg('fixed_ip', metavar='<fixed_ip>', help=_('Fixed IP Address.'))
|
@cliutils.arg('fixed_ip', metavar='<fixed_ip>', help=_('Fixed IP Address.'))
|
||||||
def do_fixed_ip_get(cs, args):
|
def do_fixed_ip_get(cs, args):
|
||||||
"""Retrieve info on a fixed ip."""
|
"""Retrieve info on a fixed IP."""
|
||||||
result = cs.fixed_ips.get(args.fixed_ip)
|
result = cs.fixed_ips.get(args.fixed_ip)
|
||||||
utils.print_list([result], ['address', 'cidr', 'hostname', 'host'])
|
utils.print_list([result], ['address', 'cidr', 'hostname', 'host'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue