]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
get rid of no-op __init__ methods
authorChristopher Armstrong <chris.armstrong@rackspace.com>
Thu, 30 May 2013 20:54:25 +0000 (20:54 +0000)
committerChristopher Armstrong <chris.armstrong@rackspace.com>
Thu, 6 Jun 2013 17:12:52 +0000 (12:12 -0500)
There were a lot of __init__ methods that simply called their super()
with nothing else.

Change-Id: I6771912adf81f145d09f950c57d219bd77789822

18 files changed:
heat/engine/resources/autoscaling.py
heat/engine/resources/eip.py
heat/engine/resources/internet_gateway.py
heat/engine/resources/network_interface.py
heat/engine/resources/quantum/floatingip.py
heat/engine/resources/quantum/net.py
heat/engine/resources/quantum/port.py
heat/engine/resources/quantum/quantum.py
heat/engine/resources/quantum/router.py
heat/engine/resources/quantum/subnet.py
heat/engine/resources/route_table.py
heat/engine/resources/s3.py
heat/engine/resources/security_group.py
heat/engine/resources/subnet.py
heat/engine/resources/swift.py
heat/engine/resources/user.py
heat/engine/resources/vpc.py
heat/engine/resources/wait_condition.py

index ec596e59cb2d98348fb644942b071947de38e0ee..e2bb89a131f9b3df70e309d575df516a1c13b325 100644 (file)
@@ -74,9 +74,6 @@ class InstanceGroup(resource.Resource):
     update_allowed_keys = ('Properties',)
     update_allowed_properties = ('Size',)
 
-    def __init__(self, name, json_snippet, stack):
-        super(InstanceGroup, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         return self.resize(int(self.properties['Size']), raise_on_error=True)
 
@@ -266,10 +263,6 @@ class AutoScalingGroup(InstanceGroup, CooldownMixin):
     update_allowed_properties = ('MaxSize', 'MinSize',
                                  'Cooldown', 'DesiredCapacity',)
 
-    def __init__(self, name, json_snippet, stack):
-        super(AutoScalingGroup, self).__init__(name, json_snippet, stack)
-        # resource_id is a list of resources
-
     def handle_create(self):
 
         if self.properties['DesiredCapacity']:
@@ -382,9 +375,6 @@ class LaunchConfiguration(resource.Resource):
                                           'Schema': tags_schema}},
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(LaunchConfiguration, self).__init__(name, json_snippet, stack)
-
 
 class ScalingPolicy(resource.Resource, CooldownMixin):
     properties_schema = {
@@ -404,9 +394,6 @@ class ScalingPolicy(resource.Resource, CooldownMixin):
     update_allowed_properties = ('ScalingAdjustment', 'AdjustmentType',
                                  'Cooldown',)
 
-    def __init__(self, name, json_snippet, stack):
-        super(ScalingPolicy, self).__init__(name, json_snippet, stack)
-
     def handle_update(self, json_snippet, tmpl_diff, prop_diff):
         # If Properties has changed, update self.properties, so we
         # get the new values during any subsequent adjustment
index a5be2794fac755680bde56e35f3b3fdc91315eb9..461f8d86dbd940bcfc6fedc3f4f0b319afada86b 100644 (file)
@@ -72,9 +72,6 @@ class ElasticIpAssociation(resource.Resource):
                          'AllocationId': {'Type': 'String',
                                           'Implemented': False}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(ElasticIpAssociation, self).__init__(name, json_snippet, stack)
-
     def FnGetRefId(self):
         return unicode(self.properties.get('EIP', '0.0.0.0'))
 
index 092ab2b41ce92ba1bc92d0a5e6b862f9726a4d61..b25756a81909b152e7b2fdddba71d1e4139dbd48 100644 (file)
@@ -34,9 +34,6 @@ class InternetGateway(resource.Resource):
             'Schema': tags_schema}}
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(InternetGateway, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         client = self.quantum()
 
@@ -71,9 +68,6 @@ class VPCGatewayAttachment(resource.Resource):
             'Implemented': False}
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(VPCGatewayAttachment, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         client = self.quantum()
         gateway = self.stack[self.properties.get('InternetGatewayId')]
index 188d23d4ba94a97f830d3e3b856f928e55393ae2..6f125824f77f1f681b79edcf749eab660b897a45 100644 (file)
@@ -43,9 +43,6 @@ class NetworkInterface(resource.Resource):
             'Schema': tags_schema}}
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(NetworkInterface, self).__init__(name, json_snippet, stack)
-
     @staticmethod
     def network_id_from_subnet_id(quantumclient, subnet_id):
         subnet_info = quantumclient.show_subnet(subnet_id)
