From e4dc942ce1a8c79b450345c7afae326c80d8a5d6 Mon Sep 17 00:00:00 2001 From: Peter Razumovsky Date: Thu, 18 Feb 2016 15:33:45 +0300 Subject: [PATCH] Fix resources descriptions for custom guidelines There're several errors, raised by custom guidelines check, need to fix it for successful pep8 running. implements bp custom-guidelines Change-Id: Ibef41cad9b20715a740cedac7b98e9647bd3d6b7 --- heat/engine/resources/openstack/cinder/volume.py | 5 +++++ heat/engine/resources/openstack/heat/resource_group.py | 2 +- .../resources/openstack/heat/structured_config.py | 5 +++++ .../resources/openstack/keystone/role_assignments.py | 10 ++++++++-- heat/engine/resources/openstack/neutron/extraroute.py | 4 ++++ heat/engine/resources/openstack/neutron/floatingip.py | 2 +- heat/engine/resources/openstack/nova/floatingip.py | 7 +++++-- tools/custom_guidelines.py | 2 +- 8 files changed, 30 insertions(+), 7 deletions(-) diff --git a/heat/engine/resources/openstack/cinder/volume.py b/heat/engine/resources/openstack/cinder/volume.py index d88debcc92..9cdd57fd98 100644 --- a/heat/engine/resources/openstack/cinder/volume.py +++ b/heat/engine/resources/openstack/cinder/volume.py @@ -643,6 +643,11 @@ class CinderVolume(vb.BaseVolume, sh.SchedulerHintsMixin): class CinderVolumeAttachment(vb.BaseVolumeAttachment): + """Resource for associating volume to instance. + + Resource for associating existing volume to instance. Also, the location + where the volume is exposed on the instance can be specified. + """ PROPERTIES = ( INSTANCE_ID, VOLUME_ID, DEVICE, diff --git a/heat/engine/resources/openstack/heat/resource_group.py b/heat/engine/resources/openstack/heat/resource_group.py index 61fbbf9fd5..bbb2819cbe 100644 --- a/heat/engine/resources/openstack/heat/resource_group.py +++ b/heat/engine/resources/openstack/heat/resource_group.py @@ -38,7 +38,7 @@ class ResourceGroup(stack_resource.StackResource): """Creates one or more identically configured nested resources. In addition to the `refs` attribute, this resource implements synthetic - attributes that mirror those of the resources in the group. When + attributes that mirror those of the resources in the group. When getting an attribute from this resource, however, a list of attribute values for each resource in the group is returned. To get attribute values for a single resource in the group, synthetic attributes of the form diff --git a/heat/engine/resources/openstack/heat/structured_config.py b/heat/engine/resources/openstack/heat/structured_config.py index cce08d7986..fe386a49dd 100644 --- a/heat/engine/resources/openstack/heat/structured_config.py +++ b/heat/engine/resources/openstack/heat/structured_config.py @@ -184,6 +184,11 @@ class StructuredDeployment(sd.SoftwareDeployment): class StructuredDeploymentGroup(sd.SoftwareDeploymentGroup): + """This resource associates a group of servers with some configuration. + + This resource works similar as OS::Heat::SoftwareDeploymentGroup, but for + structured resources. + """ PROPERTIES = ( SERVERS, diff --git a/heat/engine/resources/openstack/keystone/role_assignments.py b/heat/engine/resources/openstack/keystone/role_assignments.py index f649a99f1c..65db09e788 100644 --- a/heat/engine/resources/openstack/keystone/role_assignments.py +++ b/heat/engine/resources/openstack/keystone/role_assignments.py @@ -312,7 +312,10 @@ class KeystoneRoleAssignmentMixin(object): class KeystoneUserRoleAssignment(resource.Resource, KeystoneRoleAssignmentMixin): - """Resource for granting roles to a user.""" + """Resource for granting roles to a user. + + Resource for specifying users and their's roles. + """ support_status = support.SupportStatus( version='5.0.0', @@ -363,7 +366,10 @@ class KeystoneUserRoleAssignment(resource.Resource, class KeystoneGroupRoleAssignment(resource.Resource, KeystoneRoleAssignmentMixin): - """Resource for granting roles to a group.""" + """Resource for granting roles to a group. + + Resource for specifying groups and their's roles. + """ support_status = support.SupportStatus( version='5.0.0', diff --git a/heat/engine/resources/openstack/neutron/extraroute.py b/heat/engine/resources/openstack/neutron/extraroute.py index 8b65174c06..c0ac15ed54 100644 --- a/heat/engine/resources/openstack/neutron/extraroute.py +++ b/heat/engine/resources/openstack/neutron/extraroute.py @@ -23,6 +23,10 @@ from heat.engine import support class ExtraRoute(neutron.NeutronResource): + """Resource for specifying extra routes for Neutron router. + + Resource allows to specify nexthop IP and destination network for router. + """ required_service_extension = 'extraroute' diff --git a/heat/engine/resources/openstack/neutron/floatingip.py b/heat/engine/resources/openstack/neutron/floatingip.py index d430a42729..3131f95c0b 100644 --- a/heat/engine/resources/openstack/neutron/floatingip.py +++ b/heat/engine/resources/openstack/neutron/floatingip.py @@ -28,7 +28,7 @@ class FloatingIP(neutron.NeutronResource): """A resource for managing Neutron floating ips. Floating IP addresses can change their association between routers by - action of the user. One of the most common use cases for floating IPs is + action of the user. One of the most common use cases for floating IPs is to provide public IP addresses to a private cloud, where there are a limited number of IP addresses available. Another is for a public cloud user to have a "static" IP address that can be reassigned when an instance diff --git a/heat/engine/resources/openstack/nova/floatingip.py b/heat/engine/resources/openstack/nova/floatingip.py index cea53ae12b..5481b995cc 100644 --- a/heat/engine/resources/openstack/nova/floatingip.py +++ b/heat/engine/resources/openstack/nova/floatingip.py @@ -30,7 +30,7 @@ class NovaFloatingIp(resource.Resource): """A resource for managing Nova floating IPs. Floating IP addresses can change their association between instances by - action of the user. One of the most common use cases for floating IPs is + action of the user. One of the most common use cases for floating IPs is to provide public IP addresses to a private cloud, where there are a limited number of IP addresses available. Another is for a public cloud user to have a "static" IP address that can be reassigned when an instance @@ -107,7 +107,10 @@ class NovaFloatingIp(resource.Resource): class NovaFloatingIpAssociation(resource.Resource): - """A resource associates Nova floating IP with Nova server resource.""" + """A resource associates Nova floating IP with Nova server resource. + + Resource for associating existing Nova floating IP and Nova server. + """ support_status = support.SupportStatus(version='2014.1') diff --git a/tools/custom_guidelines.py b/tools/custom_guidelines.py index 21dd50bbc4..a2db0c3d6f 100644 --- a/tools/custom_guidelines.py +++ b/tools/custom_guidelines.py @@ -53,7 +53,7 @@ class HeatCustomGuidelines(object): def check_resource_descriptions(self): for cls in self.resources_classes: # check resource's description - #self._check_resource_description(cls) + self._check_resource_description(cls) # check properties' descriptions self._check_resource_schemas(cls, cls.properties_schema, 'property')