Fix [H405] pep rule in heat/scaling
Implements bp docstring-improvements Change-Id: If1b98962ce20f28cefd01ccf7d6f88f7e908d0db
This commit is contained in:
parent
54116830fc
commit
a2ec480f3c
@ -16,11 +16,12 @@ import six
|
||||
|
||||
|
||||
class CooldownMixin(object):
|
||||
'''
|
||||
Utility class to encapsulate Cooldown related logic which is shared
|
||||
between AutoScalingGroup and ScalingPolicy. This logic includes both
|
||||
cooldown timestamp comparing and scaling in progress checking.
|
||||
'''
|
||||
"""Utility class to encapsulate Cooldown related logic.
|
||||
|
||||
This class is shared between AutoScalingGroup and ScalingPolicy.
|
||||
This logic includes both cooldown timestamp comparing and scaling in
|
||||
progress checking.
|
||||
"""
|
||||
def _cooldown_inprogress(self):
|
||||
inprogress = False
|
||||
try:
|
||||
|
@ -23,12 +23,11 @@ from heat.engine import scheduler
|
||||
|
||||
|
||||
def reload_loadbalancers(group, load_balancers, exclude=None):
|
||||
'''
|
||||
Notify the LoadBalancer to reload its config.
|
||||
"""Notify the LoadBalancer to reload its config.
|
||||
|
||||
This must be done after activation (instance in ACTIVE state), otherwise
|
||||
the instances' IP addresses may not be available.
|
||||
'''
|
||||
"""
|
||||
exclude = exclude or []
|
||||
id_list = grouputils.get_member_refids(group, exclude=exclude)
|
||||
for name, lb in six.iteritems(load_balancers):
|
||||
|
@ -12,8 +12,7 @@
|
||||
|
||||
|
||||
def needs_update(targ_capacity, curr_capacity, num_up_to_date):
|
||||
"""
|
||||
Return whether there are more batch updates to do.
|
||||
"""Return whether there are more batch updates to do.
|
||||
|
||||
Inputs are the target size for the group, the current size of the group,
|
||||
and the number of members that already have the latest definition.
|
||||
@ -23,8 +22,7 @@ def needs_update(targ_capacity, curr_capacity, num_up_to_date):
|
||||
|
||||
def next_batch(targ_capacity, curr_capacity, num_up_to_date, batch_size,
|
||||
min_in_service):
|
||||
"""
|
||||
Return details of the next batch in a batched update.
|
||||
"""Return details of the next batch in a batched update.
|
||||
|
||||
The result is a tuple containing the new size of the group and the number
|
||||
of members that may receive the new definition (by a combination of
|
||||
@ -35,7 +33,6 @@ def next_batch(targ_capacity, curr_capacity, num_up_to_date, batch_size,
|
||||
size, and the minimum number of members to keep in service during a rolling
|
||||
update.
|
||||
"""
|
||||
|
||||
assert num_up_to_date <= curr_capacity
|
||||
|
||||
efft_min_sz = min(min_in_service, targ_capacity, curr_capacity)
|
||||
|
@ -24,7 +24,8 @@ CFN_ADJUSTMENT_TYPES = (
|
||||
|
||||
def calculate_new_capacity(current, adjustment, adjustment_type,
|
||||
min_adjustment_step, minimum, maximum):
|
||||
"""
|
||||
"""Calculates new capacity from the given adjustments.
|
||||
|
||||
Given the current capacity, calculates the new capacity which results
|
||||
from applying the given adjustment of the given adjustment-type. The
|
||||
new capacity will be kept within the maximum and minimum bounds.
|
||||
|
@ -21,8 +21,7 @@ def _identity(resource_name, definition):
|
||||
def member_definitions(old_resources, new_definition,
|
||||
num_resources, num_new,
|
||||
get_new_id, customise=_identity):
|
||||
"""
|
||||
Iterate over resource definitions for a scaling group
|
||||
"""Iterate over resource definitions for a scaling group
|
||||
|
||||
Generates the definitions for the next change to the scaling group. Each
|
||||
item is a (name, definition) tuple.
|
||||
@ -60,8 +59,7 @@ def member_definitions(old_resources, new_definition,
|
||||
def make_template(resource_definitions,
|
||||
version=('heat_template_version', '2015-04-30'),
|
||||
child_env=None):
|
||||
"""
|
||||
Return a Template object containing the given resource definitions.
|
||||
"""Return a Template object containing the given resource definitions.
|
||||
|
||||
By default, the template will be in the HOT format. A different format
|
||||
can be specified by passing a (version_type, version_string) tuple matching
|
||||
|
Loading…
x
Reference in New Issue
Block a user