From 75727c2d37eb616fc2d0573200db44552e106e91 Mon Sep 17 00:00:00 2001 From: Eugeniya Kudryashova Date: Thu, 25 Sep 2014 18:13:22 +0300 Subject: [PATCH] Fix E128 failures in novaclient/v1_1/ E128 continuation line under-indented for visual indent Change-Id: I93660ef15df87993738c98f8bb1a88cc65f99870 --- novaclient/v1_1/cloudpipe.py | 2 +- novaclient/v1_1/contrib/baremetal.py | 77 +++++++++++++--------- novaclient/v1_1/contrib/cells.py | 16 +++-- novaclient/v1_1/contrib/host_evacuate.py | 4 +- novaclient/v1_1/contrib/instance_action.py | 28 ++++---- novaclient/v1_1/contrib/migrations.py | 4 +- novaclient/v1_1/contrib/tenant_networks.py | 7 +- novaclient/v1_1/servers.py | 7 +- novaclient/v1_1/volume_snapshots.py | 6 +- novaclient/v1_1/volumes.py | 11 ++-- 10 files changed, 94 insertions(+), 68 deletions(-) diff --git a/novaclient/v1_1/cloudpipe.py b/novaclient/v1_1/cloudpipe.py index 6e05f4a20..c0926ed40 100644 --- a/novaclient/v1_1/cloudpipe.py +++ b/novaclient/v1_1/cloudpipe.py @@ -39,7 +39,7 @@ class CloudpipeManager(base.ManagerWithFind): """ body = {'cloudpipe': {'project_id': project}} return self._create('/os-cloudpipe', body, 'instance_id', - return_raw=True) + return_raw=True) def list(self): """ diff --git a/novaclient/v1_1/contrib/baremetal.py b/novaclient/v1_1/contrib/baremetal.py index 02e7ad76b..325e27211 100644 --- a/novaclient/v1_1/contrib/baremetal.py +++ b/novaclient/v1_1/contrib/baremetal.py @@ -71,14 +71,14 @@ class BareMetalNodeManager(base.ManagerWithFind): :rtype: :class:`BareMetalNode` """ body = {'node': {'service_host': service_host, - 'cpus': cpus, - 'memory_mb': memory_mb, - 'local_gb': local_gb, - 'pm_address': pm_address, - 'pm_user': pm_user, - 'pm_password': pm_password, - 'prov_mac_address': prov_mac_address, - 'terminal_port': terminal_port}} + 'cpus': cpus, + 'memory_mb': memory_mb, + 'local_gb': local_gb, + 'pm_address': pm_address, + 'pm_user': pm_user, + 'pm_password': pm_password, + 'prov_mac_address': prov_mac_address, + 'terminal_port': terminal_port}} return self._create('/os-baremetal-nodes', body, 'node') @@ -151,49 +151,61 @@ class BareMetalNodeManager(base.ManagerWithFind): return interfaces -@utils.arg('service_host', +@utils.arg( + 'service_host', metavar='', help=_('Name of nova compute host which will control this baremetal ' 'node')) -@utils.arg('cpus', +@utils.arg( + 'cpus', metavar='', type=int, help=_('Number of CPUs in the node')) -@utils.arg('memory_mb', +@utils.arg( + 'memory_mb', metavar='', type=int, help=_('Megabytes of RAM in the node')) -@utils.arg('local_gb', +@utils.arg( + 'local_gb', metavar='', type=int, help=_('Gigabytes of local storage in the node')) -@utils.arg('prov_mac_address', +@utils.arg( + 'prov_mac_address', metavar='', help=_('MAC address to provision the node')) -@utils.arg('--pm_address', default=None, +@utils.arg( + '--pm_address', default=None, metavar='', help=_('Power management IP for the node')) -@utils.arg('--pm_user', default=None, +@utils.arg( + '--pm_user', default=None, metavar='', help=_('Username for the node\'s power management')) -@utils.arg('--pm_password', default=None, +@utils.arg( + '--pm_password', default=None, metavar='', help=_('Password for the node\'s power management')) -@utils.arg('--terminal_port', default=None, +@utils.arg( + '--terminal_port', default=None, metavar='', type=int, help=_('ShellInABox port?')) def do_baremetal_node_create(cs, args): """Create a baremetal node.""" node = cs.baremetal.create(args.service_host, args.cpus, - args.memory_mb, args.local_gb, args.prov_mac_address, - pm_address=args.pm_address, pm_user=args.pm_user, - pm_password=args.pm_password, - terminal_port=args.terminal_port) + args.memory_mb, args.local_gb, + args.prov_mac_address, + pm_address=args.pm_address, + pm_user=args.pm_user, + pm_password=args.pm_password, + terminal_port=args.terminal_port) _print_baremetal_resource(node) -@utils.arg('node', +@utils.arg( + 'node', metavar='', help=_('ID of the node to delete.')) def do_baremetal_node_delete(cs, args): @@ -274,33 +286,38 @@ def _print_baremetal_node_interfaces(interfaces): ]) -@utils.arg('node', - metavar='', - help=_("ID of node")) +@utils.arg( + 'node', + metavar='', + help=_("ID of node")) def do_baremetal_node_show(cs, args): """Show information about a baremetal node.""" node = _find_baremetal_node(cs, args.node) _print_baremetal_resource(node) -@utils.arg('node', +@utils.arg( + 'node', metavar='', help=_("ID of node")) -@utils.arg('address', +@utils.arg( + 'address', metavar='
', help=_("MAC address of interface")) -@utils.arg('--datapath_id', +@utils.arg( + '--datapath_id', default=0, metavar='', help=_("OpenFlow Datapath ID of interface")) -@utils.arg('--port_no', +@utils.arg( + '--port_no', default=0, metavar='', help=_("OpenFlow port number of interface")) def do_baremetal_interface_add(cs, args): """Add a network interface to a baremetal node.""" bmif = cs.baremetal.add_interface(args.node, args.address, - args.datapath_id, args.port_no) + args.datapath_id, args.port_no) _print_baremetal_resource(bmif) diff --git a/novaclient/v1_1/contrib/cells.py b/novaclient/v1_1/contrib/cells.py index f3b544ed7..464ec8e15 100644 --- a/novaclient/v1_1/contrib/cells.py +++ b/novaclient/v1_1/contrib/cells.py @@ -46,19 +46,21 @@ class CellsManager(base.Manager): return self._get("/os-cells/%s" % path, "cell") -@utils.arg('cell', - metavar='', - help=_('Name of the cell.')) +@utils.arg( + 'cell', + metavar='', + help=_('Name of the cell.')) def do_cell_show(cs, args): """Show details of a given cell.""" cell = cs.cells.get(args.cell) utils.print_dict(cell._info) -@utils.arg('--cell', - metavar='', - help=_("Name of the cell to get the capacities."), - default=None) +@utils.arg( + '--cell', + metavar='', + help=_("Name of the cell to get the capacities."), + default=None) def do_cell_capacities(cs, args): """Get cell capacities for all cells or a given cell.""" cell = cs.cells.capacities(args.cell) diff --git a/novaclient/v1_1/contrib/host_evacuate.py b/novaclient/v1_1/contrib/host_evacuate.py index fc9416afc..e935e23db 100644 --- a/novaclient/v1_1/contrib/host_evacuate.py +++ b/novaclient/v1_1/contrib/host_evacuate.py @@ -33,8 +33,8 @@ def _server_evacuate(cs, server, args): error_message = _("Error while evacuating instance: %s") % e return EvacuateHostResponse(base.Manager, {"server_uuid": server['uuid'], - "evacuate_accepted": success, - "error_message": error_message}) + "evacuate_accepted": success, + "error_message": error_message}) @utils.arg('host', metavar='', help='Name of host.') diff --git a/novaclient/v1_1/contrib/instance_action.py b/novaclient/v1_1/contrib/instance_action.py index 1e4ed5829..2f20e0611 100644 --- a/novaclient/v1_1/contrib/instance_action.py +++ b/novaclient/v1_1/contrib/instance_action.py @@ -30,22 +30,24 @@ class InstanceActionManager(base.ManagerWithFind): :param request_id: The request_id of the action to get. """ return self._get("/servers/%s/os-instance-actions/%s" % - (base.getid(server), request_id), 'instanceAction') + (base.getid(server), request_id), 'instanceAction') def list(self, server): """ Get a list of actions performed on an server. """ return self._list('/servers/%s/os-instance-actions' % - base.getid(server), 'instanceActions') + base.getid(server), 'instanceActions') -@utils.arg('server', - metavar='', - help=_('Name or UUID of the server to show an action for.')) -@utils.arg('request_id', - metavar='', - help=_('Request ID of the action to get.')) +@utils.arg( + 'server', + metavar='', + help=_('Name or UUID of the server to show an action for.')) +@utils.arg( + 'request_id', + metavar='', + help=_('Request ID of the action to get.')) def do_instance_action(cs, args): """Show an action.""" server = utils.find_resource(cs.servers, args.server) @@ -56,12 +58,14 @@ def do_instance_action(cs, args): utils.print_dict(action) -@utils.arg('server', - metavar='', - help=_('Name or UUID of the server to list actions for.')) +@utils.arg( + 'server', + metavar='', + help=_('Name or UUID of the server to list actions for.')) def do_instance_action_list(cs, args): """List actions on a server.""" server = utils.find_resource(cs.servers, args.server) actions = cs.instance_action.list(server) utils.print_list(actions, - ['Action', 'Request_ID', 'Message', 'Start_Time'], sortby_index=3) + ['Action', 'Request_ID', 'Message', 'Start_Time'], + sortby_index=3) diff --git a/novaclient/v1_1/contrib/migrations.py b/novaclient/v1_1/contrib/migrations.py index d43cb7a15..c10fb3519 100644 --- a/novaclient/v1_1/contrib/migrations.py +++ b/novaclient/v1_1/contrib/migrations.py @@ -73,8 +73,8 @@ def do_migration_list(cs, args): def _print_migrations(migrations): fields = ['Source Node', 'Dest Node', 'Source Compute', 'Dest Compute', - 'Dest Host', 'Status', 'Instance UUID', 'Old Flavor', - 'New Flavor', 'Created At', 'Updated At'] + 'Dest Host', 'Status', 'Instance UUID', 'Old Flavor', + 'New Flavor', 'Created At', 'Updated At'] def old_flavor(migration): return migration.old_instance_type_id diff --git a/novaclient/v1_1/contrib/tenant_networks.py b/novaclient/v1_1/contrib/tenant_networks.py index 288d06cb4..3bd2547d4 100644 --- a/novaclient/v1_1/contrib/tenant_networks.py +++ b/novaclient/v1_1/contrib/tenant_networks.py @@ -59,9 +59,10 @@ def do_net_list(cs, args): @utils.arg('label', metavar='', help=_('Network label (ex. my_new_network)')) -@utils.arg('cidr', metavar='', - help=_('IP block to allocate from (ex. 172.16.0.0/24 or ' - '2001:DB8::/64)')) +@utils.arg( + 'cidr', metavar='', + help=_('IP block to allocate from (ex. 172.16.0.0/24 or ' + '2001:DB8::/64)')) def do_net_create(cs, args): """ Create a network diff --git a/novaclient/v1_1/servers.py b/novaclient/v1_1/servers.py index 66db32deb..2fe29afab 100644 --- a/novaclient/v1_1/servers.py +++ b/novaclient/v1_1/servers.py @@ -266,7 +266,7 @@ class Server(base.Resource): self.manager.reboot(self, reboot_type) def rebuild(self, image, password=None, preserve_ephemeral=False, - **kwargs): + **kwargs): """ Rebuild -- shut down and then re-image -- this server. @@ -276,7 +276,8 @@ class Server(base.Resource): be preserved when rebuilding the instance. Defaults to False. """ return self.manager.rebuild(self, image, password=password, - preserve_ephemeral=preserve_ephemeral, **kwargs) + preserve_ephemeral=preserve_ephemeral, + **kwargs) def resize(self, flavor, **kwargs): """ @@ -911,7 +912,7 @@ class ServerManager(base.BootingManagerWithFind): response_key = "server" return self._boot(resource_url, response_key, *boot_args, - **boot_kwargs) + **boot_kwargs) def update(self, server, name=None): """ diff --git a/novaclient/v1_1/volume_snapshots.py b/novaclient/v1_1/volume_snapshots.py index 1cc72ee1b..d3bc91808 100644 --- a/novaclient/v1_1/volume_snapshots.py +++ b/novaclient/v1_1/volume_snapshots.py @@ -56,9 +56,9 @@ class SnapshotManager(base.ManagerWithFind): :rtype: :class:`Snapshot` """ body = {'snapshot': {'volume_id': volume_id, - 'force': force, - 'display_name': display_name, - 'display_description': display_description}} + 'force': force, + 'display_name': display_name, + 'display_description': display_description}} return self._create('/snapshots', body, 'snapshot') def get(self, snapshot_id): diff --git a/novaclient/v1_1/volumes.py b/novaclient/v1_1/volumes.py index 4ff92a093..a3ba327f7 100644 --- a/novaclient/v1_1/volumes.py +++ b/novaclient/v1_1/volumes.py @@ -113,9 +113,9 @@ class VolumeManager(base.ManagerWithFind): :rtype: :class:`Volume` """ body = {'volumeAttachment': {'volumeId': volume_id, - 'device': device}} + 'device': device}} return self._create("/servers/%s/os-volume_attachments" % server_id, - body, "volumeAttachment") + body, "volumeAttachment") def update_server_volume(self, server_id, attachment_id, new_volume_id): """ @@ -129,7 +129,8 @@ class VolumeManager(base.ManagerWithFind): """ body = {'volumeAttachment': {'volumeId': new_volume_id}} return self._update("/servers/%s/os-volume_attachments/%s" % - (server_id, attachment_id,), body, "volumeAttachment") + (server_id, attachment_id,), + body, "volumeAttachment") def get_server_volume(self, server_id, attachment_id): """ @@ -141,7 +142,7 @@ class VolumeManager(base.ManagerWithFind): :rtype: :class:`Volume` """ return self._get("/servers/%s/os-volume_attachments/%s" % (server_id, - attachment_id,), "volumeAttachment") + attachment_id,), "volumeAttachment") def get_server_volumes(self, server_id): """ @@ -151,7 +152,7 @@ class VolumeManager(base.ManagerWithFind): :rtype: list of :class:`Volume` """ return self._list("/servers/%s/os-volume_attachments" % server_id, - "volumeAttachments") + "volumeAttachments") def delete_server_volume(self, server_id, attachment_id): """