summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py16
-rw-r--r--nova/compute/flavors.py9
-rwxr-xr-xnova/compute/manager.py9
3 files changed, 22 insertions, 12 deletions
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 d5ccb8356..2ae435f9a 100755
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -2776,7 +2776,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())
@@ -2974,7 +2975,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']
@@ -3941,7 +3943,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.