get rid of no-op __init__ methods
There were a lot of __init__ methods that simply called their super() with nothing else. Change-Id: I6771912adf81f145d09f950c57d219bd77789822
This commit is contained in:
parent
23768d8080
commit
760e1b151a
|
@ -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
|
||||
|
|
|
@ -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'))
|
||||
|
||||
|
|
|
@ -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')]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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'))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue