diff --git a/contrib/docker/docker/resources/docker_container.py b/contrib/docker/docker/resources/docker_container.py index 6057ef6ac..3534b9ebb 100644 --- a/contrib/docker/docker/resources/docker_container.py +++ b/contrib/docker/docker/resources/docker_container.py @@ -14,6 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import properties from heat.engine import resource from heat.openstack.common.gettextutils import _ @@ -139,15 +140,33 @@ class DockerContainer(resource.Resource): } attributes_schema = { - 'info': _('Container info'), - 'network_info': _('Container network info'), - 'network_ip': _('Container ip address'), - 'network_gateway': _('Container ip gateway'), - 'network_tcp_ports': _('Container TCP ports'), - 'network_udp_ports': _('Container UDP ports'), - 'logs': _('Container logs'), - 'logs_head': _('Container first logs line'), - 'logs_tail': _('Container last logs line') + 'info': attributes.Schema( + _('Container info') + ), + 'network_info': attributes.Schema( + _('Container network info') + ), + 'network_ip': attributes.Schema( + _('Container ip address') + ), + 'network_gateway': attributes.Schema( + _('Container ip gateway') + ), + 'network_tcp_ports': attributes.Schema( + _('Container TCP ports') + ), + 'network_udp_ports': attributes.Schema( + _('Container UDP ports') + ), + 'logs': attributes.Schema( + _('Container logs') + ), + 'logs_head': attributes.Schema( + _('Container first logs line') + ), + 'logs_tail': attributes.Schema( + _('Container last logs line') + ), } def get_client(self): diff --git a/contrib/marconi/marconi/resources/queue.py b/contrib/marconi/marconi/resources/queue.py index 97f7beda8..a1c679547 100644 --- a/contrib/marconi/marconi/resources/queue.py +++ b/contrib/marconi/marconi/resources/queue.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.engine import attributes from heat.engine import properties from heat.engine import resource @@ -49,8 +50,12 @@ class MarconiQueue(resource.Resource): } attributes_schema = { - "queue_id": _("ID of the queue."), - "href": _("The resource href of the queue.") + "queue_id": attributes.Schema( + _("ID of the queue.") + ), + "href": attributes.Schema( + _("The resource href of the queue.") + ), } def __init__(self, name, json_snippet, stack): diff --git a/contrib/rackspace/rackspace/resources/auto_scale.py b/contrib/rackspace/rackspace/resources/auto_scale.py index 0d7908543..20eb99f58 100644 --- a/contrib/rackspace/rackspace/resources/auto_scale.py +++ b/contrib/rackspace/rackspace/resources/auto_scale.py @@ -15,6 +15,7 @@ import copy +from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine import resource @@ -504,10 +505,12 @@ class WebHook(resource.Resource): update_allowed_properties = (NAME, METADATA) attributes_schema = { - 'executeUrl': _( - "The url for executing the webhook (requires auth)."), - 'capabilityUrl': _( - "The url for executing the webhook (doesn't require auth)."), + 'executeUrl': attributes.Schema( + _("The url for executing the webhook (requires auth).") + ), + 'capabilityUrl': attributes.Schema( + _("The url for executing the webhook (doesn't require auth).") + ), } def _get_args(self, props): diff --git a/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py b/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py index 3f39a2144..0f76c9db7 100644 --- a/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py +++ b/contrib/rackspace/rackspace/resources/cloud_loadbalancer.py @@ -28,6 +28,7 @@ import itertools from heat.openstack.common import log as logging from heat.openstack.common.gettextutils import _ +from heat.engine import attributes from heat.engine import function from heat.engine import scheduler from heat.engine import constraints @@ -364,8 +365,10 @@ class CloudLoadBalancer(resource.Resource): } attributes_schema = { - 'PublicIp': _('Public IP address of the specified ' - 'instance.')} + 'PublicIp': attributes.Schema( + _('Public IP address of the specified instance.') + ), + } def __init__(self, name, json_snippet, stack): super(CloudLoadBalancer, self).__init__(name, json_snippet, stack) diff --git a/contrib/rackspace/rackspace/resources/cloud_server.py b/contrib/rackspace/rackspace/resources/cloud_server.py index 2a637aad4..3084c55d9 100644 --- a/contrib/rackspace/rackspace/resources/cloud_server.py +++ b/contrib/rackspace/rackspace/resources/cloud_server.py @@ -14,6 +14,7 @@ import copy from heat.common import exception +from heat.engine import attributes from heat.engine import properties from heat.engine.resources import nova_utils from heat.engine.resources import server @@ -60,9 +61,15 @@ class CloudServer(server.Server): attributes_schema = copy.deepcopy(server.Server.attributes_schema) attributes_schema.update( { - 'distro': _('The Linux distribution on the server.'), - 'privateIPv4': _('The private IPv4 address of the server.'), - 'admin_pass': _('The administrator password for the server.'), + 'distro': attributes.Schema( + _('The Linux distribution on the server.') + ), + 'privateIPv4': attributes.Schema( + _('The private IPv4 address of the server.') + ), + 'admin_pass': attributes.Schema( + _('The administrator password for the server.') + ), } ) diff --git a/contrib/rackspace/rackspace/resources/cloudnetworks.py b/contrib/rackspace/rackspace/resources/cloudnetworks.py index 13b585d8d..aef3597a1 100644 --- a/contrib/rackspace/rackspace/resources/cloudnetworks.py +++ b/contrib/rackspace/rackspace/resources/cloudnetworks.py @@ -14,6 +14,7 @@ import netaddr from heat.common import exception +from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine import resource @@ -69,8 +70,12 @@ class CloudNetwork(resource.Resource): } attributes_schema = { - "cidr": _("The CIDR for an isolated private network."), - "label": _("The name of the network.") + "cidr": attributes.Schema( + _("The CIDR for an isolated private network.") + ), + "label": attributes.Schema( + _("The name of the network.") + ), } def __init__(self, name, json_snippet, stack): diff --git a/heat/engine/resources/autoscaling.py b/heat/engine/resources/autoscaling.py index 1bc8782da..e7877224d 100644 --- a/heat/engine/resources/autoscaling.py +++ b/heat/engine/resources/autoscaling.py @@ -19,6 +19,7 @@ import six from heat.common import exception from heat.common import timeutils as iso8601utils +from heat.engine import attributes from heat.engine import constraints from heat.engine import environment from heat.engine import function @@ -140,8 +141,10 @@ class InstanceGroup(stack_resource.StackResource): } attributes_schema = { - "InstanceList": _("A comma-delimited list of server ip addresses. " - "(Heat extension).") + "InstanceList": attributes.Schema( + _("A comma-delimited list of server ip addresses. " + "(Heat extension).") + ), } rolling_update_schema = { MIN_INSTANCES_IN_SERVICE: properties.Schema(properties.Schema.NUMBER, @@ -1002,8 +1005,9 @@ class ScalingPolicy(signal_responder.SignalResponder, CooldownMixin): } attributes_schema = { - "AlarmUrl": _("A signed url to handle the alarm. " - "(Heat extension).") + "AlarmUrl": attributes.Schema( + _("A signed url to handle the alarm. (Heat extension).") + ), } def handle_create(self): @@ -1140,7 +1144,9 @@ class AutoScalingPolicy(ScalingPolicy): } attributes_schema = { - "alarm_url": _("A signed url to handle the alarm.") + "alarm_url": attributes.Schema( + _("A signed url to handle the alarm.") + ), } def _get_adjustement_type(self): diff --git a/heat/engine/resources/eip.py b/heat/engine/resources/eip.py index f796b8bd1..d149a8c88 100644 --- a/heat/engine/resources/eip.py +++ b/heat/engine/resources/eip.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -47,9 +48,11 @@ class ElasticIp(resource.Resource): } attributes_schema = { - 'AllocationId': _('ID that AWS assigns to represent the allocation of' - ' the address for use with Amazon VPC. Returned only' - ' for VPC elastic IP addresses.') + 'AllocationId': attributes.Schema( + _('ID that AWS assigns to represent the allocation of the address ' + 'for use with Amazon VPC. Returned only for VPC elastic IP ' + 'addresses.') + ), } def __init__(self, name, json_snippet, stack): diff --git a/heat/engine/resources/instance.py b/heat/engine/resources/instance.py index 83a0fe0bd..52fd02a13 100644 --- a/heat/engine/resources/instance.py +++ b/heat/engine/resources/instance.py @@ -19,6 +19,7 @@ import six cfg.CONF.import_opt('instance_user', 'heat.common.config') from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -51,8 +52,9 @@ class Restarter(signal_responder.SignalResponder): } attributes_schema = { - "AlarmUrl": _("A signed url to handle the alarm " - "(Heat extension).") + "AlarmUrl": attributes.Schema( + _("A signed url to handle the alarm (Heat extension).") + ), } def _find_resource(self, resource_id): @@ -296,17 +298,24 @@ class Instance(resource.Resource): ), } - attributes_schema = {'AvailabilityZone': _('The Availability Zone where ' - 'the specified instance is ' - 'launched.'), - 'PrivateDnsName': _('Private DNS name of the' - ' specified instance.'), - 'PublicDnsName': _('Public DNS name of the specified ' - 'instance.'), - 'PrivateIp': _('Private IP address of the specified ' - 'instance.'), - 'PublicIp': _('Public IP address of the specified ' - 'instance.')} + attributes_schema = { + 'AvailabilityZone': attributes.Schema( + _('The Availability Zone where the specified instance is ' + 'launched.') + ), + 'PrivateDnsName': attributes.Schema( + _('Private DNS name of the specified instance.') + ), + 'PublicDnsName': attributes.Schema( + _('Public DNS name of the specified instance.') + ), + 'PrivateIp': attributes.Schema( + _('Private IP address of the specified instance.') + ), + 'PublicIp': attributes.Schema( + _('Public IP address of the specified instance.') + ), + } # Server host name limit to 53 characters by due to typical default # linux HOST_NAME_MAX of 64, minus the .novalocal appended to the name diff --git a/heat/engine/resources/loadbalancer.py b/heat/engine/resources/loadbalancer.py index fc35c7701..55a027532 100644 --- a/heat/engine/resources/loadbalancer.py +++ b/heat/engine/resources/loadbalancer.py @@ -16,6 +16,7 @@ from oslo.config import cfg from heat.common import exception from heat.common import template_format +from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine.resources import nova_utils @@ -341,18 +342,24 @@ class LoadBalancer(stack_resource.StackResource): } attributes_schema = { - "CanonicalHostedZoneName": _("The name of the hosted zone that is " - "associated with the LoadBalancer."), - "CanonicalHostedZoneNameID": _("The ID of the hosted zone name " - "that is associated with the " - "LoadBalancer."), - "DNSName": _("The DNS name for the LoadBalancer."), - "SourceSecurityGroup.GroupName": _("The security group that you can " - "use as part of your inbound " - "rules for your LoadBalancer's " - "back-end instances."), - "SourceSecurityGroup.OwnerAlias": _("Owner of the source " - "security group.") + "CanonicalHostedZoneName": attributes.Schema( + _("The name of the hosted zone that is associated with the " + "LoadBalancer.") + ), + "CanonicalHostedZoneNameID": attributes.Schema( + _("The ID of the hosted zone name that is associated with the " + "LoadBalancer.") + ), + "DNSName": attributes.Schema( + _("The DNS name for the LoadBalancer.") + ), + "SourceSecurityGroup.GroupName": attributes.Schema( + _("The security group that you can use as part of your inbound " + "rules for your LoadBalancer's back-end instances.") + ), + "SourceSecurityGroup.OwnerAlias": attributes.Schema( + _("Owner of the source security group.") + ), } def _haproxy_config(self, templ, instances): diff --git a/heat/engine/resources/network_interface.py b/heat/engine/resources/network_interface.py index b46a2a11a..14cf0fcb9 100644 --- a/heat/engine/resources/network_interface.py +++ b/heat/engine/resources/network_interface.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import properties from heat.engine import resource @@ -76,8 +77,11 @@ class NetworkInterface(resource.Resource): ), } - attributes_schema = {'PrivateIpAddress': _('Private IP address of the ' - 'network interface.')} + attributes_schema = { + 'PrivateIpAddress': attributes.Schema( + _('Private IP address of the network interface.') + ), + } @staticmethod def network_id_from_subnet_id(neutronclient, subnet_id): diff --git a/heat/engine/resources/neutron/firewall.py b/heat/engine/resources/neutron/firewall.py index 4b04b0c65..54dd531bb 100644 --- a/heat/engine/resources/neutron/firewall.py +++ b/heat/engine/resources/neutron/firewall.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -60,14 +61,28 @@ class Firewall(neutron.NeutronResource): } attributes_schema = { - 'name': _('Name for the firewall.'), - 'description': _('Description of the firewall.'), - 'admin_state_up': _('The administrative state of the firewall.'), - 'firewall_policy_id': _('Unique identifier of the firewall policy ' - 'used to create the firewall.'), - 'status': _('The status of the firewall.'), - 'tenant_id': _('Id of the tenant owning the firewall.'), - 'show': _('All attributes.'), + 'name': attributes.Schema( + _('Name for the firewall.') + ), + 'description': attributes.Schema( + _('Description of the firewall.') + ), + 'admin_state_up': attributes.Schema( + _('The administrative state of the firewall.') + ), + 'firewall_policy_id': attributes.Schema( + _('Unique identifier of the firewall policy used to create ' + 'the firewall.') + ), + 'status': attributes.Schema( + _('The status of the firewall.') + ), + 'tenant_id': attributes.Schema( + _('Id of the tenant owning the firewall.') + ), + 'show': attributes.Schema( + _('All attributes.') + ), } def _show_resource(self): @@ -143,12 +158,24 @@ class FirewallPolicy(neutron.NeutronResource): } attributes_schema = { - 'name': _('Name for the firewall policy.'), - 'description': _('Description of the firewall policy.'), - 'firewall_rules': _('List of firewall rules in this firewall policy.'), - 'shared': _('Shared status of this firewall policy.'), - 'audited': _('Audit status of this firewall policy.'), - 'tenant_id': _('Id of the tenant owning the firewall policy.') + 'name': attributes.Schema( + _('Name for the firewall policy.') + ), + 'description': attributes.Schema( + _('Description of the firewall policy.') + ), + 'firewall_rules': attributes.Schema( + _('List of firewall rules in this firewall policy.') + ), + 'shared': attributes.Schema( + _('Shared status of this firewall policy.') + ), + 'audited': attributes.Schema( + _('Audit status of this firewall policy.') + ), + 'tenant_id': attributes.Schema( + _('Id of the tenant owning the firewall policy.') + ), } def _show_resource(self): @@ -265,24 +292,49 @@ class FirewallRule(neutron.NeutronResource): } attributes_schema = { - 'name': _('Name for the firewall rule.'), - 'description': _('Description of the firewall rule.'), - 'firewall_policy_id': _('Unique identifier of the firewall policy to ' - 'which this firewall rule belongs.'), - 'shared': _('Shared status of this firewall rule.'), - 'protocol': _('Protocol value for this firewall rule.'), - 'ip_version': _('Ip_version for this firewall rule.'), - 'source_ip_address': _('Source ip_address for this firewall rule.'), - 'destination_ip_address': _('Destination ip_address for this ' - 'firewall rule.'), - 'source_port': _('Source port range for this firewall rule.'), - 'destination_port': _('Destination port range for this firewall ' - 'rule.'), - 'action': _('Allow or deny action for this firewall rule.'), - 'enabled': _('Indicates whether this firewall rule is enabled or ' - 'not.'), - 'position': _('Position of the rule within the firewall policy.'), - 'tenant_id': _('Id of the tenant owning the firewall.') + 'name': attributes.Schema( + _('Name for the firewall rule.') + ), + 'description': attributes.Schema( + _('Description of the firewall rule.') + ), + 'firewall_policy_id': attributes.Schema( + _('Unique identifier of the firewall policy to which this ' + 'firewall rule belongs.') + ), + 'shared': attributes.Schema( + _('Shared status of this firewall rule.') + ), + 'protocol': attributes.Schema( + _('Protocol value for this firewall rule.') + ), + 'ip_version': attributes.Schema( + _('Ip_version for this firewall rule.') + ), + 'source_ip_address': attributes.Schema( + _('Source ip_address for this firewall rule.') + ), + 'destination_ip_address': attributes.Schema( + _('Destination ip_address for this firewall rule.') + ), + 'source_port': attributes.Schema( + _('Source port range for this firewall rule.') + ), + 'destination_port': attributes.Schema( + _('Destination port range for this firewall rule.') + ), + 'action': attributes.Schema( + _('Allow or deny action for this firewall rule.') + ), + 'enabled': attributes.Schema( + _('Indicates whether this firewall rule is enabled or not.') + ), + 'position': attributes.Schema( + _('Position of the rule within the firewall policy.') + ), + 'tenant_id': attributes.Schema( + _('Id of the tenant owning the firewall.') + ), } def _show_resource(self): diff --git a/heat/engine/resources/neutron/floatingip.py b/heat/engine/resources/neutron/floatingip.py index daccfd17a..8b1a54a19 100644 --- a/heat/engine/resources/neutron/floatingip.py +++ b/heat/engine/resources/neutron/floatingip.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import properties from heat.engine.resources.neutron import neutron @@ -62,16 +63,28 @@ class FloatingIP(neutron.NeutronResource): } attributes_schema = { - 'router_id': _('ID of the router used as gateway, set when associated ' - 'with a port.'), - 'tenant_id': _('The tenant owning this floating IP.'), - 'floating_network_id': _('ID of the network in which this IP is ' - 'allocated.'), - 'fixed_ip_address': _('IP address of the associated port, if ' - 'specified.'), - 'floating_ip_address': _('The allocated address of this IP.'), - 'port_id': _('ID of the port associated with this IP.'), - 'show': _('All attributes.') + 'router_id': attributes.Schema( + _('ID of the router used as gateway, set when associated with a ' + 'port.') + ), + 'tenant_id': attributes.Schema( + _('The tenant owning this floating IP.') + ), + 'floating_network_id': attributes.Schema( + _('ID of the network in which this IP is allocated.') + ), + 'fixed_ip_address': attributes.Schema( + _('IP address of the associated port, if specified.') + ), + 'floating_ip_address': attributes.Schema( + _('The allocated address of this IP.') + ), + 'port_id': attributes.Schema( + _('ID of the port associated with this IP.') + ), + 'show': attributes.Schema( + _('All attributes.') + ), } def add_dependencies(self, deps): diff --git a/heat/engine/resources/neutron/loadbalancer.py b/heat/engine/resources/neutron/loadbalancer.py index e0f2af253..aab7d72f7 100644 --- a/heat/engine/resources/neutron/loadbalancer.py +++ b/heat/engine/resources/neutron/loadbalancer.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -95,23 +96,41 @@ class HealthMonitor(neutron.NeutronResource): } attributes_schema = { - 'admin_state_up': _('The administrative state of this health ' - 'monitor.'), - 'delay': _('The minimum time in seconds between regular connections ' - 'of the member.'), - 'expected_codes': _('The list of HTTP status codes expected in ' - 'response from the member to declare it healthy.'), - 'http_method': _('The HTTP method used for requests by the monitor of ' - 'type HTTP.'), - 'max_retries': _('Number of permissible connection failures before ' - 'changing the member status to INACTIVE.'), - 'timeout': _('Maximum number of seconds for a monitor to wait for a ' - 'connection to be established before it times out.'), - 'type': _('One of predefined health monitor types.'), - 'url_path': _('The HTTP path used in the HTTP request used by the ' - 'monitor to test a member health.'), - 'tenant_id': _('Tenant owning the health monitor.'), - 'show': _('All attributes.'), + 'admin_state_up': attributes.Schema( + _('The administrative state of this health monitor.') + ), + 'delay': attributes.Schema( + _('The minimum time in seconds between regular connections ' + 'of the member.') + ), + 'expected_codes': attributes.Schema( + _('The list of HTTP status codes expected in response ' + 'from the member to declare it healthy.') + ), + 'http_method': attributes.Schema( + _('The HTTP method used for requests by the monitor of type HTTP.') + ), + 'max_retries': attributes.Schema( + _('Number of permissible connection failures before changing ' + 'the member status to INACTIVE.') + ), + 'timeout': attributes.Schema( + _('Maximum number of seconds for a monitor to wait for a ' + 'connection to be established before it times out.') + ), + 'type': attributes.Schema( + _('One of predefined health monitor types.') + ), + 'url_path': attributes.Schema( + _('The HTTP path used in the HTTP request used by the monitor ' + 'to test a member health.') + ), + 'tenant_id': attributes.Schema( + _('Tenant owning the health monitor.') + ), + 'show': attributes.Schema( + _('All attributes.') + ), } def handle_create(self): @@ -285,16 +304,32 @@ class Pool(neutron.NeutronResource): } attributes_schema = { - 'admin_state_up': _('The administrative state of this pool.'), - 'name': _('Name of the pool.'), - 'protocol': _('Protocol to balance.'), - 'subnet_id': _('The subnet for the port on which the members ' - 'of the pool will be connected.'), - 'lb_method': _('The algorithm used to distribute load between the ' - 'members of the pool.'), - 'description': _('Description of the pool.'), - 'tenant_id': _('Tenant owning the pool.'), - 'vip': _('Vip associated with the pool.'), + 'admin_state_up': attributes.Schema( + _('The administrative state of this pool.') + ), + 'name': attributes.Schema( + _('Name of the pool.') + ), + 'protocol': attributes.Schema( + _('Protocol to balance.') + ), + 'subnet_id': attributes.Schema( + _('The subnet for the port on which the members of the pool ' + 'will be connected.') + ), + 'lb_method': attributes.Schema( + _('The algorithm used to distribute load between the members ' + 'of the pool.') + ), + 'description': attributes.Schema( + _('Description of the pool.') + ), + 'tenant_id': attributes.Schema( + _('Tenant owning the pool.') + ), + 'vip': attributes.Schema( + _('Vip associated with the pool.') + ), } def validate(self): @@ -487,15 +522,28 @@ class PoolMember(neutron.NeutronResource): } attributes_schema = { - 'admin_state_up': _('The administrative state of this pool ' - 'member.'), - 'tenant_id': _('Tenant owning the pool member.'), - 'weight': _('Weight of the pool member in the pool.'), - 'address': _('IP address of the pool member.'), - 'pool_id': _('The ID of the load balancing pool.'), - 'protocol_port': _('TCP port on which the pool member listens for' - 'requests or connections.'), - 'show': _('All attributes.'), + 'admin_state_up': attributes.Schema( + _('The administrative state of this pool member.') + ), + 'tenant_id': attributes.Schema( + _('Tenant owning the pool member.') + ), + 'weight': attributes.Schema( + _('Weight of the pool member in the pool.') + ), + 'address': attributes.Schema( + _('IP address of the pool member.') + ), + 'pool_id': attributes.Schema( + _('The ID of the load balancing pool.') + ), + 'protocol_port': attributes.Schema( + _('TCP port on which the pool member listens for requests or ' + 'connections.') + ), + 'show': attributes.Schema( + _('All attributes.') + ), } def handle_create(self): diff --git a/heat/engine/resources/neutron/metering.py b/heat/engine/resources/neutron/metering.py index 247dd0e02..abcf0ea03 100644 --- a/heat/engine/resources/neutron/metering.py +++ b/heat/engine/resources/neutron/metering.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -43,8 +44,12 @@ class MeteringLabel(neutron.NeutronResource): } attributes_schema = { - 'name': _('Name of the metering label.'), - 'description': _('Description of the metering label.'), + 'name': attributes.Schema( + _('Name of the metering label.') + ), + 'description': attributes.Schema( + _('Description of the metering label.') + ), } def handle_create(self): @@ -111,12 +116,18 @@ class MeteringRule(neutron.NeutronResource): } attributes_schema = { - 'direction': _('The direction in which metering rule is applied.'), - 'excluded': _('Exclude state for cidr.'), - 'metering_label_id': _('The metering label ID to associate with ' - 'this metering rule..'), - 'remote_ip_prefix': _('CIDR to be associated with this metering ' - 'rule.'), + 'direction': attributes.Schema( + _('The direction in which metering rule is applied.') + ), + 'excluded': attributes.Schema( + _('Exclude state for cidr.') + ), + 'metering_label_id': attributes.Schema( + _('The metering label ID to associate with this metering rule.') + ), + 'remote_ip_prefix': attributes.Schema( + _('CIDR to be associated with this metering rule.') + ), } def handle_create(self): diff --git a/heat/engine/resources/neutron/net.py b/heat/engine/resources/neutron/net.py index 5e70b2edb..7c720eabc 100644 --- a/heat/engine/resources/neutron/net.py +++ b/heat/engine/resources/neutron/net.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -76,12 +77,24 @@ class Net(neutron.NeutronResource): } attributes_schema = { - "status": _("The status of the network."), - "name": _("The name of the network."), - "subnets": _("Subnets of this network."), - "admin_state_up": _("The administrative status of the network."), - "tenant_id": _("The tenant owning this network."), - "show": _("All attributes."), + "status": attributes.Schema( + _("The status of the network.") + ), + "name": attributes.Schema( + _("The name of the network.") + ), + "subnets": attributes.Schema( + _("Subnets of this network.") + ), + "admin_state_up": attributes.Schema( + _("The administrative status of the network.") + ), + "tenant_id": attributes.Schema( + _("The tenant owning this network.") + ), + "show": attributes.Schema( + _("All attributes.") + ), } def handle_create(self): diff --git a/heat/engine/resources/neutron/network_gateway.py b/heat/engine/resources/neutron/network_gateway.py index 710b586ca..46f9a96c5 100644 --- a/heat/engine/resources/neutron/network_gateway.py +++ b/heat/engine/resources/neutron/network_gateway.py @@ -15,6 +15,7 @@ # limitations under the License. from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -123,8 +124,12 @@ class NetworkGateway(neutron.NeutronResource): } attributes_schema = { - "default": _("A boolean value of default flag."), - "show": _("All attributes.") + "default": attributes.Schema( + _("A boolean value of default flag.") + ), + "show": attributes.Schema( + _("All attributes.") + ), } def _show_resource(self): diff --git a/heat/engine/resources/neutron/port.py b/heat/engine/resources/neutron/port.py index 321df0ffa..18e6a4413 100644 --- a/heat/engine/resources/neutron/port.py +++ b/heat/engine/resources/neutron/port.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import properties from heat.engine.resources.neutron import neutron @@ -150,19 +151,43 @@ class Port(neutron.NeutronResource): } attributes_schema = { - "admin_state_up": _("The administrative state of this port."), - "device_id": _("Unique identifier for the device."), - "device_owner": _("Name of the network owning the port."), - "fixed_ips": _("Fixed IP addresses."), - "mac_address": _("MAC address of the port."), - "name": _("Friendly name of the port."), - "network_id": _("Unique identifier for the network owning the port."), - "security_groups": _("A list of security groups for the port."), - "status": _("The status of the port."), - "tenant_id": _("Tenant owning the port."), - "allowed_address_pairs": _("Additional MAC/IP address pairs allowed " - "to pass through a port."), - "show": _("All attributes."), + "admin_state_up": attributes.Schema( + _("The administrative state of this port.") + ), + "device_id": attributes.Schema( + _("Unique identifier for the device.") + ), + "device_owner": attributes.Schema( + _("Name of the network owning the port.") + ), + "fixed_ips": attributes.Schema( + _("Fixed IP addresses.") + ), + "mac_address": attributes.Schema( + _("MAC address of the port.") + ), + "name": attributes.Schema( + _("Friendly name of the port.") + ), + "network_id": attributes.Schema( + _("Unique identifier for the network owning the port.") + ), + "security_groups": attributes.Schema( + _("A list of security groups for the port.") + ), + "status": attributes.Schema( + _("The status of the port.") + ), + "tenant_id": attributes.Schema( + _("Tenant owning the port.") + ), + "allowed_address_pairs": attributes.Schema( + _("Additional MAC/IP address pairs allowed to pass through " + "a port.") + ), + "show": attributes.Schema( + _("All attributes.") + ), } def validate(self): diff --git a/heat/engine/resources/neutron/provider_net.py b/heat/engine/resources/neutron/provider_net.py index bff51302b..a588e834e 100644 --- a/heat/engine/resources/neutron/provider_net.py +++ b/heat/engine/resources/neutron/provider_net.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -61,9 +62,15 @@ class ProviderNet(net.Net): } attributes_schema = { - "status": _("The status of the network."), - "subnets": _("Subnets of this network."), - "show": _("All attributes."), + "status": attributes.Schema( + _("The status of the network.") + ), + "subnets": attributes.Schema( + _("Subnets of this network.") + ), + "show": attributes.Schema( + _("All attributes.") + ), } def validate(self): diff --git a/heat/engine/resources/neutron/router.py b/heat/engine/resources/neutron/router.py index 826ea689f..34a279a3d 100644 --- a/heat/engine/resources/neutron/router.py +++ b/heat/engine/resources/neutron/router.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import properties from heat.engine.resources.neutron import neutron @@ -86,12 +87,24 @@ class Router(neutron.NeutronResource): } attributes_schema = { - "status": _("The status of the router."), - "external_gateway_info": _("Gateway network for the router."), - "name": _("Friendly name of the router."), - "admin_state_up": _("Administrative state of the router."), - "tenant_id": _("Tenant owning the router."), - "show": _("All attributes."), + "status": attributes.Schema( + _("The status of the router.") + ), + "external_gateway_info": attributes.Schema( + _("Gateway network for the router.") + ), + "name": attributes.Schema( + _("Friendly name of the router.") + ), + "admin_state_up": attributes.Schema( + _("Administrative state of the router.") + ), + "tenant_id": attributes.Schema( + _("Tenant owning the router.") + ), + "show": attributes.Schema( + _("All attributes.") + ), } def add_dependencies(self, deps): diff --git a/heat/engine/resources/neutron/subnet.py b/heat/engine/resources/neutron/subnet.py index 08964582b..f0fcd3d1a 100644 --- a/heat/engine/resources/neutron/subnet.py +++ b/heat/engine/resources/neutron/subnet.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -140,18 +141,39 @@ class Subnet(neutron.NeutronResource): } attributes_schema = { - "name": _("Friendly name of the subnet."), - "network_id": _("Parent network of the subnet."), - "tenant_id": _("Tenant owning the subnet."), - "allocation_pools": _("Ip allocation pools and their ranges."), - "gateway_ip": _("Ip of the subnet's gateway."), - "host_routes": _("Additional routes for this subnet."), - "ip_version": _("Ip version for the subnet."), - "cidr": _("CIDR block notation for this subnet."), - "dns_nameservers": _("List of dns nameservers."), - "enable_dhcp": _("'true' if DHCP is enabled for this subnet; 'false' " - "otherwise."), - "show": _("All attributes."), + "name": attributes.Schema( + _("Friendly name of the subnet.") + ), + "network_id": attributes.Schema( + _("Parent network of the subnet.") + ), + "tenant_id": attributes.Schema( + _("Tenant owning the subnet.") + ), + "allocation_pools": attributes.Schema( + _("Ip allocation pools and their ranges.") + ), + "gateway_ip": attributes.Schema( + _("Ip of the subnet's gateway.") + ), + "host_routes": attributes.Schema( + _("Additional routes for this subnet.") + ), + "ip_version": attributes.Schema( + _("Ip version for the subnet.") + ), + "cidr": attributes.Schema( + _("CIDR block notation for this subnet.") + ), + "dns_nameservers": attributes.Schema( + _("List of dns nameservers.") + ), + "enable_dhcp": attributes.Schema( + _("'true' if DHCP is enabled for this subnet; 'false' otherwise.") + ), + "show": attributes.Schema( + _("All attributes.") + ), } @classmethod diff --git a/heat/engine/resources/neutron/vpnservice.py b/heat/engine/resources/neutron/vpnservice.py index 520023f84..28aed4c24 100644 --- a/heat/engine/resources/neutron/vpnservice.py +++ b/heat/engine/resources/neutron/vpnservice.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -72,17 +73,32 @@ class VPNService(neutron.NeutronResource): } attributes_schema = { - 'admin_state_up': _('The administrative state of the vpn service.'), - 'description': _('The description of the vpn service.'), - 'name': _('The name of the vpn service.'), - 'router_id': _('The unique identifier of the router to which the vpn ' - 'service was inserted.'), - 'status': _('The status of the vpn service.'), - 'subnet_id': _('The unique identifier of the subnet in which the vpn ' - 'service was created.'), - 'tenant_id': _('The unique identifier of the tenant owning the vpn ' - 'service.'), - 'show': _('All attributes.'), + 'admin_state_up': attributes.Schema( + _('The administrative state of the vpn service.') + ), + 'description': attributes.Schema( + _('The description of the vpn service.') + ), + 'name': attributes.Schema( + _('The name of the vpn service.') + ), + 'router_id': attributes.Schema( + _('The unique identifier of the router to which the vpn service ' + 'was inserted.') + ), + 'status': attributes.Schema( + _('The status of the vpn service.') + ), + 'subnet_id': attributes.Schema( + _('The unique identifier of the subnet in which the vpn service ' + 'was created.') + ), + 'tenant_id': attributes.Schema( + _('The unique identifier of the tenant owning the vpn service.') + ), + 'show': attributes.Schema( + _('All attributes.') + ), } def _show_resource(self): @@ -240,34 +256,66 @@ class IPsecSiteConnection(neutron.NeutronResource): } attributes_schema = { - 'admin_state_up': _('The administrative state of the ipsec site ' - 'connection.'), - 'auth_mode': _('The authentication mode of the ipsec site ' - 'connection.'), - 'description': _('The description of the ipsec site connection.'), - 'dpd': _('The dead peer detection protocol configuration of the ipsec ' - 'site connection.'), - 'ikepolicy_id': _('The unique identifier of ike policy associated ' - 'with the ipsec site connection.'), - 'initiator': _('The initiator of the ipsec site connection.'), - 'ipsecpolicy_id': _('The unique identifier of ipsec policy ' - 'associated with the ipsec site connection.'), - 'mtu': _('The maximum transmission unit size (in bytes) of the ipsec ' - 'site connection.'), - 'name': _('The name of the ipsec site connection.'), - 'peer_address': _('The remote branch router public IPv4 address or ' - 'IPv6 address or FQDN.'), - 'peer_cidrs': _('The remote subnet(s) in CIDR format of the ipsec ' - 'site connection.'), - 'peer_id': _('The remote branch router identity of the ipsec site ' - 'connection.'), - 'psk': _('The pre-shared key string of the ipsec site connection.'), - 'route_mode': _('The route mode of the ipsec site connection.'), - 'status': _('The status of the ipsec site connection.'), - 'tenant_id': _('The unique identifier of the tenant owning the ipsec ' - 'site connection.'), - 'vpnservice_id': _('The unique identifier of vpn service associated ' - 'with the ipsec site connection.') + 'admin_state_up': attributes.Schema( + _('The administrative state of the ipsec site connection.') + ), + 'auth_mode': attributes.Schema( + _('The authentication mode of the ipsec site connection.') + ), + 'description': attributes.Schema( + _('The description of the ipsec site connection.') + ), + 'dpd': attributes.Schema( + _('The dead peer detection protocol configuration of the ipsec ' + 'site connection.') + ), + 'ikepolicy_id': attributes.Schema( + _('The unique identifier of ike policy associated with the ipsec ' + 'site connection.') + ), + 'initiator': attributes.Schema( + _('The initiator of the ipsec site connection.') + ), + 'ipsecpolicy_id': attributes.Schema( + _('The unique identifier of ipsec policy associated with the ' + 'ipsec site connection.') + ), + 'mtu': attributes.Schema( + _('The maximum transmission unit size (in bytes) of the ipsec ' + 'site connection.') + ), + 'name': attributes.Schema( + _('The name of the ipsec site connection.') + ), + 'peer_address': attributes.Schema( + _('The remote branch router public IPv4 address or IPv6 address ' + 'or FQDN.') + ), + 'peer_cidrs': attributes.Schema( + _('The remote subnet(s) in CIDR format of the ipsec site ' + 'connection.') + ), + 'peer_id': attributes.Schema( + _('The remote branch router identity of the ipsec site ' + 'connection.') + ), + 'psk': attributes.Schema( + _('The pre-shared key string of the ipsec site connection.') + ), + 'route_mode': attributes.Schema( + _('The route mode of the ipsec site connection.') + ), + 'status': attributes.Schema( + _('The status of the ipsec site connection.') + ), + 'tenant_id': attributes.Schema( + _('The unique identifier of the tenant owning the ipsec site ' + 'connection.') + ), + 'vpnservice_id': attributes.Schema( + _('The unique identifier of vpn service associated with the ipsec ' + 'site connection.') + ), } def _show_resource(self): @@ -391,20 +439,34 @@ class IKEPolicy(neutron.NeutronResource): } attributes_schema = { - 'auth_algorithm': _('The authentication hash algorithm used by the ike' - ' policy.'), - 'description': _('The description of the ike policy.'), - 'encryption_algorithm': _('The encryption algorithm used by the ike ' - 'policy.'), - 'ike_version': _('The version of the ike policy.'), - 'lifetime': _('The safety assessment lifetime configuration for the ' - 'ike policy.'), - 'name': _('The name of the ike policy.'), - 'pfs': _('The perfect forward secrecy of the ike policy.'), - 'phase1_negotiation_mode': _('The negotiation mode of the ike ' - 'policy.'), - 'tenant_id': _('The unique identifier of the tenant owning the ike ' - 'policy.'), + 'auth_algorithm': attributes.Schema( + _('The authentication hash algorithm used by the ike policy.') + ), + 'description': attributes.Schema( + _('The description of the ike policy.') + ), + 'encryption_algorithm': attributes.Schema( + _('The encryption algorithm used by the ike policy.') + ), + 'ike_version': attributes.Schema( + _('The version of the ike policy.') + ), + 'lifetime': attributes.Schema( + _('The safety assessment lifetime configuration for the ike ' + 'policy.') + ), + 'name': attributes.Schema( + _('The name of the ike policy.') + ), + 'pfs': attributes.Schema( + _('The perfect forward secrecy of the ike policy.') + ), + 'phase1_negotiation_mode': attributes.Schema( + _('The negotiation mode of the ike policy.') + ), + 'tenant_id': attributes.Schema( + _('The unique identifier of the tenant owning the ike policy.') + ), } def _show_resource(self): @@ -529,19 +591,34 @@ class IPsecPolicy(neutron.NeutronResource): } attributes_schema = { - 'auth_algorithm': _('The authentication hash algorithm of the ipsec ' - 'policy.'), - 'description': _('The description of the ipsec policy.'), - 'encapsulation_mode': _('The encapsulation mode of the ipsec policy.'), - 'encryption_algorithm': _('The encryption algorithm of the ipsec ' - 'policy.'), - 'lifetime': _('The safety assessment lifetime configuration of the ' - 'ipsec policy.'), - 'name': _('The name of the ipsec policy.'), - 'pfs': _('The perfect forward secrecy of the ipsec policy.'), - 'tenant_id': _('The unique identifier of the tenant owning the ' - 'ipsec policy.'), - 'transform_protocol': _('The transform protocol of the ipsec policy.') + 'auth_algorithm': attributes.Schema( + _('The authentication hash algorithm of the ipsec policy.') + ), + 'description': attributes.Schema( + _('The description of the ipsec policy.') + ), + 'encapsulation_mode': attributes.Schema( + _('The encapsulation mode of the ipsec policy.') + ), + 'encryption_algorithm': attributes.Schema( + _('The encryption algorithm of the ipsec policy.') + ), + 'lifetime': attributes.Schema( + _('The safety assessment lifetime configuration of the ipsec ' + 'policy.') + ), + 'name': attributes.Schema( + _('The name of the ipsec policy.') + ), + 'pfs': attributes.Schema( + _('The perfect forward secrecy of the ipsec policy.') + ), + 'tenant_id': attributes.Schema( + _('The unique identifier of the tenant owning the ipsec policy.') + ), + 'transform_protocol': attributes.Schema( + _('The transform protocol of the ipsec policy.') + ), } def _show_resource(self): diff --git a/heat/engine/resources/nova_floatingip.py b/heat/engine/resources/nova_floatingip.py index 6c17e9e5f..3fdf9d9a3 100644 --- a/heat/engine/resources/nova_floatingip.py +++ b/heat/engine/resources/nova_floatingip.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heat.engine import attributes from heat.engine import clients from heat.engine import properties from heat.engine import resource @@ -33,8 +34,12 @@ class NovaFloatingIp(resource.Resource): } attributes_schema = { - 'pool': _('Pool from which floating IP is allocated.'), - 'ip': _('Allocated floating IP address.') + 'pool': attributes.Schema( + _('Pool from which floating IP is allocated.') + ), + 'ip': attributes.Schema( + _('Allocated floating IP address.') + ), } def __init__(self, name, json_snippet, stack): diff --git a/heat/engine/resources/nova_keypair.py b/heat/engine/resources/nova_keypair.py index a18128fb9..14dc1370c 100644 --- a/heat/engine/resources/nova_keypair.py +++ b/heat/engine/resources/nova_keypair.py @@ -14,6 +14,7 @@ from novaclient import exceptions as nova_exceptions from heat.common import exception +from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine import resource @@ -62,8 +63,12 @@ class KeyPair(resource.Resource): } attributes_schema = { - 'public_key': _('The public key.'), - 'private_key': _('The private key if it has been saved.') + 'public_key': attributes.Schema( + _('The public key.') + ), + 'private_key': attributes.Schema( + _('The private key if it has been saved.') + ), } def __init__(self, name, json_snippet, stack): diff --git a/heat/engine/resources/os_database.py b/heat/engine/resources/os_database.py index ae37a5469..2782cbb69 100644 --- a/heat/engine/resources/os_database.py +++ b/heat/engine/resources/os_database.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.engine import attributes from heat.engine.clients import troveclient from heat.engine import constraints from heat.engine import properties @@ -162,8 +163,12 @@ class OSDBInstance(resource.Resource): } attributes_schema = { - "hostname": _("Hostname of the instance"), - "href": _("Api endpoint reference of the instance") + "hostname": attributes.Schema( + _("Hostname of the instance") + ), + "href": attributes.Schema( + _("Api endpoint reference of the instance") + ), } def __init__(self, name, json_snippet, stack): diff --git a/heat/engine/resources/random_string.py b/heat/engine/resources/random_string.py index 211f18392..6d49ba81f 100644 --- a/heat/engine/resources/random_string.py +++ b/heat/engine/resources/random_string.py @@ -16,6 +16,7 @@ import string from six.moves import xrange +from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine import resource @@ -62,8 +63,10 @@ class RandomString(resource.Resource): } attributes_schema = { - 'value': _('The random string generated by this resource. This value ' - 'is also available by referencing the resource.'), + 'value': attributes.Schema( + _('The random string generated by this resource. This value is ' + 'also available by referencing the resource.') + ), } _sequences = { diff --git a/heat/engine/resources/resource_group.py b/heat/engine/resources/resource_group.py index bf0cb5ee3..b2ecd956b 100644 --- a/heat/engine/resources/resource_group.py +++ b/heat/engine/resources/resource_group.py @@ -14,6 +14,7 @@ import copy from heat.common import exception +from heat.engine import attributes from heat.engine import constraints from heat.engine import parser from heat.engine import properties @@ -85,7 +86,9 @@ class ResourceGroup(stack_resource.StackResource): } attributes_schema = { - "refs": _("A list of resource IDs for the resources in the group") + "refs": attributes.Schema( + _("A list of resource IDs for the resources in the group") + ), } def validate(self): diff --git a/heat/engine/resources/s3.py b/heat/engine/resources/s3.py index d1c0ada38..e5ee9f62f 100644 --- a/heat/engine/resources/s3.py +++ b/heat/engine/resources/s3.py @@ -13,6 +13,7 @@ from six.moves.urllib import parse as urlparse +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -93,8 +94,12 @@ class S3Bucket(resource.Resource): } attributes_schema = { - 'DomainName': _('The DNS name of the specified bucket.'), - 'WebsiteURL': _('The website endpoint for the specified bucket.') + 'DomainName': attributes.Schema( + _('The DNS name of the specified bucket.') + ), + 'WebsiteURL': attributes.Schema( + _('The website endpoint for the specified bucket.') + ), } def tags_to_headers(self): diff --git a/heat/engine/resources/server.py b/heat/engine/resources/server.py index fca4ebe93..3e50c6a9b 100644 --- a/heat/engine/resources/server.py +++ b/heat/engine/resources/server.py @@ -299,11 +299,16 @@ class Server(stack_user.StackUser): } attributes_schema = { - 'show': _('A dict of all server details as returned by the API.'), - 'addresses': _('A dict of all network addresses with corresponding ' - 'port_id.'), - 'networks': _('A dict of assigned network addresses of the form: ' - '{"public": [ip1, ip2...], "private": [ip3, ip4]}.'), + 'show': attributes.Schema( + _('A dict of all server details as returned by the API.') + ), + 'addresses': attributes.Schema( + _('A dict of all network addresses with corresponding port_id.') + ), + 'networks': attributes.Schema( + _('A dict of assigned network addresses of the form: ' + '{"public": [ip1, ip2...], "private": [ip3, ip4]}.') + ), 'first_address': attributes.Schema( _('Convenience attribute to fetch the first assigned network ' 'address, or an empty string if nothing has been assigned at ' @@ -316,11 +321,17 @@ class Server(stack_user.StackUser): '[, networks, , 0]}"') ) ), - 'instance_name': _('AWS compatible instance name.'), - 'accessIPv4': _('The manually assigned alternative public IPv4 ' - 'address of the server.'), - 'accessIPv6': _('The manually assigned alternative public IPv6 ' - 'address of the server.'), + 'instance_name': attributes.Schema( + _('AWS compatible instance name.') + ), + 'accessIPv4': attributes.Schema( + _('The manually assigned alternative public IPv4 address ' + 'of the server.') + ), + 'accessIPv6': attributes.Schema( + _('The manually assigned alternative public IPv6 address ' + 'of the server.') + ), } # Server host name limit to 53 characters by due to typical default diff --git a/heat/engine/resources/software_config/software_config.py b/heat/engine/resources/software_config/software_config.py index 1c3f4453e..aa1b8e7aa 100644 --- a/heat/engine/resources/software_config/software_config.py +++ b/heat/engine/resources/software_config/software_config.py @@ -14,6 +14,7 @@ import heatclient.exc as heat_exp from heat.common import exception +from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine import resource @@ -140,7 +141,9 @@ class SoftwareConfig(resource.Resource): } attributes_schema = { - "config": _("The config value of the software config.") + "config": attributes.Schema( + _("The config value of the software config.") + ), } def handle_create(self): diff --git a/heat/engine/resources/software_config/software_deployment.py b/heat/engine/resources/software_config/software_deployment.py index e39ea8585..cdf0fa008 100644 --- a/heat/engine/resources/software_config/software_deployment.py +++ b/heat/engine/resources/software_config/software_deployment.py @@ -19,6 +19,7 @@ import uuid import heatclient.exc as heat_exp from heat.common import exception +from heat.engine import attributes from heat.engine import constraints from heat.engine import function from heat.engine import properties @@ -149,10 +150,15 @@ class SoftwareDeployment(signal_responder.SignalResponder): } attributes_schema = { - STDOUT: _("Captured stdout from the configuration execution."), - STDERR: _("Captured stderr from the configuration execution."), - STATUS_CODE: _("Returned status code from the configuration " - "execution"), + STDOUT: attributes.Schema( + _("Captured stdout from the configuration execution.") + ), + STDERR: attributes.Schema( + _("Captured stderr from the configuration execution.") + ), + STATUS_CODE: attributes.Schema( + _("Returned status code from the configuration execution") + ), } def _signal_transport_cfn(self): diff --git a/heat/engine/resources/swift.py b/heat/engine/resources/swift.py index c43e6c550..fb14dff8c 100644 --- a/heat/engine/resources/swift.py +++ b/heat/engine/resources/swift.py @@ -14,6 +14,7 @@ from six.moves.urllib import parse as urlparse from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import properties from heat.engine import resource @@ -64,12 +65,24 @@ class SwiftContainer(resource.Resource): } attributes_schema = { - 'DomainName': _('The host from the container URL.'), - 'WebsiteURL': _('The URL of the container.'), - 'RootURL': _('The parent URL of the container.'), - 'ObjectCount': _('The number of objects stored in the container.'), - 'BytesUsed': _('The number of bytes stored in the container.'), - 'HeadContainer': _('A map containing all headers for the container.') + 'DomainName': attributes.Schema( + _('The host from the container URL.') + ), + 'WebsiteURL': attributes.Schema( + _('The URL of the container.') + ), + 'RootURL': attributes.Schema( + _('The parent URL of the container.') + ), + 'ObjectCount': attributes.Schema( + _('The number of objects stored in the container.') + ), + 'BytesUsed': attributes.Schema( + _('The number of bytes stored in the container.') + ), + 'HeadContainer': attributes.Schema( + _('A map containing all headers for the container.') + ), } def physical_resource_name(self): diff --git a/heat/engine/resources/user.py b/heat/engine/resources/user.py index 08576497c..e8c91af0d 100644 --- a/heat/engine/resources/user.py +++ b/heat/engine/resources/user.py @@ -12,6 +12,7 @@ # under the License. from heat.common import exception +from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine import resource @@ -153,8 +154,12 @@ class AccessKey(resource.Resource): } attributes_schema = { - 'UserName': _('Username associated with the AccessKey.'), - 'SecretAccessKey': _('Keypair secret key.'), + 'UserName': attributes.Schema( + _('Username associated with the AccessKey.') + ), + 'SecretAccessKey': attributes.Schema( + _('Keypair secret key.') + ), } def __init__(self, name, json_snippet, stack): diff --git a/heat/engine/resources/volume.py b/heat/engine/resources/volume.py index 1565fdde7..e2c450b2c 100644 --- a/heat/engine/resources/volume.py +++ b/heat/engine/resources/volume.py @@ -14,6 +14,7 @@ import json from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -482,20 +483,39 @@ class CinderVolume(Volume): } attributes_schema = { - 'availability_zone': _('The availability zone in which the volume is ' - ' located.'), - 'size': _('The size of the volume in GB.'), - 'snapshot_id': _('The snapshot the volume was created from, if any.'), - 'display_name': _('Name of the volume.'), - 'display_description': _('Description of the volume.'), - 'volume_type': _('The type of the volume mapping to a backend, if ' - 'any.'), - 'metadata': _('Key/value pairs associated with the volume.'), - 'source_volid': _('The volume used as source, if any.'), - 'status': _('The current status of the volume.'), - 'created_at': _('The timestamp indicating volume creation.'), - 'bootable': _('Boolean indicating if the volume can be booted or ' - 'not.'), + 'availability_zone': attributes.Schema( + _('The availability zone in which the volume is located.') + ), + 'size': attributes.Schema( + _('The size of the volume in GB.') + ), + 'snapshot_id': attributes.Schema( + _('The snapshot the volume was created from, if any.') + ), + 'display_name': attributes.Schema( + _('Name of the volume.') + ), + 'display_description': attributes.Schema( + _('Description of the volume.') + ), + 'volume_type': attributes.Schema( + _('The type of the volume mapping to a backend, if any.') + ), + 'metadata': attributes.Schema( + _('Key/value pairs associated with the volume.') + ), + 'source_volid': attributes.Schema( + _('The volume used as source, if any.') + ), + 'status': attributes.Schema( + _('The current status of the volume.') + ), + 'created_at': attributes.Schema( + _('The timestamp indicating volume creation.') + ), + 'bootable': attributes.Schema( + _('Boolean indicating if the volume can be booted or not.') + ), } _volume_creating_status = ['creating', 'restoring-backup', 'downloading'] diff --git a/heat/engine/resources/wait_condition.py b/heat/engine/resources/wait_condition.py index 18b6d8b42..83851394f 100644 --- a/heat/engine/resources/wait_condition.py +++ b/heat/engine/resources/wait_condition.py @@ -15,6 +15,7 @@ import json from heat.common import exception from heat.common import identifier +from heat.engine import attributes from heat.engine import constraints from heat.engine import function from heat.engine import properties @@ -178,8 +179,10 @@ class WaitCondition(resource.Resource): } attributes_schema = { - 'Data': _('JSON serialized dict containing data associated with wait ' - 'condition signals sent to the handle.'), + 'Data': attributes.Schema( + _('JSON serialized dict containing data associated with wait ' + 'condition signals sent to the handle.') + ), } def __init__(self, name, json_snippet, stack):