index b10de72426499aa8cf2fd77a32198fe1aa485b09..389ad58a9181c30d3731ae87895a27183c12663b 100644 (file)
@@ -64,9 +64,6 @@ class FloatingIPAssociation(quantum.QuantumResource):
                                      'Required': True},
                          'fixed_ip_address': {'Type': 'String'}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(FloatingIPAssociation, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         props = self.prepare_properties(self.properties, self.name)
 
index 2b60a76e09ac63cf3f0bad277331e1d99463f51b..4a476b9ba36c6432482a57e0c1acb47487a65529 100644 (file)
@@ -30,9 +30,6 @@ class Net(quantum.QuantumResource):
                          'admin_state_up': {'Default': True,
                                             'Type': 'Boolean'}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(Net, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         props = self.prepare_properties(
             self.properties,
index d2fe9ba7284614741d29c61ae337c9fd897ad4fd..901be105545a9837e8c37e9a938b5ede4d700623 100644 (file)
@@ -43,9 +43,6 @@ class Port(quantum.QuantumResource):
                          'device_id': {'Type': 'String'},
                          'security_groups': {'Type': 'List'}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(Port, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         props = self.prepare_properties(
             self.properties,
index 5368fa185582a043d57b01899b9b32c2d43f0250..6d60f232292b264fcef1c7eeff290de86a57af7c 100644 (file)
@@ -23,9 +23,6 @@ logger = logging.getLogger(__name__)
 
 class QuantumResource(resource.Resource):
 
-    def __init__(self, name, json_snippet, stack):
-        super(QuantumResource, self).__init__(name, json_snippet, stack)
-
     def validate(self):
         '''
         Validate any of the provided params
index 2915beea23c19834d0e8acdac5d12a34659d3a9b..d7c0498e1a3738786c5c51977ece3324c3a7bfa9 100644 (file)
@@ -31,9 +31,6 @@ class Router(quantum.QuantumResource):
                          'admin_state_up': {'Type': 'Boolean',
                                             'Default': True}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(Router, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         props = self.prepare_properties(
             self.properties,
@@ -72,9 +69,6 @@ class RouterInterface(quantum.QuantumResource):
                          'subnet_id': {'Type': 'String',
                                        'Required': True}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(RouterInterface, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         router_id = self.properties.get('router_id')
         subnet_id = self.properties.get('subnet_id')
@@ -101,9 +95,6 @@ class RouterGateway(quantum.QuantumResource):
                          'network_id': {'Type': 'String',
                                         'Required': True}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(RouterGateway, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         router_id = self.properties.get('router_id')
         network_id = self.properties.get('network_id')
index b04b9dc66bb6b42a1d16ad92bc3edf0209fb0343..24a1221ef5294620a030d3318399b6e66effe880 100644 (file)
@@ -48,9 +48,6 @@ class Subnet(quantum.QuantumResource):
                                               'Schema': allocation_schema
                                               }}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(Subnet, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         props = self.prepare_properties(
             self.properties,
index a71945061fd7d550de4d49e9e6f3d061fe82809c..b2aac1653951e5713a8581076b2e83f92034d00a 100644 (file)
@@ -39,9 +39,6 @@ class RouteTable(resource.Resource):
             'Schema': tags_schema}}
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(RouteTable, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         client = self.quantum()
         props = {'name': self.physical_resource_name()}
@@ -87,10 +84,6 @@ class SubnetRouteTableAssocation(resource.Resource):
             'Required': True}
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(SubnetRouteTableAssocation, self).__init__(
-            name, json_snippet, stack)
-
     def handle_create(self):
         client = self.quantum()
         subnet = self.stack.resource_by_refid(self.properties.get('SubnetId'))
index de2d693907f4c3de51b620dda8a48f8f7371ad12..ab7469989e916556296fcc7b9d843be0d166f52e 100644 (file)
@@ -38,9 +38,6 @@ class S3Bucket(resource.Resource):
                          'WebsiteConfiguration': {'Type': 'Map',
                                                   'Schema': website_schema}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(S3Bucket, self).__init__(name, json_snippet, stack)
-
     def validate(self):
         '''
         Validate any of the provided params
index 3478e9b85d36b1aa626237eeeb9242edcac40126..ef9cae24b662c777b101b16d024c5ca9bfc5dc04 100644 (file)
@@ -28,9 +28,6 @@ class SecurityGroup(resource.Resource):
                          'SecurityGroupIngress': {'Type': 'List'},
                          'SecurityGroupEgress': {'Type': 'List'}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(SecurityGroup, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         if self.properties['VpcId'] and clients.quantumclient is not None:
             self._handle_create_quantum()
index 2e92c5b97cd98ab545e2a43c1412895384528782..eed95b61a979a122f7330442254e04f31bbd8d3e 100644 (file)
@@ -41,9 +41,6 @@ class Subnet(resource.Resource):
             'Schema': tags_schema}}
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(Subnet, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         client = self.quantum()
         # TODO(sbaker) Verify that this CidrBlock is within the vpc CidrBlock
index aee482bed7f7a34287206ae8cc7d0c9f031b92eb..be16023b73df28cffa1be68bd4a2557b8fff7b6f 100644 (file)
@@ -31,9 +31,6 @@ class SwiftContainer(resource.Resource):
         'X-Container-Write': {'Type': 'String'},
         'X-Container-Meta': {'Type': 'Map', 'Default': {}}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(SwiftContainer, self).__init__(name, json_snippet, stack)
-
     def validate(self):
         '''
         Validate any of the provided params
index ea591c1f2c19284dce23c9bd4955961160982dab..80059e1cbf9a555c2a768a79bc296b827f14962b 100644 (file)
@@ -37,9 +37,6 @@ class User(resource.Resource):
                                           }},
                          'Policies': {'Type': 'List'}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(User, self).__init__(name, json_snippet, stack)
-
     def _validate_policies(self, policies):
         for policy in (policies or []):
             # When we support AWS IAM style policies, we will have to accept
@@ -222,9 +219,6 @@ class AccessPolicy(resource.Resource):
     properties_schema = {'AllowedResources': {'Type': 'List',
                                               'Required': True}}
 
-    def __init__(self, name, json_snippet, stack):
-        super(AccessPolicy, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         resources = self.properties['AllowedResources']
         # All of the provided resource names must exist in this stack
index d0702d287b2d347fa8201ad06d85976a658351c5..f9a42b9dd29aca2d0b4454f86d5ee0d54c672ddf 100644 (file)
@@ -40,9 +40,6 @@ class VPC(resource.Resource):
             'Schema': tags_schema}}
     }
 
-    def __init__(self, name, json_snippet, stack):
-        super(VPC, self).__init__(name, json_snippet, stack)
-
     def handle_create(self):
         client = self.quantum()
         props = {'name': self.physical_resource_name()}
index 5b7395ae598303c16659f90e94795345bcefbbcc..035a69b7295ce2b3d637ded7a794efbb4d2cd7b1 100644 (file)
@@ -41,9 +41,6 @@ class WaitConditionHandle(resource.Resource):
     '''
     properties_schema = {}
 
-    def __init__(self, name, json_snippet, stack):
-        super(WaitConditionHandle, self).__init__(name, json_snippet, stack)
-
     def _sign_url(self, credentials, path):
         """
         Create properly formatted and pre-signed URL using supplied credentials