示例#1
0
文件: subnet.py 项目: AlexeyMK/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.state = None
     self.cidr_block = None
     self.available_ip_address_count = 0
     self.availability_zone = None
示例#2
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.dns_name = None
     self.public_dns_name = None
     self.private_dns_name = None
     self.state = None
     self.state_code = None
     self.key_name = None
     self.shutdown_state = None
     self.previous_state = None
     self.instance_type = None
     self.instance_class = None
     self.launch_time = None
     self.image_id = None
     self.placement = None
     self.kernel = None
     self.ramdisk = None
     self.product_codes = ProductCodes()
     self.ami_launch_index = None
     self.monitored = False
     self.instance_class = None
     self.spot_instance_request_id = None
     self.subnet_id = None
     self.vpc_id = None
     self.private_ip_address = None
     self.ip_address = None
     self.requester_id = None
     self._in_monitoring_element = False
     self.persistent = False
     self.root_device_name = None
     self.root_device_type = None
     self.block_device_mapping = None
     self.state_reason = None
     self.group_name = None
示例#3
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.dns_name = None
     self.public_dns_name = None
     self.private_dns_name = None
     self.state = None
     self.state_code = None
     self.key_name = None
     self.shutdown_state = None
     self.previous_state = None
     self.instance_type = None
     self.instance_class = None
     self.launch_time = None
     self.image_id = None
     self.placement = None
     self.kernel = None
     self.ramdisk = None
     self.product_codes = ProductCodes()
     self.ami_launch_index = None
     self.monitored = False
     self.instance_class = None
     self.spot_instance_request_id = None
     self.subnet_id = None
     self.vpc_id = None
     self.private_ip_address = None
     self.ip_address = None
     self.requester_id = None
     self._in_monitoring_element = False
     self.persistent = False
     self.root_device_name = None
     self.root_device_type = None
     self.block_device_mapping = None
     self.state_reason = None
     self.group_name = None
示例#4
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.state = None
     self.cidr_block = None
     self.available_ip_address_count = 0
     self.availability_zone = None
示例#5
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.type = None
     self.state = None
     self.ip_address = None
     self.bgp_asn = None
示例#6
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.type = None
     self.state = None
     self.availability_zone = None
     self.attachments = []
示例#7
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.type = None
     self.state = None
     self.ip_address = None
     self.bgp_asn = None
示例#8
0
文件: vpngateway.py 项目: 2mind/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.type = None
     self.state = None
     self.availability_zone = None
     self.attachments = []
