diff --git a/nova/scheduler/chance.py b/nova/scheduler/chance.py index bc5725acd4ab..ff7c38cb1c5c 100644 --- a/nova/scheduler/chance.py +++ b/nova/scheduler/chance.py @@ -61,7 +61,7 @@ class ChanceScheduler(driver.Scheduler): admin_password, injected_files, requested_networks, is_first_time, filter_properties): - """Create and run an instance or instances""" + """Create and run an instance or instances.""" instance_uuids = request_spec.get('instance_uuids') for num, instance_uuid in enumerate(instance_uuids): request_spec['instance_properties']['launch_index'] = num diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py index c63b5643b862..2873c96ef2ac 100644 --- a/nova/scheduler/driver.py +++ b/nova/scheduler/driver.py @@ -95,7 +95,7 @@ def instance_update_db(context, instance_uuid): def encode_instance(instance, local=True): - """Encode locally created instance for return via RPC""" + """Encode locally created instance for return via RPC.""" # TODO(comstud): I would love to be able to return the full # instance information here, but we'll need some modifications # to the RPC code to handle datetime conversions with the diff --git a/nova/scheduler/filters/compute_filter.py b/nova/scheduler/filters/compute_filter.py index e35f68ab5d8f..2cdfb91f4003 100644 --- a/nova/scheduler/filters/compute_filter.py +++ b/nova/scheduler/filters/compute_filter.py @@ -24,13 +24,13 @@ LOG = logging.getLogger(__name__) class ComputeFilter(filters.BaseHostFilter): - """Filter on active Compute nodes""" + """Filter on active Compute nodes.""" def __init__(self): self.servicegroup_api = servicegroup.API() def host_passes(self, host_state, filter_properties): - """Returns True for only active compute nodes""" + """Returns True for only active compute nodes.""" capabilities = host_state.capabilities service = host_state.service diff --git a/nova/scheduler/filters/disk_filter.py b/nova/scheduler/filters/disk_filter.py index 49fcb4720344..e7a292c45ff0 100644 --- a/nova/scheduler/filters/disk_filter.py +++ b/nova/scheduler/filters/disk_filter.py @@ -27,10 +27,10 @@ CONF.register_opt(disk_allocation_ratio_opt) class DiskFilter(filters.BaseHostFilter): - """Disk Filter with over subscription flag""" + """Disk Filter with over subscription flag.""" def host_passes(self, host_state, filter_properties): - """Filter based on disk usage""" + """Filter based on disk usage.""" instance_type = filter_properties.get('instance_type') requested_disk = 1024 * (instance_type['root_gb'] + instance_type['ephemeral_gb']) diff --git a/nova/scheduler/filters/io_ops_filter.py b/nova/scheduler/filters/io_ops_filter.py index 4429f20fa1ff..2780ff25258f 100644 --- a/nova/scheduler/filters/io_ops_filter.py +++ b/nova/scheduler/filters/io_ops_filter.py @@ -28,7 +28,7 @@ CONF.register_opt(max_io_ops_per_host_opt) class IoOpsFilter(filters.BaseHostFilter): - """Filter out hosts with too many concurrent I/O operations""" + """Filter out hosts with too many concurrent I/O operations.""" def host_passes(self, host_state, filter_properties): """Use information about current vm and task states collected from diff --git a/nova/scheduler/filters/json_filter.py b/nova/scheduler/filters/json_filter.py index cfb2698db360..2d070ea8edaa 100644 --- a/nova/scheduler/filters/json_filter.py +++ b/nova/scheduler/filters/json_filter.py @@ -51,7 +51,7 @@ class JsonFilter(filters.BaseHostFilter): return self._op_compare(args, operator.gt) def _in(self, args): - """First term is in set of remaining terms""" + """First term is in set of remaining terms.""" return self._op_compare(args, operator.contains) def _less_than_equal(self, args): diff --git a/nova/scheduler/filters/num_instances_filter.py b/nova/scheduler/filters/num_instances_filter.py index 197959a5f415..bdc350f95a30 100644 --- a/nova/scheduler/filters/num_instances_filter.py +++ b/nova/scheduler/filters/num_instances_filter.py @@ -28,7 +28,7 @@ CONF.register_opt(max_instances_per_host_opt) class NumInstancesFilter(filters.BaseHostFilter): - """Filter out hosts with too many instances""" + """Filter out hosts with too many instances.""" def host_passes(self, host_state, filter_properties): num_instances = host_state.num_instances diff --git a/nova/scheduler/filters/ram_filter.py b/nova/scheduler/filters/ram_filter.py index dc43ced29d1d..f9d6bb750b13 100644 --- a/nova/scheduler/filters/ram_filter.py +++ b/nova/scheduler/filters/ram_filter.py @@ -29,7 +29,7 @@ CONF.register_opt(ram_allocation_ratio_opt) class RamFilter(filters.BaseHostFilter): - """Ram Filter with over subscription flag""" + """Ram Filter with over subscription flag.""" def host_passes(self, host_state, filter_properties): """Only return hosts with sufficient available RAM.""" diff --git a/nova/scheduler/filters/retry_filter.py b/nova/scheduler/filters/retry_filter.py index 91d2cb2a2332..4d6ed50ee5de 100644 --- a/nova/scheduler/filters/retry_filter.py +++ b/nova/scheduler/filters/retry_filter.py @@ -25,7 +25,7 @@ class RetryFilter(filters.BaseHostFilter): """ def host_passes(self, host_state, filter_properties): - """Skip nodes that have already been attempted""" + """Skip nodes that have already been attempted.""" retry = filter_properties.get('retry', None) if not retry: # Re-scheduling is disabled diff --git a/nova/scheduler/host_manager.py b/nova/scheduler/host_manager.py index d5b8aeb52eab..b472220bdb92 100644 --- a/nova/scheduler/host_manager.py +++ b/nova/scheduler/host_manager.py @@ -196,7 +196,7 @@ class HostState(object): self.num_io_ops = int(statmap.get('io_workload', 0)) def consume_from_instance(self, instance): - """Incrementally update host state from an instance""" + """Incrementally update host state from an instance.""" disk_mb = (instance['root_gb'] + instance['ephemeral_gb']) * 1024 ram_mb = instance['memory_mb'] vcpus = instance['vcpus'] @@ -294,7 +294,7 @@ class HostManager(object): def get_filtered_hosts(self, hosts, filter_properties, filter_class_names=None): - """Filter hosts and return only ones passing all filters""" + """Filter hosts and return only ones passing all filters.""" def _strip_ignore_hosts(host_map, hosts_to_ignore): ignored_hosts = [] @@ -338,7 +338,7 @@ class HostManager(object): hosts, filter_properties) def get_weighed_hosts(self, hosts, weight_properties): - """Weigh the hosts""" + """Weigh the hosts.""" return self.weight_handler.get_weighed_objects(self.weight_classes, hosts, weight_properties) diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py index f3eb6e2e83dc..033ee9cc8a24 100644 --- a/nova/scheduler/manager.py +++ b/nova/scheduler/manager.py @@ -155,7 +155,7 @@ class SchedulerManager(manager.Manager): def _set_vm_state_and_notify(self, method, updates, context, ex, request_spec): - """changes VM state and notifies""" + """changes VM state and notifies.""" # FIXME(comstud): Re-factor this somehow. Not sure this belongs in the # scheduler manager like this. We should make this easier. # run_instance only sends a request_spec, and an instance may or may diff --git a/nova/scheduler/weights/least_cost.py b/nova/scheduler/weights/least_cost.py index f6702bc1bcdf..26b9e7a8c7f3 100644 --- a/nova/scheduler/weights/least_cost.py +++ b/nova/scheduler/weights/least_cost.py @@ -52,7 +52,7 @@ CONF.register_opts(least_cost_opts) def noop_cost_fn(host_state, weight_properties): - """Return a pre-weight cost of 1 for each host""" + """Return a pre-weight cost of 1 for each host.""" return 1