Exemplo n.º 1
0
    def test_credentials(self):
        boto_client = mock.Mock()
        boto_mock = mock.Mock(return_value=boto_client)
        ctx_node = mock.Mock()
        ctx_node.properties = {
            AWS_CONFIG_PROPERTY: {
                'region_name': 'wr-ongvalu-e'
            }
        }
        with mock.patch("cloudify_aws.ec2.Boto3Connection", boto_mock):
            with self.assertRaises(NonRecoverableError):
                EC2Base(ctx_node)

            ctx_node.properties[AWS_CONFIG_PROPERTY] = {
                'region_name': 'aq-testzone-1'
            }
            EC2Base(ctx_node)
            boto_mock.assert_called_with(ctx_node)
            boto_client.client.assert_called_with('ec2')
Exemplo n.º 2
0
 def __init__(self, ctx_node, resource_id=None, client=None, logger=None):
     EC2Base.__init__(self, ctx_node, resource_id, client, logger)
     self.type_name = RESOURCE_TYPE
 def __init__(self, ctx_node, resource_id=None, client=None, logger=None):
     EC2Base.__init__(self, ctx_node, resource_id, client, logger)
     self.type_name = RESOURCE_TYPE
Exemplo n.º 4
0
 def __init__(self, ctx_node, resource_id=None, client=None, logger=None):
     EC2Base.__init__(self, ctx_node, resource_id, client, logger)
     self.type_name = RESOURCE_TYPE
     self.describe_vpc_peering_filter = {}
 def setUp(self):
     super(TestEC2Base, self).setUp()
     self.base = EC2Base("ctx_node", resource_id=True,
                         client=True, logger=None)
Exemplo n.º 6
0
 def __init__(self, ctx_node, resource_id=None, client=None, logger=None):
     EC2Base.__init__(self, ctx_node, resource_id, client, logger)
     self.type_name = RESOURCE_TYPE
     self.describe_image_filters = {}