fix N402 for nova/scheduler
fixes N402 (single line docstrings should end in period) for nova/scheduler files. Change-Id: I8e7b6a93df53fcd5c9491f533cadd093f4b802e0
This commit is contained in:
parent
22498d2ac0
commit
f6fedfc505
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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'])
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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."""
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue