Fix all method errors for custom guidelines

There are several method error raised during custom
guidelines check. Need to fix it for successful running
pep8.

implements bp custom-guidelines

Change-Id: I55883bb8d314f982161aaa21c010e9d1467bf903
changes/19/281819/4
Peter Razumovsky 7 years ago
parent e4dc942ce1
commit 753f4c65e2
  1. 2
      heat/engine/resources/openstack/heat/ha_restarter.py
  2. 2
      heat/engine/resources/openstack/heat/instance_group.py
  3. 2
      heat/engine/resources/openstack/heat/resource_chain.py
  4. 6
      heat/engine/resources/openstack/heat/resource_group.py
  5. 4
      heat/engine/resources/openstack/neutron/port.py
  6. 2
      heat/engine/resources/openstack/nova/server.py
  7. 2
      tools/custom_guidelines.py

@ -100,7 +100,7 @@ class Restarter(signal_responder.SignalResponder):
def _resolve_attribute(self, name):
"""Resolves the resource's attributes.
heat extension: "AlarmUrl" returns the url to post to the policy
Heat extension: "AlarmUrl" returns the url to post to the policy
when there is an alarm.
"""
if name == self.ALARM_URL and self.resource_id is not None:

@ -373,7 +373,7 @@ class InstanceGroup(stack_resource.StackResource):
def _resolve_attribute(self, name):
"""Resolves the resource's attributes.
heat extension: "InstanceList" returns comma delimited list of server
Heat extension: "InstanceList" returns comma delimited list of server
ip addresses.
"""
if name == self.INSTANCE_LIST:

@ -177,7 +177,7 @@ class ResourceChain(stack_resource.StackResource):
:type resource_type: str
:param depends_on: if specified, the new resource will depend on the
resource name specified
:type depends_on: str
:type depends_on: str
:return: resource definition suitable for adding to a template
:rtype: heat.engine.rsrc_defn.ResourceDefinition
"""

@ -334,7 +334,7 @@ class ResourceGroup(stack_resource.StackResource):
size)
def _count_black_listed(self):
"""Return the number of current resource names that are blacklisted"""
"""Return the number of current resource names that are blacklisted."""
existing_members = grouputils.get_member_names(self)
return len(self._name_blacklist() & set(existing_members))
@ -442,9 +442,9 @@ class ResourceGroup(stack_resource.StackResource):
:param include_all: if False, only properties for the resource
definition that are not empty will be included
:type include_all: bool
:type include_all: bool
:return: resource definition for the group
:rtype: dict
:rtype: dict
"""
# At this stage, we don't mind if all of the parameters have values

@ -470,12 +470,12 @@ class Port(neutron.NeutronResource):
return super(Port, self)._resolve_attribute(name)
def needs_replace(self, after_props):
"""Mandatory replace based on props """
"""Mandatory replace based on props."""
return after_props.get(self.REPLACEMENT_POLICY) == 'REPLACE_ALWAYS'
def needs_replace_with_prop_diff(self, changed_properties_set,
after_props, before_props):
"""Needs replace based on prop_diff """
"""Needs replace based on prop_diff."""
# Switching between name and ID is OK, provided the value resolves
# to the same network. If the network changes, port is replaced.
if self.NETWORK in changed_properties_set:

@ -1062,7 +1062,7 @@ class Server(stack_user.StackUser, sh.SchedulerHintsMixin,
def needs_replace_with_prop_diff(self, changed_properties_set,
after_props, before_props):
"""Needs replace based on prop_diff """
"""Needs replace based on prop_diff."""
if self.FLAVOR in changed_properties_set:
flavor_update_policy = (
after_props.get(self.FLAVOR_UPDATE_POLICY) or

@ -61,7 +61,7 @@ class HeatCustomGuidelines(object):
self._check_resource_schemas(cls, cls.attributes_schema,
'attribute')
# check methods descriptions
#self._check_resource_methods(cls)
self._check_resource_methods(cls)
def _check_resource_description(self, resource):
description = resource.__doc__

Loading…
Cancel
Save