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
This commit is contained in:
Peter Razumovsky 2016-02-18 15:41:04 +03:00
parent e4dc942ce1
commit 753f4c65e2
7 changed files with 10 additions and 10 deletions

View File

@ -100,7 +100,7 @@ class Restarter(signal_responder.SignalResponder):
def _resolve_attribute(self, name): def _resolve_attribute(self, name):
"""Resolves the resource's attributes. """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. when there is an alarm.
""" """
if name == self.ALARM_URL and self.resource_id is not None: if name == self.ALARM_URL and self.resource_id is not None:

View File

@ -373,7 +373,7 @@ class InstanceGroup(stack_resource.StackResource):
def _resolve_attribute(self, name): def _resolve_attribute(self, name):
"""Resolves the resource's attributes. """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. ip addresses.
""" """
if name == self.INSTANCE_LIST: if name == self.INSTANCE_LIST:

View File

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

View File

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

View File

@ -470,12 +470,12 @@ class Port(neutron.NeutronResource):
return super(Port, self)._resolve_attribute(name) return super(Port, self)._resolve_attribute(name)
def needs_replace(self, after_props): 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' return after_props.get(self.REPLACEMENT_POLICY) == 'REPLACE_ALWAYS'
def needs_replace_with_prop_diff(self, changed_properties_set, def needs_replace_with_prop_diff(self, changed_properties_set,
after_props, before_props): 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 # Switching between name and ID is OK, provided the value resolves
# to the same network. If the network changes, port is replaced. # to the same network. If the network changes, port is replaced.
if self.NETWORK in changed_properties_set: if self.NETWORK in changed_properties_set:

View File

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

View File

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