示例#9
0
 def __init__(self, connection=None, owner_id=None,
              name=None, description=None, id=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = id
     self.owner_id = owner_id
     self.name = name
     self.description = description
     self.rules = []
示例#10
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.create_time = None
     self.status = None
     self.size = None
     self.snapshot_id = None
     self.attach_data = None
     self.zone = None
示例#11
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.create_time = None
     self.status = None
     self.size = None
     self.snapshot_id = None
     self.attach_data = None
     self.zone = None
示例#12
0
 def __init__(self, connection=None, owner_id=None, name=None, description=None, id=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = id
     self.owner_id = owner_id
     self.name = name
     self.description = description
     self.vpc_id = None
     self.rules = IPPermissionsList()
     self.rules_egress = IPPermissionsList()
示例#13
0
文件: subnet.py 项目: NightBlues/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.vpc_id = None
     self.state = None
     self.cidr_block = None
     self.available_ip_address_count = 0
     self.availability_zone = None
     self.rules = IPPermissionsList()
示例#14
0
文件: subnet.py 项目: raorn/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.vpc_id = None
     self.state = None
     self.cidr_block = None
     self.available_ip_address_count = 0
     self.availability_zone = None
     self.rules = IPPermissionsList()
示例#15
0
 def __init__(self, connection=None, owner_id=None,
              name=None, description=None, id=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = id
     self.owner_id = owner_id
     self.name = name
     self.description = description
     self.vpc_id = None
     self.rules = IPPermissionsList()
     self.rules_egress = IPPermissionsList()
示例#16
0
文件: snapshot.py 项目: AlexeyMK/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.volume_id = None
     self.status = None
     self.progress = None
     self.start_time = None
     self.owner_id = None
     self.volume_size = None
     self.description = None
示例#17
0
文件: snapshot.py 项目: vikalp/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.volume_id = None
     self.status = None
     self.progress = None
     self.start_time = None
     self.owner_id = None
     self.volume_size = None
     self.description = None
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.state = None
     self.customer_gateway_configuration = None
     self.type = None
     self.customer_gateway_id = None
     self.vpn_gateway_id = None
     self.tunnels = []
     self.options = None
     self.static_routes = []
示例#19
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.state = None
     self.customer_gateway_configuration = None
     self.type = None
     self.customer_gateway_id = None
     self.vpn_gateway_id = None
     self.tunnels = []
     self.options = None
     self.static_routes = []
示例#20
0
文件: volume.py 项目: raorn/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.create_time = None
     self.status = None
     self.size = None
     self.snapshot_id = None
     self.attach_data = None
     self.zone = None
     self.tier_type = None
     self.tier_name = None
     self.tier_replication = None
     self.size_in_bytes = None
     self.description = None
示例#21
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.create_time = None
     self.status = None
     self.size = None
     self.snapshot_id = None
     self.attach_data = None
     self.zone = None
     self.tier_type = None
     self.tier_name = None
     self.tier_replication = None
     self.size_in_bytes = None
     self.description = None
示例#22
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.subnet_id = None
     self.vpc_id = None
     self.availability_zone = None
     self.description = None
     self.owner_id = None
     self.requester_managed = False
     self.status = None
     self.mac_address = None
     self.private_ip_address = None
     self.source_dest_check = None
     self.groups = []
     self.attachment = None
示例#23
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.subnet_id = None
     self.vpc_id = None
     self.availability_zone = None
     self.description = None
     self.owner_id = None
     self.requester_managed = False
     self.status = None
     self.mac_address = None
     self.private_ip_address = None
     self.source_dest_check = None
     self.groups = []
     self.attachment = None
示例#24
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.price = None
     self.type = None
     self.state = None
     self.fault = None
     self.valid_from = None
     self.valid_until = None
     self.launch_group = None
     self.product_description = None
     self.availability_zone_group = None
     self.create_time = None
     self.launch_specification = None
     self.instance_id = None
示例#25
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.price = None
     self.type = None
     self.state = None
     self.fault = None
     self.valid_from = None
     self.valid_until = None
     self.launch_group = None
     self.product_description = None
     self.availability_zone_group = None
     self.create_time = None
     self.launch_specification = None
     self.instance_id = None
示例#26
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'dhcpConfigurationSet':
         self.options = DhcpConfigSet()
         return self.options
示例#27
0
文件: instance.py 项目: 2uinc/boto
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'monitoring':
         self._in_monitoring_element = True
     elif name == 'blockDeviceMapping':
         self.block_device_mapping = BlockDeviceMapping()
         return self.block_device_mapping
     elif name == 'productCodes':
         return self.product_codes
     elif name == 'stateReason':
         self.state_reason = SubParse('stateReason')
         return self.state_reason
     elif name == 'groupSet':
         self.groups = ResultSet([('item', Group)])
         return self.groups
     elif name == "eventsSet":
         self.eventsSet = SubParse('eventsSet')
         return self.eventsSet
     elif name == 'networkInterfaceSet':
         self.interfaces = ResultSet([('item', NetworkInterface)])
     elif name == 'iamInstanceProfile':
         self.instance_profile = SubParse('iamInstanceProfile')
         return self.instance_profile
     return None
示例#28
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'dhcpConfigurationSet':
         self.options = DhcpConfigSet()
         return self.options
示例#29
0
    def test_remove_tag_empty_value(self):
        self.set_http_response(status_code=200)
        taggedEC2Object = TaggedEC2Object(self.service_connection)
        taggedEC2Object.id = "i-abcd1234"
        taggedEC2Object.tags["key1"] = "value1"
        taggedEC2Object.tags["key2"] = "value2"

        taggedEC2Object.remove_tag("key1", "")

        self.assert_request_parameters(
            {
                'ResourceId.1': 'i-abcd1234',
                'Action': 'DeleteTags',
                'Tag.1.Key': 'key1',
                'Tag.1.Value': ''
            },
            ignore_params_values=[
                'AWSAccessKeyId', 'SignatureMethod', 'SignatureVersion',
                'Timestamp', 'Version'
            ])

        self.assertEqual(taggedEC2Object.tags, {
            "key1": "value1",
            "key2": "value2"
        })
示例#30
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'monitoring':
         self._in_monitoring_element = True
     elif name == 'blockDeviceMapping':
         self.block_device_mapping = BlockDeviceMapping()
         return self.block_device_mapping
     elif name == 'productCodes':
         return self.product_codes
     elif name == 'stateReason':
         self.state_reason = SubParse('stateReason')
         return self.state_reason
     elif name == 'groupSet':
         self.groups = ResultSet([('item', Group)])
         return self.groups
     elif name == "eventsSet":
         self.eventsSet = SubParse('eventsSet')
         return self.eventsSet
     elif name == 'networkInterfaceSet':
         self.interfaces = ResultSet([('item', NetworkInterface)])
     elif name == 'iamInstanceProfile':
         self.instance_profile = SubParse('iamInstanceProfile')
         return self.instance_profile
     return None
示例#31
0
    def test_add_tags(self):
        self.set_http_response(status_code=200)
        taggedEC2Object = TaggedEC2Object(self.service_connection)
        taggedEC2Object.id = "i-abcd1234"
        taggedEC2Object.tags["already_present_key"] = "already_present_value"

        taggedEC2Object.add_tags({"key1": "value1", "key2": "value2"})

        self.assert_request_parameters(
            {
                'ResourceId.1': 'i-abcd1234',
                'Action': 'CreateTags',
                'Tag.1.Key': 'key1',
                'Tag.1.Value': 'value1',
                'Tag.2.Key': 'key2',
                'Tag.2.Value': 'value2'
            },
            ignore_params_values=[
                'AWSAccessKeyId', 'SignatureMethod', 'SignatureVersion',
                'Timestamp', 'Version'
            ])

        self.assertEqual(
            taggedEC2Object.tags, {
                "already_present_key": "already_present_value",
                "key1": "value1",
                "key2": "value2"
            })
示例#32
0
文件: vpngateway.py 项目: 2mind/boto
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'item':
         att = Attachment()
         self.attachments.append(att)
         return att
示例#33
0
文件: subnet.py 项目: raorn/boto
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'ipPermissions':
         return self.rules
     else:
         return None
示例#34
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'item':
         att = Attachment()
         self.attachments.append(att)
         return att
示例#35
0
文件: subnet.py 项目: NightBlues/boto
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'ipPermissions':
         return self.rules
     else:
         return None
示例#36
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.dns_name = None
     self.public_dns_name = None
     self.private_dns_name = None
     self.key_name = None
     self.instance_type = None
     self.launch_time = None
     self.image_id = None
     self.kernel = None
     self.ramdisk = None
     self.product_codes = ProductCodes()
     self.ami_launch_index = None
     self.monitored = False
     self.monitoring_state = None
     self.spot_instance_request_id = None
     self.subnet_id = None
     self.vpc_id = None
     self.private_ip_address = None
     self.ip_address = None
     self.requester_id = None
     self._in_monitoring_element = False
     self.persistent = False
     self.root_device_name = None
     self.root_device_type = None
     self.block_device_mapping = None
     self.state_reason = None
     self.group_name = None
     self.client_token = None
     self.eventsSet = None
     self.groups = []
     self.platform = None
     self.interfaces = []
     self.hypervisor = None
     self.virtualization_type = None
     self.architecture = None
     self.instance_profile = None
     self._previous_state = None
     self._state = InstanceState()
     self._placement = InstancePlacement()
     self.image_description = None
     self.description = None
     self.high_availability = None
     self.remote_console = None
示例#37
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.dns_name = None
     self.public_dns_name = None
     self.private_dns_name = None
     self.key_name = None
     self.instance_type = None
     self.launch_time = None
     self.image_id = None
     self.kernel = None
     self.ramdisk = None
     self.product_codes = ProductCodes()
     self.ami_launch_index = None
     self.monitored = False
     self.monitoring_state = None
     self.spot_instance_request_id = None
     self.subnet_id = None
     self.vpc_id = None
     self.private_ip_address = None
     self.ip_address = None
     self.requester_id = None
     self._in_monitoring_element = False
     self.persistent = False
     self.root_device_name = None
     self.root_device_type = None
     self.block_device_mapping = None
     self.state_reason = None
     self.group_name = None
     self.client_token = None
     self.eventsSet = None
     self.groups = []
     self.platform = None
     self.interfaces = []
     self.hypervisor = None
     self.virtualization_type = None
     self.architecture = None
     self.instance_profile = None
     self._previous_state = None
     self._state = InstanceState()
     self._placement = InstancePlacement()
     self.image_description = None
     self.description = None
     self.high_availability = None
     self.remote_console = None
示例#38
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'item':
         self.rules.append(IPPermissions(self))
         return self.rules[-1]
     else:
         return None
示例#39
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.location = None
     self.state = None
     self.ownerId = None
     self.owner_alias = None
     self.is_public = False
     self.architecture = None
     self.platform = None
     self.type = None
     self.kernel_id = None
     self.ramdisk_id = None
     self.name = None
     self.description = None
     self.product_codes = ProductCodes()
     self.block_device_mapping = None
     self.root_device_type = None
     self.root_device_name = None
示例#40
0
文件: vpc.py 项目: DHLabs/keep_isn
    def __init__(self, connection=None):
        """
        Represents a VPC.

        :ivar id: The unique ID of the VPC.
        :ivar dhcp_options_id: The ID of the set of DHCP options you've associated with the VPC
                                (or default if the default options are associated with the VPC).
        :ivar state: The current state of the VPC.
        :ivar cidr_block: The CIDR block for the VPC.
        :ivar is_default: Indicates whether the VPC is the default VPC.
        :ivar instance_tenancy: The allowed tenancy of instances launched into the VPC.
        """
        TaggedEC2Object.__init__(self, connection)
        self.id = None
        self.dhcp_options_id = None
        self.state = None
        self.cidr_block = None
        self.is_default = None
        self.instance_tenancy = None
示例#41
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.location = None
     self.state = None
     self.ownerId = None
     self.owner_alias = None
     self.is_public = False
     self.architecture = None
     self.platform = None
     self.type = None
     self.kernel_id = None
     self.ramdisk_id = None
     self.name = None
     self.description = None
     self.product_codes = ProductCodes()
     self.block_device_mapping = None
     self.root_device_type = None
     self.root_device_name = None
示例#42
0
文件: vpc.py 项目: antleocar/testing
    def __init__(self, connection=None):
        """
        Represents a VPC.

        :ivar id: The unique ID of the VPC.
        :ivar dhcp_options_id: The ID of the set of DHCP options you've associated with the VPC
                                (or default if the default options are associated with the VPC).
        :ivar state: The current state of the VPC.
        :ivar cidr_block: The CIDR block for the VPC.
        :ivar is_default: Indicates whether the VPC is the default VPC.
        :ivar instance_tenancy: The allowed tenancy of instances launched into the VPC.
        """
        TaggedEC2Object.__init__(self, connection)
        self.id = None
        self.dhcp_options_id = None
        self.state = None
        self.cidr_block = None
        self.is_default = None
        self.instance_tenancy = None
示例#43
0
文件: image.py 项目: 0t3dWCE/boto
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'blockDeviceMapping':
         self.block_device_mapping = BlockDeviceMapping()
         return self.block_device_mapping
     elif name == 'productCodes':
         return self.product_codes
     else:
         return None
示例#44
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'blockDeviceMapping':
         self.block_device_mapping = BlockDeviceMapping()
         return self.block_device_mapping
     elif name == 'productCodes':
         return self.product_codes
     else:
         return None
示例#45
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'attachmentSet':
         self.attach_data = AttachmentSet()
         return self.attach_data
     elif name == 'tagSet':
         self.tags = boto.resultset.ResultSet([('item', Tag)])
         return self.tags
     else:
         return None
示例#46
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'groupSet':
         self.groups = ResultSet([('item', Group)])
         return self.groups
     elif name == 'attachment':
         self.attachment = Attachment()
         return self.attachment
     else:
         return None
示例#47
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'groupSet':
         self.groups = ResultSet([('item', Group)])
         return self.groups
     elif name == 'attachment':
         self.attachment = Attachment()
         return self.attachment
     else:
         return None
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'launchSpecification':
         self.launch_specification = LaunchSpecification(connection)
         return self.launch_specification
     elif name == 'fault':
         self.fault = SpotInstanceStateFault()
         return self.fault
     else:
         return None
示例#49
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'attachmentSet':
         self.attach_data = AttachmentSet()
         return self.attach_data
     elif name == 'tagSet':
         self.tags = ResultSet([('item', Tag)])
         return self.tags
     else:
         return None
示例#50
0
文件: volume.py 项目: uceo/uceo-2015
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == "attachmentSet":
         self.attach_data = AttachmentSet()
         return self.attach_data
     elif name == "tagSet":
         self.tags = ResultSet([("item", Tag)])
         return self.tags
     else:
         return None
示例#51
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.location = None
     self.state = None
     self.ownerId = None  # for backwards compatibility
     self.owner_id = None
     self.owner_alias = None
     self.is_public = False
     self.architecture = None
     self.platform = None
     self.type = None
     self.kernel_id = None
     self.ramdisk_id = None
     self.name = None
     self.description = None
     self.product_codes = ProductCodes()
     self.block_device_mapping = None
     self.root_device_type = None
     self.root_device_name = None
     self.virtualization_type = None
     self.hypervisor = None
     self.instance_lifecycle = None
示例#52
0
文件: image.py 项目: NorthIsUp/boto
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.location = None
     self.state = None
     self.ownerId = None  # for backwards compatibility
     self.owner_id = None
     self.owner_alias = None
     self.is_public = False
     self.architecture = None
     self.platform = None
     self.type = None
     self.kernel_id = None
     self.ramdisk_id = None
     self.name = None
     self.description = None
     self.product_codes = ProductCodes()
     self.block_device_mapping = None
     self.root_device_type = None
     self.root_device_name = None
     self.virtualization_type = None
     self.hypervisor = None
     self.instance_lifecycle = None
示例#53
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'monitoring':
         self._in_monitoring_element = True
     elif name == 'blockDeviceMapping':
         self.block_device_mapping = BlockDeviceMapping()
         return self.block_device_mapping
     elif name == 'productCodes':
         return self.product_codes
     elif name == 'stateReason':
         self.state_reason = StateReason()
         return self.state_reason
     return None
示例#54
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == 'monitoring':
         self._in_monitoring_element = True
     elif name == 'blockDeviceMapping':
         self.block_device_mapping = BlockDeviceMapping()
         return self.block_device_mapping
     elif name == 'productCodes':
         return self.product_codes
     elif name == 'stateReason':
         self.state_reason = StateReason()
         return self.state_reason
     return None
示例#55
0
 def startElement(self, name, attrs, connection):
     retval = TaggedEC2Object.startElement(self, name, attrs, connection)
     if retval is not None:
         return retval
     if name == "monitoring":
         self._in_monitoring_element = True
     elif name == "blockDeviceMapping":
         self.block_device_mapping = BlockDeviceMapping()
         return self.block_device_mapping
     elif name == "productCodes":
         return self.product_codes
     elif name == "stateReason":
         self.state_reason = StateReason()
         return self.state_reason
     elif name == "groupSet":
         self.groups = ResultSet([("item", Group)])
         return self.groups
     return None
示例#56
0
 def test_tag_resource_raises_error(self):
     """ Tests that when add_tags fails
         tag_resource raises the right error.
     """
     ctx = self.get_mock_ctx('test_tag_resource_raises_error')
     current_ctx.set(ctx=ctx)
     resource = AwsBaseNode('root', [], resource_states=[])
     ctx.node.properties['name'] = 'root'
     test_resource = TaggedEC2Object()
     tags = []
     with mock.patch(
             'boto.ec2.ec2object.TaggedEC2Object.add_tags') \
             as mock_add_tags:
         mock_add_tags.side_effect = EC2ResponseError(
                 mock.Mock(return_value={'status': 404}),
                 'error')
         ex = self.assertRaises(
                 NonRecoverableError,
                 resource._tag_resource,
                 test_resource,
                 tags)
         self.assertIn(
                 'unable to tag resource name', ex.message)
示例#57
0
 def __init__(self, connection=None):
     TaggedEC2Object.__init__(self, connection)
     self.id = None
     self.options = None