From 1bf87dda57b076e042301eeafa966283265d08cf Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 8 Jun 2013 13:18:51 +0200 Subject: Fix and enable H403 tests Multi-line doc-strings should end on a new, separate line. Change-Id: I4cf0cfe92b634ef77971863a4df41ef43531bc20 --- nova/compute/api.py | 16 ++++++++++------ nova/compute/flavors.py | 9 ++++++--- nova/compute/manager.py | 9 ++++++--- 3 files changed, 22 insertions(+), 12 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index b88b9004a..91f3a60ef 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -557,7 +557,8 @@ class API(base.Base): block_device_mapping, auto_disk_config, reservation_id): """Verify all the input parameters regardless of the provisioning - strategy being performed.""" + strategy being performed. + """ if min_count > 1 or max_count > 1: if any(map(lambda bdm: 'volume_id' in bdm, block_device_mapping)): msg = _('Cannot attach one or more volumes to multiple' @@ -722,7 +723,8 @@ class API(base.Base): reservation_id=None, scheduler_hints=None): """Verify all the input parameters regardless of the provisioning strategy being performed and schedule the instance(s) for - creation.""" + creation. + """ # Normalize and setup some parameters if reservation_id is None: @@ -2622,7 +2624,8 @@ class HostAPI(base.Base): def set_host_maintenance(self, context, host_name, mode): """Start/Stop host maintenance window. On start, it triggers - guest VMs evacuation.""" + guest VMs evacuation. + """ host_name = self._assert_host_exists(context, host_name) return self.rpcapi.host_maintenance_mode(context, host_param=host_name, mode=mode, host=host_name) @@ -2656,10 +2659,11 @@ class HostAPI(base.Base): return self.db.service_get_by_compute_host(context, host_name) def service_update(self, context, host_name, binary, params_to_update): - """ - Enable / Disable a service. + """Enable / Disable a service. + For compute services, this stops new builds and migrations going to - the host.""" + the host. + """ service = db.service_get_by_args(context, host_name, binary) return db.service_update(context, service['id'], params_to_update) diff --git a/nova/compute/flavors.py b/nova/compute/flavors.py index b58f1f05d..59d5d5715 100644 --- a/nova/compute/flavors.py +++ b/nova/compute/flavors.py @@ -235,7 +235,8 @@ def remove_flavor_access(flavorid, projectid, ctxt=None): def extract_flavor(instance, prefix=''): """Create an InstanceType-like object from instance's system_metadata - information.""" + information. + """ instance_type = {} sys_meta = utils.instance_sys_meta(instance) @@ -253,7 +254,8 @@ def save_flavor_info(metadata, instance_type, prefix=''): This can be used to update system_metadata in place from a type, as well as stash information about another instance_type for later use (such as - during resize).""" + during resize). + """ for key in system_metadata_flavor_props.keys(): to_key = '%sinstance_type_%s' % (prefix, key) @@ -263,7 +265,8 @@ def save_flavor_info(metadata, instance_type, prefix=''): def delete_flavor_info(metadata, *prefixes): """Delete flavor instance_type information from instance's system_metadata - by prefix.""" + by prefix. + """ for key in system_metadata_flavor_props.keys(): for prefix in prefixes: diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 3b58cdd3c..c84afa25b 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2769,7 +2769,8 @@ class ComputeManager(manager.SchedulerDependentManager): @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) def host_maintenance_mode(self, context, host, mode): """Start/Stop host maintenance window. On start, it triggers - guest VMs evacuation.""" + guest VMs evacuation. + """ return self.driver.host_maintenance_mode(host, mode) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @@ -2967,7 +2968,8 @@ class ComputeManager(manager.SchedulerDependentManager): def _attach_volume_boot(self, context, instance, volume, mountpoint): """Attach a volume to an instance at boot time. So actual attach - is done by instance creation""" + is done by instance creation. + """ instance_id = instance['id'] instance_uuid = instance['uuid'] @@ -3923,7 +3925,8 @@ class ComputeManager(manager.SchedulerDependentManager): """Align instance power state between the database and hypervisor. If the instance is not found on the hypervisor, but is in the database, - then a stop() API will be called on the instance.""" + then a stop() API will be called on the instance. + """ # We re-query the DB to get the latest instance info to minimize # (not eliminate) race condition. -- cgit