summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/cells/state.py2
-rw-r--r--nova/compute/api.py10
-rw-r--r--nova/compute/cells_api.py2
-rw-r--r--nova/compute/claims.py2
-rw-r--r--nova/compute/instance_types.py6
-rw-r--r--nova/compute/manager.py28
-rw-r--r--nova/compute/resource_tracker.py14
-rw-r--r--nova/compute/stats.py4
-rw-r--r--nova/conductor/api.py8
-rw-r--r--nova/conductor/manager.py4
-rw-r--r--nova/conductor/rpcapi.py2
11 files changed, 41 insertions, 41 deletions
diff --git a/nova/cells/state.py b/nova/cells/state.py
index c6f8f3220..fa89e2f54 100644
--- a/nova/cells/state.py
+++ b/nova/cells/state.py
@@ -59,7 +59,7 @@ class CellState(object):
self.driver = rpc_driver.CellsRPCDriver()
def update_db_info(self, cell_db_info):
- """Update cell credentials from db"""
+ """Update cell credentials from db."""
self.db_info = dict(
[(k, v) for k, v in cell_db_info.iteritems()
if k != 'name'])
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 176b61995..5e191556d 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -139,7 +139,7 @@ def check_instance_lock(function):
def policy_decorator(scope):
- """Check corresponding policy prior of wrapped method to execution"""
+ """Check corresponding policy prior of wrapped method to execution."""
def outer(func):
@functools.wraps(func)
def wrapped(self, context, target, *args, **kwargs):
@@ -842,7 +842,7 @@ class API(base.Base):
scheduler_hints=scheduler_hints)
def trigger_provider_fw_rules_refresh(self, context):
- """Called when a rule is added/removed from a provider firewall"""
+ """Called when a rule is added/removed from a provider firewall."""
hosts = [x['host'] for (x, idx)
in self.db.service_get_all_compute_sorted(context)]
@@ -1866,7 +1866,7 @@ class API(base.Base):
return self.compute_rpcapi.get_diagnostics(context, instance=instance)
def get_backdoor_port(self, context, host):
- """Retrieve backdoor port"""
+ """Retrieve backdoor port."""
return self.compute_rpcapi.get_backdoor_port(context, host)
@wrap_check_policy
@@ -2539,7 +2539,7 @@ class SecurityGroupAPI(base.Base):
@wrap_check_security_groups_policy
def add_to_instance(self, context, instance, security_group_name):
- """Add security group to the instance"""
+ """Add security group to the instance."""
security_group = self.db.security_group_get_by_name(context,
context.project_id,
security_group_name)
@@ -2569,7 +2569,7 @@ class SecurityGroupAPI(base.Base):
@wrap_check_security_groups_policy
def remove_from_instance(self, context, instance, security_group_name):
- """Remove the security group associated with the instance"""
+ """Remove the security group associated with the instance."""
security_group = self.db.security_group_get_by_name(context,
context.project_id,
security_group_name)
diff --git a/nova/compute/cells_api.py b/nova/compute/cells_api.py
index cdbccebb1..698c6eed0 100644
--- a/nova/compute/cells_api.py
+++ b/nova/compute/cells_api.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""Compute API that proxies via Cells Service"""
+"""Compute API that proxies via Cells Service."""
from nova import block_device
from nova.cells import rpcapi as cells_rpcapi
diff --git a/nova/compute/claims.py b/nova/compute/claims.py
index c4828b823..fc534fd23 100644
--- a/nova/compute/claims.py
+++ b/nova/compute/claims.py
@@ -26,7 +26,7 @@ COMPUTE_RESOURCE_SEMAPHORE = "compute_resources"
class NopClaim(object):
- """For use with compute drivers that do not support resource tracking"""
+ """For use with compute drivers that do not support resource tracking."""
def __init__(self, migration=None):
self.migration = migration
diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py
index a0819416c..78129ee6b 100644
--- a/nova/compute/instance_types.py
+++ b/nova/compute/instance_types.py
@@ -189,7 +189,7 @@ def get_instance_type_by_flavor_id(flavorid, ctxt=None, read_deleted="yes"):
def get_instance_type_access_by_flavor_id(flavorid, ctxt=None):
- """Retrieve instance type access list by flavor id"""
+ """Retrieve instance type access list by flavor id."""
if ctxt is None:
ctxt = context.get_admin_context()
@@ -197,7 +197,7 @@ def get_instance_type_access_by_flavor_id(flavorid, ctxt=None):
def add_instance_type_access(flavorid, projectid, ctxt=None):
- """Add instance type access for project"""
+ """Add instance type access for project."""
if ctxt is None:
ctxt = context.get_admin_context()
@@ -205,7 +205,7 @@ def add_instance_type_access(flavorid, projectid, ctxt=None):
def remove_instance_type_access(flavorid, projectid, ctxt=None):
- """Remove instance type access for project"""
+ """Remove instance type access for project."""
if ctxt is None:
ctxt = context.get_admin_context()
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 682af2ce5..7c6ed8cdb 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -190,7 +190,7 @@ def publisher_id(host=None):
def reverts_task_state(function):
- """Decorator to revert task_state on failure"""
+ """Decorator to revert task_state on failure."""
@functools.wraps(function)
def decorated_function(self, context, *args, **kwargs):
@@ -542,7 +542,7 @@ class ComputeManager(manager.SchedulerDependentManager):
return power_state.NOSTATE
def get_backdoor_port(self, context):
- """Return backdoor port for eventlet_backdoor"""
+ """Return backdoor port for eventlet_backdoor."""
return self.backdoor_port
def get_console_topic(self, context):
@@ -600,13 +600,13 @@ class ComputeManager(manager.SchedulerDependentManager):
return network_info
def _legacy_nw_info(self, network_info):
- """Converts the model nw_info object to legacy style"""
+ """Converts the model nw_info object to legacy style."""
if self.driver.legacy_nwinfo():
network_info = network_info.legacy()
return network_info
def _setup_block_device_mapping(self, context, instance, bdms):
- """setup volumes for block device mapping"""
+ """setup volumes for block device mapping."""
block_device_mapping = []
swap = None
ephemerals = []
@@ -933,7 +933,7 @@ class ComputeManager(manager.SchedulerDependentManager):
None))
def _allocate_network(self, context, instance, requested_networks):
- """Allocate networks for an instance and return the network info"""
+ """Allocate networks for an instance and return the network info."""
self._instance_update(context, instance['uuid'],
vm_state=vm_states.BUILDING,
task_state=task_states.NETWORKING,
@@ -955,7 +955,7 @@ class ComputeManager(manager.SchedulerDependentManager):
return network_info
def _prep_block_device(self, context, instance, bdms):
- """Set up the block device for an instance with error logging"""
+ """Set up the block device for an instance with error logging."""
self._instance_update(context, instance['uuid'],
vm_state=vm_states.BUILDING,
task_state=task_states.BLOCK_DEVICE_MAPPING)
@@ -968,7 +968,7 @@ class ComputeManager(manager.SchedulerDependentManager):
def _spawn(self, context, instance, image_meta, network_info,
block_device_info, injected_files, admin_password):
- """Spawn an instance with error logging and update its power state"""
+ """Spawn an instance with error logging and update its power state."""
self._instance_update(context, instance['uuid'],
vm_state=vm_states.BUILDING,
task_state=task_states.SPAWNING,
@@ -1008,7 +1008,7 @@ class ComputeManager(manager.SchedulerDependentManager):
self.network_api.deallocate_for_instance(context, instance)
def _get_volume_bdms(self, bdms):
- """Return only bdms that have a volume_id"""
+ """Return only bdms that have a volume_id."""
return [bdm for bdm in bdms if bdm['volume_id']]
# NOTE(danms): Legacy interface for digging up volumes in the database
@@ -1164,7 +1164,7 @@ class ComputeManager(manager.SchedulerDependentManager):
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@wrap_instance_fault
def terminate_instance(self, context, instance, bdms=None):
- """Terminate an instance on this host. """
+ """Terminate an instance on this host."""
# Note(eglynn): we do not decorate this action with reverts_task_state
# because a failure during termination should leave the task state as
# DELETING, as a signal to the API layer that a subsequent deletion
@@ -1707,7 +1707,7 @@ class ComputeManager(manager.SchedulerDependentManager):
self.driver.inject_file(instance, path, file_contents)
def _get_rescue_image_ref(self, context, instance):
- """Determine what image should be used to boot the rescue VM. """
+ """Determine what image should be used to boot the rescue VM."""
system_meta = compute_utils.metadata_to_dict(
instance['system_metadata'])
@@ -2611,7 +2611,7 @@ class ComputeManager(manager.SchedulerDependentManager):
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
def remove_volume_connection(self, context, volume_id, instance):
- """Remove a volume connection using the volume api"""
+ """Remove a volume connection using the volume api."""
# NOTE(vish): We don't want to actually mark the volume
# detached, or delete the bdm, just remove the
# connection from this host.
@@ -3208,7 +3208,7 @@ class ComputeManager(manager.SchedulerDependentManager):
last_refreshed=refreshed)
def _get_host_volume_bdms(self, context, host):
- """Return all block device mappings on a compute host"""
+ """Return all block device mappings on a compute host."""
compute_host_bdms = []
instances = self.conductor_api.instance_get_all_by_host(context,
self.host)
@@ -3220,7 +3220,7 @@ class ComputeManager(manager.SchedulerDependentManager):
return compute_host_bdms
def _update_volume_usage_cache(self, context, vol_usages, refreshed):
- """Updates the volume usage cache table with a list of stats"""
+ """Updates the volume usage cache table with a list of stats."""
for usage in vol_usages:
# Allow switching of greenthreads between queries.
greenthread.sleep(0)
@@ -3233,7 +3233,7 @@ class ComputeManager(manager.SchedulerDependentManager):
last_refreshed=refreshed)
def _send_volume_usage_notifications(self, context, start_time):
- """Queries vol usage cache table and sends a vol usage notification"""
+ """Queries vol usage cache table and sends a vol usage notification."""
# We might have had a quick attach/detach that we missed in
# the last run of get_all_volume_usage and this one
# but detach stats will be recorded in db and returned from
diff --git a/nova/compute/resource_tracker.py b/nova/compute/resource_tracker.py
index ba1915f42..256b64979 100644
--- a/nova/compute/resource_tracker.py
+++ b/nova/compute/resource_tracker.py
@@ -191,7 +191,7 @@ class ResourceTracker(object):
instance_ref['node'] = self.nodename
def abort_instance_claim(self, instance):
- """Remove usage from the given instance"""
+ """Remove usage from the given instance."""
# flag the instance as deleted to revert the resource usage
# and associated stats:
instance['vm_state'] = vm_states.DELETED
@@ -201,7 +201,7 @@ class ResourceTracker(object):
self._update(ctxt, self.compute_node)
def abort_resize_claim(self, instance_uuid, instance_type):
- """Remove usage for an incoming migration"""
+ """Remove usage for an incoming migration."""
if instance_uuid in self.tracked_migrations:
migration, itype = self.tracked_migrations.pop(instance_uuid)
@@ -277,7 +277,7 @@ class ResourceTracker(object):
self._sync_compute_node(context, resources)
def _sync_compute_node(self, context, resources):
- """Create or update the compute node DB record"""
+ """Create or update the compute node DB record."""
if not self.compute_node:
# we need a copy of the ComputeNode record:
service = self._get_service(context)
@@ -304,7 +304,7 @@ class ResourceTracker(object):
LOG.info(_('Compute_service record updated for %s ') % self.host)
def _create(self, context, values):
- """Create the compute node in the DB"""
+ """Create the compute node in the DB."""
# initialize load stats from existing instances:
compute_node = db.compute_node_create(context, values)
self.compute_node = dict(compute_node)
@@ -350,20 +350,20 @@ class ResourceTracker(object):
LOG.audit(_("Free VCPU information unavailable"))
def _update(self, context, values, prune_stats=False):
- """Persist the compute node updates to the DB"""
+ """Persist the compute node updates to the DB."""
compute_node = db.compute_node_update(context,
self.compute_node['id'], values, prune_stats)
self.compute_node = dict(compute_node)
def confirm_resize(self, context, migration, status='confirmed'):
- """Cleanup usage for a confirmed resize"""
+ """Cleanup usage for a confirmed resize."""
elevated = context.elevated()
db.migration_update(elevated, migration['id'],
{'status': status})
self.update_available_resource(elevated)
def revert_resize(self, context, migration, status='reverted'):
- """Cleanup usage for a reverted resize"""
+ """Cleanup usage for a reverted resize."""
self.confirm_resize(context, migration, status)
def _update_usage(self, resources, usage, sign=1):
diff --git a/nova/compute/stats.py b/nova/compute/stats.py
index 44b92c6de..b6a30d38f 100644
--- a/nova/compute/stats.py
+++ b/nova/compute/stats.py
@@ -33,7 +33,7 @@ class Stats(dict):
@property
def io_workload(self):
- """Calculate an I/O based load by counting I/O heavy operations"""
+ """Calculate an I/O based load by counting I/O heavy operations."""
def _get(state, state_type):
key = "num_%s_%s" % (state_type, state)
@@ -127,7 +127,7 @@ class Stats(dict):
self[key] = x + 1
def _extract_state_from_instance(self, instance):
- """Save the useful bits of instance state for tracking purposes"""
+ """Save the useful bits of instance state for tracking purposes."""
uuid = instance['uuid']
vm_state = instance['vm_state']
diff --git a/nova/conductor/api.py b/nova/conductor/api.py
index 87e75f274..4a72f81e0 100644
--- a/nova/conductor/api.py
+++ b/nova/conductor/api.py
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""Handles all requests to the conductor service"""
+"""Handles all requests to the conductor service."""
import functools
@@ -72,7 +72,7 @@ class LocalAPI(object):
return self._manager.ping(context, arg)
def instance_update(self, context, instance_uuid, **updates):
- """Perform an instance update in the database"""
+ """Perform an instance update in the database."""
return self._manager.instance_update(context, instance_uuid, updates)
def instance_get(self, context, instance_id):
@@ -245,7 +245,7 @@ class LocalAPI(object):
class API(object):
- """Conductor API that does updates via RPC to the ConductorManager"""
+ """Conductor API that does updates via RPC to the ConductorManager."""
def __init__(self):
self.conductor_rpcapi = rpcapi.ConductorAPI()
@@ -254,7 +254,7 @@ class API(object):
return self.conductor_rpcapi.ping(context, arg, timeout)
def instance_update(self, context, instance_uuid, **updates):
- """Perform an instance update in the database"""
+ """Perform an instance update in the database."""
return self.conductor_rpcapi.instance_update(context, instance_uuid,
updates)
diff --git a/nova/conductor/manager.py b/nova/conductor/manager.py
index 96443c834..3c26f320e 100644
--- a/nova/conductor/manager.py
+++ b/nova/conductor/manager.py
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""Handles database requests from other nova services"""
+"""Handles database requests from other nova services."""
from nova import exception
from nova import manager
@@ -41,7 +41,7 @@ datetime_fields = ['launched_at', 'terminated_at']
class ConductorManager(manager.SchedulerDependentManager):
- """Mission: TBD"""
+ """Mission: TBD."""
RPC_API_VERSION = '1.25'
diff --git a/nova/conductor/rpcapi.py b/nova/conductor/rpcapi.py
index f11208e2f..6b91de167 100644
--- a/nova/conductor/rpcapi.py
+++ b/nova/conductor/rpcapi.py
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""Client side of the conductor RPC API"""
+"""Client side of the conductor RPC API."""
from nova.openstack.common import cfg
from nova.openstack.common import jsonutils