text:
import json
import mock
import os

from oslo.config import cfg

from heat.common import exception as heat_exception
from heat.common import identifier
from heat.common import policy
from heat.openstack.common import rpc
from heat.common.wsgi import Request
from heat.rpc import api as rpc_api
from heat.api.aws import exception
import heat.api.cfn.v1.stacks as stacks
from heat.tests.common import HeatTestCase
from heat.tests import utils

policy_path = os.path.dirname(os.path.realpath(__file__)) + "/policy/"

class CfnStackControllerTest(HeatTestCase):
    '''
    Tests the API class which acts as the WSGI controller,
    the endpoint processing API requests after they are routed
    '''

    def setUp(self):
        super(CfnStackControllerTest, self).setUp()

        opts = [
            cfg.StrOpt('config_dir', default=policy_path),
            cfg.StrOpt('config_file', default='foo'),
            cfg.StrOpt('project', default='heat'),
        ]
        cfg.CONF.register_opts(opts)
        cfg.CONF.set_default('host', 'host')
        self.topic = rpc_api.ENGINE_TOPIC
        self.api_version = '1.0'
        self.template = {u'AWSTemplateFormatVersion': u'2010-09-09',
                         u'Foo': u'bar'}

        # Create WSGI controller instance
        class DummyConfig():
            bind_port = 8000
        cfgopts = DummyConfig()
        self.controller = stacks.StackController(options=cfgopts)
        self.controller.policy.enforcer.policy_path = (policy_path +
                                                       'deny_stack_user.json')
        self.addCleanup(self.m.VerifyAll)

    def _dummy_GET_request(self, params={}):
        # Mangle the params dict into a query string
        qs = "&".join(["=".join([k, str(params[k])]) for k in params])
        environ = {'REQUEST_METHOD': 'GET', 'QUERY_STRING': qs}
        req = Request(environ)
        req.context = utils.dummy_context()
        return req

    def _stub_enforce(self, req, action, allowed=True):
        self.m.StubOutWithMock(policy.Enforcer, 'enforce')
        if allowed:
            policy.Enforcer.enforce(req.context, action
                                    ).AndReturn(True)
        else:
            policy.Enforcer.enforce(req.context, action
                                    ).AndRaise(heat_exception.Forbidden)
        self.m.ReplayAll()

    # The tests
    def test_stackid_addprefix(self):
        self.m.ReplayAll()

        response = self.controller._id_format({
            'StackName': 'Foo',
            'StackId': {
                u'tenant': u't',
                u'stack_name': u'Foo',
                u'stack_id': u'123',
                u'path': u''
            }
        })
        expected = {'StackName': 'Foo',
                    'StackId': 'arn:openstack:heat::t:stacks/Foo/123'}
        self.assertEqual(expected, response)

    def test_enforce_ok(self):
        params = {'Action': 'ListStacks'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ListStacks')
        response = self.controller._enforce(dummy_req, 'ListStacks')
        self.assertIsNone(response)

    def test_enforce_denied(self):
        self.m.ReplayAll()
        params = {'Action': 'ListStacks'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ListStacks', False)
        self.assertRaises(exception.HeatAccessDeniedError,
                          self.controller._enforce, dummy_req, 'ListStacks')

    def test_enforce_ise(self):
        params = {'Action': 'ListStacks'}
        dummy_req = self._dummy_GET_request(params)
        dummy_req.context.roles = ['heat_stack_user']

        self.m.StubOutWithMock(policy.Enforcer, 'enforce')
        policy.Enforcer.enforce(dummy_req.context, 'ListStacks'
                                ).AndRaise(AttributeError)
        self.m.ReplayAll()

        self.assertRaises(exception.HeatInternalFailureError,
                          self.controller._enforce, dummy_req, 'ListStacks')

    @mock.patch.object(rpc, 'call')
    def test_list(self, mock_call):
        # Format a dummy GET request to pass into the WSGI handler
        params = {'Action': 'ListStacks'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ListStacks')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = [{u'stack_identity': {u'tenant': u't',
                                            u'stack_name': u'wordpress',
                                            u'stack_id': u'1',
                                            u'path': u''},
                        u'updated_time': u'2012-07-09T09:13:11Z',
                        u'template_description': u'blah',
                        u'stack_status_reason': u'Stack successfully created',
                        u'creation_time': u'2012-07-09T09:12:45Z',
                        u'stack_name': u'wordpress',
                        u'stack_action': u'CREATE',
                        u'stack_status': u'COMPLETE'}]
        mock_call.return_value = engine_resp

        # Call the list controller function and compare the response
        result = self.controller.list(dummy_req)
        expected = {'ListStacksResponse': {'ListStacksResult':
                    {'StackSummaries':
                     [{u'StackId': u'arn:openstack:heat::t:stacks/wordpress/1',
                       u'LastUpdatedTime': u'2012-07-09T09:13:11Z',
                       u'TemplateDescription': u'blah',
                       u'StackStatusReason': u'Stack successfully created',
                       u'CreationTime': u'2012-07-09T09:12:45Z',
                       u'StackName': u'wordpress',
                       u'StackStatus': u'CREATE_COMPLETE'}]}}}
        self.assertEqual(expected, result)
        default_args = {'limit': None, 'sort_keys': None, 'marker': None,
                        'sort_dir': None, 'filters': None}
        mock_call.assert_called_once_with(dummy_req.context, self.topic,
                                          {'namespace': None,
                                           'method': 'list_stacks',
                                           'args': default_args,
                                           'version': self.api_version},
                                          None)

    @mock.patch.object(rpc, 'call')
    def test_list_rmt_aterr(self, mock_call):
        params = {'Action': 'ListStacks'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ListStacks')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        mock_call.side_effect = AttributeError

        # Call the list controller function and compare the response
        result = self.controller.list(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)
        mock_call.assert_called_once_with(dummy_req.context, self.topic,
                                          {'namespace': None,
                                           'method': 'list_stacks',
                                           'args': mock.ANY,
                                           'version': self.api_version},
                                          None)

    @mock.patch.object(rpc, 'call')
    def test_list_rmt_interr(self, mock_call):
        params = {'Action': 'ListStacks'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ListStacks')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        mock_call.side_effect = Exception()

        # Call the list controller function and compare the response
        result = self.controller.list(dummy_req)
        self.assertIsInstance(result, exception.HeatInternalFailureError)
        mock_call.assert_called_once_with(dummy_req.context, self.topic,
                                          {'namespace': None,
                                           'method': 'list_stacks',
                                           'args': mock.ANY,
                                           'version': self.api_version},
                                          None)

    def test_describe(self):
        # Format a dummy GET request to pass into the WSGI handler
        stack_name = u"wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStacks', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStacks')

        # Stub out the RPC call to the engine with a pre-canned response
        # Note the engine returns a load of keys we don't actually use
        # so this is a subset of the real response format
        engine_resp = [{u'stack_identity':
                        {u'tenant': u't',
                         u'stack_name': u'wordpress',
                         u'stack_id': u'6',
                         u'path': u''},
                        u'updated_time': u'2012-07-09T09:13:11Z',
                        u'parameters': {u'DBUsername': u'admin',
                                        u'LinuxDistribution': u'F17',
                                        u'InstanceType': u'm1.large',
                                        u'DBRootPassword': u'admin',
                                        u'DBPassword': u'admin',
                                        u'DBName': u'wordpress'},
                       u'outputs':
                       [{u'output_key': u'WebsiteURL',
                         u'description': u'URL for Wordpress wiki',
                         u'output_value': u'http://10.0.0.8/wordpress'}],
                       u'stack_status_reason': u'Stack successfully created',
                       u'creation_time': u'2012-07-09T09:12:45Z',
                       u'stack_name': u'wordpress',
                       u'notification_topics': [],
                       u'stack_action': u'CREATE',
                       u'stack_status': u'COMPLETE',
                       u'description': u'blah',
                       u'disable_rollback': 'true',
                       u'timeout_mins':60,
                       u'capabilities':[]}]

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'show_stack',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        # Call the list controller function and compare the response
        response = self.controller.describe(dummy_req)

        expected = {'DescribeStacksResponse':
                    {'DescribeStacksResult':
                     {'Stacks':
                      [{'StackId': u'arn:openstack:heat::t:stacks/wordpress/6',
                        'StackStatusReason': u'Stack successfully created',
                        'Description': u'blah',
                        'Parameters':
                        [{'ParameterValue': u'admin',
                          'ParameterKey': u'DBUsername'},
                         {'ParameterValue': u'F17',
                          'ParameterKey': u'LinuxDistribution'},
                         {'ParameterValue': u'm1.large',
                          'ParameterKey': u'InstanceType'},
                         {'ParameterValue': u'admin',
                          'ParameterKey': u'DBRootPassword'},
                         {'ParameterValue': u'admin',
                          'ParameterKey': u'DBPassword'},
                         {'ParameterValue': u'wordpress',
                          'ParameterKey': u'DBName'}],
                        'Outputs':
                        [{'OutputKey': u'WebsiteURL',
                          'OutputValue': u'http://10.0.0.8/wordpress',
                          'Description': u'URL for Wordpress wiki'}],
                        'TimeoutInMinutes': 60,
                        'CreationTime': u'2012-07-09T09:12:45Z',
                        'Capabilities': [],
                        'StackName': u'wordpress',
                        'NotificationARNs': [],
                        'StackStatus': u'CREATE_COMPLETE',
                        'DisableRollback': 'true',
                        'LastUpdatedTime': u'2012-07-09T09:13:11Z'}]}}}

        self.assertEqual(expected, response)

    def test_describe_arn(self):
        # Format a dummy GET request to pass into the WSGI handler
        stack_name = u"wordpress"
        stack_identifier = identifier.HeatIdentifier('t', stack_name, '6')
        identity = dict(stack_identifier)
        params = {'Action': 'DescribeStacks',
                  'StackName': stack_identifier.arn()}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStacks')

        # Stub out the RPC call to the engine with a pre-canned response
        # Note the engine returns a load of keys we don't actually use
        # so this is a subset of the real response format
        engine_resp = [{u'stack_identity': {u'tenant': u't',
                                            u'stack_name': u'wordpress',
                                            u'stack_id': u'6',
                                            u'path': u''},
                        u'updated_time': u'2012-07-09T09:13:11Z',
                        u'parameters': {u'DBUsername': u'admin',
                                        u'LinuxDistribution': u'F17',
                                        u'InstanceType': u'm1.large',
                                        u'DBRootPassword': u'admin',
                                        u'DBPassword': u'admin',
                                        u'DBName': u'wordpress'},
                        u'outputs':
                        [{u'output_key': u'WebsiteURL',
                          u'description': u'URL for Wordpress wiki',
                          u'output_value': u'http://10.0.0.8/wordpress'}],
                        u'stack_status_reason': u'Stack successfully created',
                        u'creation_time': u'2012-07-09T09:12:45Z',
                        u'stack_name': u'wordpress',
                        u'notification_topics': [],
                        u'stack_action': u'CREATE',
                        u'stack_status': u'COMPLETE',
                        u'description': u'blah',
                        u'disable_rollback': 'true',
                        u'timeout_mins':60,
                        u'capabilities':[]}]

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'show_stack',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        # Call the list controller function and compare the response
        response = self.controller.describe(dummy_req)

        expected = {'DescribeStacksResponse':
                    {'DescribeStacksResult':
                     {'Stacks':
                      [{'StackId': u'arn:openstack:heat::t:stacks/wordpress/6',
                        'StackStatusReason': u'Stack successfully created',
                        'Description': u'blah',
                        'Parameters':
                        [{'ParameterValue': u'admin',
                          'ParameterKey': u'DBUsername'},
                         {'ParameterValue': u'F17',
                          'ParameterKey': u'LinuxDistribution'},
                         {'ParameterValue': u'm1.large',
                          'ParameterKey': u'InstanceType'},
                         {'ParameterValue': u'admin',
                          'ParameterKey': u'DBRootPassword'},
                         {'ParameterValue': u'admin',
                          'ParameterKey': u'DBPassword'},
                         {'ParameterValue': u'wordpress',
                          'ParameterKey': u'DBName'}],
                        'Outputs':
                        [{'OutputKey': u'WebsiteURL',
                          'OutputValue': u'http://10.0.0.8/wordpress',
                          'Description': u'URL for Wordpress wiki'}],
                        'TimeoutInMinutes': 60,
                        'CreationTime': u'2012-07-09T09:12:45Z',
                        'Capabilities': [],
                        'StackName': u'wordpress',
                        'NotificationARNs': [],
                        'StackStatus': u'CREATE_COMPLETE',
                        'DisableRollback': 'true',
                        'LastUpdatedTime': u'2012-07-09T09:13:11Z'}]}}}

        self.assertEqual(expected, response)

    def test_describe_arn_invalidtenant(self):
        # Format a dummy GET request to pass into the WSGI handler
        stack_name = u"wordpress"
        stack_identifier = identifier.HeatIdentifier('wibble', stack_name, '6')
        identity = dict(stack_identifier)
        params = {'Action': 'DescribeStacks',
                  'StackName': stack_identifier.arn()}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStacks')

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'show_stack',
                  'args': {'stack_identity': identity},
                  'version': self.api_version},
                 None).AndRaise(heat_exception.InvalidTenant(target='test',
                                                             actual='test'))

        self.m.ReplayAll()

        result = self.controller.describe(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_describe_aterr(self):
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStacks', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStacks')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'show_stack',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None
                 ).AndRaise(AttributeError())

        self.m.ReplayAll()

        result = self.controller.describe(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_describe_bad_name(self):
        stack_name = "wibble"
        params = {'Action': 'DescribeStacks', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStacks')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.describe(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_get_template_int_body(self):
        '''Test the internal _get_template function.'''
        params = {'TemplateBody': "abcdef"}
        dummy_req = self._dummy_GET_request(params)
        result = self.controller._get_template(dummy_req)
        expected = "abcdef"
        self.assertEqual(expected, result)

    # TODO(shardy) : test the _get_template TemplateUrl case

    def test_create(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'DisableRollback': 'true',
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30', 'disable_rollback': 'true'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = {u'tenant': u't',
                       u'stack_name': u'wordpress',
                       u'stack_id': u'1',
                       u'path': u''}

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.create(dummy_req)

        expected = {
            'CreateStackResponse': {
                'CreateStackResult': {
                    u'StackId': u'arn:openstack:heat::t:stacks/wordpress/1'
                }
            }
        }

        self.assertEqual(expected, response)

    def test_create_rollback(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'DisableRollback': 'false',
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30', 'disable_rollback': 'false'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = {u'tenant': u't',
                       u'stack_name': u'wordpress',
                       u'stack_id': u'1',
                       u'path': u''}

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.create(dummy_req)

        expected = {
            'CreateStackResponse': {
                'CreateStackResult': {
                    u'StackId': u'arn:openstack:heat::t:stacks/wordpress/1'
                }
            }
        }

        self.assertEqual(expected, response)

    def test_create_onfailure_true(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'OnFailure': 'DO_NOTHING',
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30', 'disable_rollback': 'true'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = {u'tenant': u't',
                       u'stack_name': u'wordpress',
                       u'stack_id': u'1',
                       u'path': u''}

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.create(dummy_req)

        expected = {
            'CreateStackResponse': {
                'CreateStackResult': {
                    u'StackId': u'arn:openstack:heat::t:stacks/wordpress/1'
                }
            }
        }

        self.assertEqual(expected, response)

    def test_create_onfailure_false_delete(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'OnFailure': 'DELETE',
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30', 'disable_rollback': 'false'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = {u'tenant': u't',
                       u'stack_name': u'wordpress',
                       u'stack_id': u'1',
                       u'path': u''}

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.create(dummy_req)

        expected = {
            'CreateStackResponse': {
                'CreateStackResult': {
                    u'StackId': u'arn:openstack:heat::t:stacks/wordpress/1'
                }
            }
        }

        self.assertEqual(expected, response)

    def test_create_onfailure_false_rollback(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'OnFailure': 'ROLLBACK',
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30', 'disable_rollback': 'false'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = {u'tenant': u't',
                       u'stack_name': u'wordpress',
                       u'stack_id': u'1',
                       u'path': u''}

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.create(dummy_req)

        expected = {
            'CreateStackResponse': {
                'CreateStackResult': {
                    u'StackId': u'arn:openstack:heat::t:stacks/wordpress/1'
                }
            }
        }

        self.assertEqual(expected, response)

    def test_create_onfailure_err(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'DisableRollback': 'true',
                  'OnFailure': 'DO_NOTHING',
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        self.assertRaises(exception.HeatInvalidParameterCombinationError,
                          self.controller.create, dummy_req)

    def test_create_err_no_template(self):
        # Format a dummy request with a missing template field
        stack_name = "wordpress"
        params = {'Action': 'CreateStack', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        result = self.controller.create(dummy_req)
        self.assertIsInstance(result, exception.HeatMissingParameterError)

    def test_create_err_inval_template(self):
        # Format a dummy request with an invalid TemplateBody
        stack_name = "wordpress"
        json_template = "!$%**_+}@~?"
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        result = self.controller.create(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_create_err_rpcerr(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30'}
        dummy_req = self._dummy_GET_request(params)

        self.m.StubOutWithMock(policy.Enforcer, 'enforce')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')

        policy.Enforcer.enforce(dummy_req.context, 'CreateStack'
                                ).AndReturn(True)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None
                 ).AndRaise(AttributeError())

        policy.Enforcer.enforce(dummy_req.context, 'CreateStack'
                                ).AndReturn(True)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.UnknownUserParameter(key='test'))

        policy.Enforcer.enforce(dummy_req.context, 'CreateStack'
                                ).AndReturn(True)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.UserParameterMissing(key='test'))

        self.m.ReplayAll()

        result = self.controller.create(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

        result = self.controller.create(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

        result = self.controller.create(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_create_err_exists(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')

        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackExists(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.create(dummy_req)

        self.assertIsInstance(result, exception.AlreadyExistsError)

    def test_create_err_engine(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'CreateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'TimeoutInMinutes': 30,
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {'timeout_mins': u'30'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'CreateStack')

        # Stub out the RPC call to the engine with a pre-canned response
        self.m.StubOutWithMock(rpc, 'call')

        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'create_stack',
                  'args': {'stack_name': stack_name,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version}, None).AndRaise(
                      heat_exception.StackValidationFailed(
                          message='Something went wrong'))

        self.m.ReplayAll()

        result = self.controller.create(dummy_req)

        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_update(self):
        # Format a dummy request
        stack_name = "wordpress"
        json_template = json.dumps(self.template)
        params = {'Action': 'UpdateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        engine_parms = {u'InstanceType': u'm1.xlarge'}
        engine_args = {}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'UpdateStack')

        # Stub out the RPC call to the engine with a pre-canned response
        identity = dict(identifier.HeatIdentifier('t', stack_name, '1'))

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)

        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'update_stack',
                  'args': {'stack_identity': identity,
                           'template': self.template,
                           'params': engine_parms,
                           'files': {},
                           'args': engine_args},
                  'version': self.api_version},
                 None).AndReturn(identity)

        self.m.ReplayAll()

        response = self.controller.update(dummy_req)

        expected = {
            'UpdateStackResponse': {
                'UpdateStackResult': {
                    u'StackId': u'arn:openstack:heat::t:stacks/wordpress/1'
                }
            }
        }

        self.assertEqual(expected, response)

    def test_update_bad_name(self):
        stack_name = "wibble"
        json_template = json.dumps(self.template)
        params = {'Action': 'UpdateStack', 'StackName': stack_name,
                  'TemplateBody': '%s' % json_template,
                  'Parameters.member.1.ParameterKey': 'InstanceType',
                  'Parameters.member.1.ParameterValue': 'm1.xlarge'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'UpdateStack')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.update(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_create_or_update_err(self):
        result = self.controller.create_or_update(req={}, action="dsdgfdf")
        self.assertIsInstance(result, exception.HeatInternalFailureError)

    def test_get_template(self):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'GetTemplate', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'GetTemplate')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = self.template

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'get_template',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.get_template(dummy_req)

        expected = {'GetTemplateResponse':
                    {'GetTemplateResult':
                     {'TemplateBody': self.template}}}

        self.assertEqual(expected, response)

    def test_get_template_err_rpcerr(self):
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'GetTemplate', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'GetTemplate')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'get_template',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None
                 ).AndRaise(AttributeError())

        self.m.ReplayAll()

        result = self.controller.get_template(dummy_req)

        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_get_template_bad_name(self):
        stack_name = "wibble"
        params = {'Action': 'GetTemplate', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'GetTemplate')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.get_template(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_get_template_err_none(self):
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'GetTemplate', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'GetTemplate')

        # Stub out the RPC call to the engine to return None
        # this test the "no such stack" error path
        engine_resp = None

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'get_template',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        result = self.controller.get_template(dummy_req)

        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_validate_err_no_template(self):
        # Format a dummy request with a missing template field
        params = {'Action': 'ValidateTemplate'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ValidateTemplate')

        result = self.controller.validate_template(dummy_req)
        self.assertIsInstance(result, exception.HeatMissingParameterError)

    def test_validate_err_inval_template(self):
        # Format a dummy request with an invalid TemplateBody
        json_template = "!$%**_+}@~?"
        params = {'Action': 'ValidateTemplate',
                  'TemplateBody': '%s' % json_template}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ValidateTemplate')

        result = self.controller.validate_template(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_bad_resources_in_template(self):
        # Format a dummy request
        json_template = {
            'AWSTemplateFormatVersion': '2010-09-09',
            'Resources': {
                'Type': 'AWS: : EC2: : Instance',
            },
        }
        params = {'Action': 'ValidateTemplate',
                  'TemplateBody': '%s' % json.dumps(json_template)}
        response = {'Error': 'Resources must contain Resource. '
                    'Found a [string] instead'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ValidateTemplate')

        # Stub out the RPC call to the engine with a pre-canned response
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'validate_template',
                  'args': {'template': json_template},
                  'version': self.api_version}, None).AndReturn(response)
        self.m.ReplayAll()

        response = self.controller.validate_template(dummy_req)

        expected = {'ValidateTemplateResponse':
                    {'ValidateTemplateResult':
                     'Resources must contain Resource. '
                     'Found a [string] instead'}}
        self.assertEqual(expected, response)

    def test_delete(self):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '1'))
        params = {'Action': 'DeleteStack', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DeleteStack')

        # Stub out the RPC call to the engine with a pre-canned response
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        # Engine returns None when delete successful
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'delete_stack',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None).AndReturn(None)

        self.m.ReplayAll()

        response = self.controller.delete(dummy_req)

        expected = {'DeleteStackResponse': {'DeleteStackResult': ''}}

        self.assertEqual(expected, response)

    def test_delete_err_rpcerr(self):
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '1'))
        params = {'Action': 'DeleteStack', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DeleteStack')

        # Stub out the RPC call to the engine with a pre-canned response
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'delete_stack',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None
                 ).AndRaise(AttributeError())

        self.m.ReplayAll()

        result = self.controller.delete(dummy_req)

        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_delete_bad_name(self):
        stack_name = "wibble"
        params = {'Action': 'DeleteStack', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DeleteStack')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.delete(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_events_list_event_id_integer(self):
        self._test_events_list('42')

    def test_events_list_event_id_uuid(self):
        self._test_events_list('a3455d8c-9f88-404d-a85b-5315293e67de')

    def _test_events_list(self, event_id):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStackEvents', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackEvents')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = [{u'stack_name': u'wordpress',
                        u'event_time': u'2012-07-23T13:05:39Z',
                        u'stack_identity': {u'tenant': u't',
                                            u'stack_name': u'wordpress',
                                            u'stack_id': u'6',
                                            u'path': u''},
                        u'resource_name': u'WikiDatabase',
                        u'resource_status_reason': u'state changed',
                        u'event_identity':
                        {u'tenant': u't',
                         u'stack_name': u'wordpress',
                         u'stack_id': u'6',
                         u'path': u'/resources/WikiDatabase/events/{0}'.format(
                             event_id)},
                        u'resource_action': u'TEST',
                        u'resource_status': u'IN_PROGRESS',
                        u'physical_resource_id': None,
                        u'resource_properties': {u'UserData': u'blah'},
                        u'resource_type': u'AWS::EC2::Instance'}]

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'list_events',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.events_list(dummy_req)

        expected = {'DescribeStackEventsResponse':
                    {'DescribeStackEventsResult':
                     {'StackEvents':
                      [{'EventId': unicode(event_id),
                        'StackId': u'arn:openstack:heat::t:stacks/wordpress/6',
                        'ResourceStatus': u'TEST_IN_PROGRESS',
                        'ResourceType': u'AWS::EC2::Instance',
                        'Timestamp': u'2012-07-23T13:05:39Z',
                        'StackName': u'wordpress',
                        'ResourceProperties':
                        json.dumps({u'UserData': u'blah'}),
                        'PhysicalResourceId': None,
                        'ResourceStatusReason': u'state changed',
                        'LogicalResourceId': u'WikiDatabase'}]}}}

        self.assertEqual(expected, response)

    def test_events_list_err_rpcerr(self):
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStackEvents', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackEvents')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'list_events',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None
                 ).AndRaise(Exception())

        self.m.ReplayAll()

        result = self.controller.events_list(dummy_req)

        self.assertIsInstance(result, exception.HeatInternalFailureError)

    def test_events_list_bad_name(self):
        stack_name = "wibble"
        params = {'Action': 'DescribeStackEvents', 'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackEvents')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.events_list(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_describe_stack_resource(self):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStackResource',
                  'StackName': stack_name,
                  'LogicalResourceId': "WikiDatabase"}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResource')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = {u'description': u'',
                       u'resource_identity': {
                           u'tenant': u't',
                           u'stack_name': u'wordpress',
                           u'stack_id': u'6',
                           u'path': u'resources/WikiDatabase'
                       },
                       u'stack_name': u'wordpress',
                       u'resource_name': u'WikiDatabase',
                       u'resource_status_reason': None,
                       u'updated_time': u'2012-07-23T13:06:00Z',
                       u'stack_identity': {u'tenant': u't',
                                           u'stack_name': u'wordpress',
                                           u'stack_id': u'6',
                                           u'path': u''},
                       u'resource_action': u'CREATE',
                       u'resource_status': u'COMPLETE',
                       u'physical_resource_id':
                       u'a3455d8c-9f88-404d-a85b-5315293e67de',
                       u'resource_type': u'AWS::EC2::Instance',
                       u'metadata': {u'wordpress': []}}

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        args = {
            'stack_identity': identity,
            'resource_name': dummy_req.params.get('LogicalResourceId'),
        }
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'describe_stack_resource',
                  'args': args,
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.describe_stack_resource(dummy_req)

        expected = {'DescribeStackResourceResponse':
                    {'DescribeStackResourceResult':
                     {'StackResourceDetail':
                      {'StackId': u'arn:openstack:heat::t:stacks/wordpress/6',
                       'ResourceStatus': u'CREATE_COMPLETE',
                       'Description': u'',
                       'ResourceType': u'AWS::EC2::Instance',
                       'ResourceStatusReason': None,
                       'LastUpdatedTimestamp': u'2012-07-23T13:06:00Z',
                       'StackName': u'wordpress',
                       'PhysicalResourceId':
                       u'a3455d8c-9f88-404d-a85b-5315293e67de',
                       'Metadata': {u'wordpress': []},
                       'LogicalResourceId': u'WikiDatabase'}}}}

        self.assertEqual(expected, response)

    def test_describe_stack_resource_nonexistent_stack(self):
        # Format a dummy request
        stack_name = "wibble"
        params = {'Action': 'DescribeStackResource',
                  'StackName': stack_name,
                  'LogicalResourceId': "WikiDatabase"}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResource')

        # Stub out the RPC call to the engine with a pre-canned response
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.describe_stack_resource(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_describe_stack_resource_nonexistent(self):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStackResource',
                  'StackName': stack_name,
                  'LogicalResourceId': "wibble"}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResource')

        # Stub out the RPC call to the engine with a pre-canned response
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        args = {
            'stack_identity': identity,
            'resource_name': dummy_req.params.get('LogicalResourceId'),
        }
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'describe_stack_resource',
                  'args': args,
                  'version': self.api_version},
                 None).AndRaise(heat_exception.ResourceNotFound(
                                resource_name='test', stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.describe_stack_resource(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_describe_stack_resources(self):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStackResources',
                  'StackName': stack_name,
                  'LogicalResourceId': "WikiDatabase"}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResources')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = [{u'description': u'',
                        u'resource_identity': {
                            u'tenant': u't',
                            u'stack_name': u'wordpress',
                            u'stack_id': u'6',
                            u'path': u'resources/WikiDatabase'
                        },
                        u'stack_name': u'wordpress',
                        u'resource_name': u'WikiDatabase',
                        u'resource_status_reason': None,
                        u'updated_time': u'2012-07-23T13:06:00Z',
                        u'stack_identity': {u'tenant': u't',
                                            u'stack_name': u'wordpress',
                                            u'stack_id': u'6',
                                            u'path': u''},
                        u'resource_action': u'CREATE',
                        u'resource_status': u'COMPLETE',
                        u'physical_resource_id':
                        u'a3455d8c-9f88-404d-a85b-5315293e67de',
                        u'resource_type': u'AWS::EC2::Instance',
                        u'metadata': {u'ensureRunning': u'true''true'}}]

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        args = {
            'stack_identity': identity,
            'resource_name': dummy_req.params.get('LogicalResourceId'),
        }
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'describe_stack_resources',
                  'args': args,
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.describe_stack_resources(dummy_req)

        expected = {'DescribeStackResourcesResponse':
                    {'DescribeStackResourcesResult':
                     {'StackResources':
                      [{'StackId': u'arn:openstack:heat::t:stacks/wordpress/6',
                        'ResourceStatus': u'CREATE_COMPLETE',
                        'Description': u'',
                        'ResourceType': u'AWS::EC2::Instance',
                        'Timestamp': u'2012-07-23T13:06:00Z',
                        'ResourceStatusReason': None,
                        'StackName': u'wordpress',
                        'PhysicalResourceId':
                        u'a3455d8c-9f88-404d-a85b-5315293e67de',
                        'LogicalResourceId': u'WikiDatabase'}]}}}

        self.assertEqual(expected, response)

    def test_describe_stack_resources_bad_name(self):
        stack_name = "wibble"
        params = {'Action': 'DescribeStackResources',
                  'StackName': stack_name,
                  'LogicalResourceId': "WikiDatabase"}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResources')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.describe_stack_resources(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)

    def test_describe_stack_resources_physical(self):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'DescribeStackResources',
                  'LogicalResourceId': "WikiDatabase",
                  'PhysicalResourceId': 'a3455d8c-9f88-404d-a85b-5315293e67de'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResources')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = [{u'description': u'',
                        u'resource_identity': {
                            u'tenant': u't',
                            u'stack_name': u'wordpress',
                            u'stack_id': u'6',
                            u'path': u'resources/WikiDatabase'
                        },
                        u'stack_name': u'wordpress',
                        u'resource_name': u'WikiDatabase',
                        u'resource_status_reason': None,
                        u'updated_time': u'2012-07-23T13:06:00Z',
                        u'stack_identity': {u'tenant': u't',
                                            u'stack_name': u'wordpress',
                                            u'stack_id': u'6',
                                            u'path': u''},
                        u'resource_action': u'CREATE',
                        u'resource_status': u'COMPLETE',
                        u'physical_resource_id':
                        u'a3455d8c-9f88-404d-a85b-5315293e67de',
                        u'resource_type': u'AWS::EC2::Instance',
                        u'metadata': {u'ensureRunning': u'true''true'}}]

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'find_physical_resource',
                  'args': {'physical_resource_id':
                           'a3455d8c-9f88-404d-a85b-5315293e67de'},
                  'version': self.api_version}, None).AndReturn(identity)
        args = {
            'stack_identity': identity,
            'resource_name': dummy_req.params.get('LogicalResourceId'),
        }
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'describe_stack_resources',
                  'args': args,
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.describe_stack_resources(dummy_req)

        expected = {'DescribeStackResourcesResponse':
                    {'DescribeStackResourcesResult':
                     {'StackResources':
                      [{'StackId': u'arn:openstack:heat::t:stacks/wordpress/6',
                        'ResourceStatus': u'CREATE_COMPLETE',
                        'Description': u'',
                        'ResourceType': u'AWS::EC2::Instance',
                        'Timestamp': u'2012-07-23T13:06:00Z',
                        'ResourceStatusReason': None,
                        'StackName': u'wordpress',
                        'PhysicalResourceId':
                        u'a3455d8c-9f88-404d-a85b-5315293e67de',
                        'LogicalResourceId': u'WikiDatabase'}]}}}

        self.assertEqual(expected, response)

    def test_describe_stack_resources_physical_not_found(self):
        # Format a dummy request
        params = {'Action': 'DescribeStackResources',
                  'LogicalResourceId': "WikiDatabase",
                  'PhysicalResourceId': 'aaaaaaaa-9f88-404d-cccc-ffffffffffff'}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResources')

        # Stub out the RPC call to the engine with a pre-canned response
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'find_physical_resource',
                  'args': {'physical_resource_id':
                           'aaaaaaaa-9f88-404d-cccc-ffffffffffff'},
                  'version': self.api_version},
                 None).AndRaise(
                     heat_exception.PhysicalResourceNotFound(resource_id='1'))

        self.m.ReplayAll()

        response = self.controller.describe_stack_resources(dummy_req)

        self.assertIsInstance(response,
                              exception.HeatInvalidParameterValueError)

    def test_describe_stack_resources_err_inval(self):
        # Format a dummy request containing both StackName and
        # PhysicalResourceId, which is invalid and should throw a
        # HeatInvalidParameterCombinationError
        stack_name = "wordpress"
        params = {'Action': 'DescribeStackResources',
                  'StackName': stack_name,
                  'PhysicalResourceId': "123456"}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'DescribeStackResources')
        ret = self.controller.describe_stack_resources(dummy_req)
        self.assertIsInstance(ret,
                              exception.HeatInvalidParameterCombinationError)

    def test_list_stack_resources(self):
        # Format a dummy request
        stack_name = "wordpress"
        identity = dict(identifier.HeatIdentifier('t', stack_name, '6'))
        params = {'Action': 'ListStackResources',
                  'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ListStackResources')

        # Stub out the RPC call to the engine with a pre-canned response
        engine_resp = [{u'resource_identity':
                        {u'tenant': u't',
                         u'stack_name': u'wordpress',
                         u'stack_id': u'6',
                         u'path': u'/resources/WikiDatabase'},
                        u'stack_name': u'wordpress',
                        u'resource_name': u'WikiDatabase',
                        u'resource_status_reason': None,
                        u'updated_time': u'2012-07-23T13:06:00Z',
                        u'stack_identity': {u'tenant': u't',
                                            u'stack_name': u'wordpress',
                                            u'stack_id': u'6',
                                            u'path': u''},
                        u'resource_action': u'CREATE',
                        u'resource_status': u'COMPLETE',
                        u'physical_resource_id':
                        u'a3455d8c-9f88-404d-a85b-5315293e67de',
                        u'resource_type': u'AWS::EC2::Instance'}]

        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None).AndReturn(identity)
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'list_stack_resources',
                  'args': {'stack_identity': identity},
                  'version': self.api_version}, None).AndReturn(engine_resp)

        self.m.ReplayAll()

        response = self.controller.list_stack_resources(dummy_req)

        expected = {'ListStackResourcesResponse': {'ListStackResourcesResult':
                    {'StackResourceSummaries':
                     [{'ResourceStatus': u'CREATE_COMPLETE',
                       'ResourceType': u'AWS::EC2::Instance',
                       'ResourceStatusReason': None,
                       'LastUpdatedTimestamp': u'2012-07-23T13:06:00Z',
                       'PhysicalResourceId':
                       u'a3455d8c-9f88-404d-a85b-5315293e67de',
                       'LogicalResourceId': u'WikiDatabase'}]}}}

        self.assertEqual(expected, response)

    def test_list_stack_resources_bad_name(self):
        stack_name = "wibble"
        params = {'Action': 'ListStackResources',
                  'StackName': stack_name}
        dummy_req = self._dummy_GET_request(params)
        self._stub_enforce(dummy_req, 'ListStackResources')

        # Insert an engine RPC error and ensure we map correctly to the
        # heat exception type
        self.m.StubOutWithMock(rpc, 'call')
        rpc.call(dummy_req.context, self.topic,
                 {'namespace': None,
                  'method': 'identify_stack',
                  'args': {'stack_name': stack_name},
                  'version': self.api_version}, None
                 ).AndRaise(heat_exception.StackNotFound(stack_name='test'))

        self.m.ReplayAll()

        result = self.controller.list_stack_resources(dummy_req)
        self.assertIsInstance(result, exception.HeatInvalidParameterValueError)


Mmmmm...lately it's just all comfort food all the time on this blog!
This is another family favourite...Best of Bridge's delicious Hamburger Soup! This is one of my mom's best-loved recipes, and totally reminds me of home. At under 300 calories per bowl yet satisfyingly filling, this is the soup that eats like a meal baby! When I cook this bad boy I usually make a double batch and freeze half, and that way I can simply defrost for a quick and easy dinner or work lunch a few weeks later.
Story 1: When I was a teenager, one time my parents left my brother and I at home when they went on vacation. My mom wanted to make sure we were well fed while they were gone, so before leaving she made a slow cooker full of this Hamburger Soup. Not knowing my way around the kitchen at all (like, at all!) when I was a teenager, when the slow cooker finished cooking and turned off, I didn't know that meant that eventually I should put into the fridge. I happily fed my brother and myself leftover counter-top (microwave reheated) Hamburger Soup for a few days, finally noticing near the end of the batch that it was starting to taste a little off. Ummm...try rancid!!! I had essentially left a soup with ground beef out of the fridge for days and kept eating it. My mom honestly must have wondered where she went wrong in raising such an incompetent child. It took awhile to eat Hamburger Soup again after that.
Story 2: When I moved out of my parents house into my first apartment, I was missing my mom's cooking from home. I went to the store and bought all of the ingredients for Hamburger Soup, and spent the entire afternoon making it (I was a slower vegetable chopper back then!). The final ingredient to add was the barley, which I had purchased in the bulk section of the grocery store. I dumped the barley in and started noticing that the soup appeared to be crawling. Ummm....crawling with bugs!!! The container of barley must have been infested, because only then did I realize that the bag that I had put the barley in was crawling on the inside. All of my hard work went to waste and I had to dump the whole double batch down the garburator. The good news was I went back to the grocery store to let them know to clean their bin, and they comped my whole grocery bill from that day! It took me awhile to eat Hamburger Soup again after that too.
End of gross Hamburger Soup stories. I'm sorry. And if you still feel like making it, the recipe is below.
In a large pot over medium-high heat, cook ground beef and onions until the beef is brown. Drain off all liquid from the pot. Add all remaining ingredients to pot. Bring to a boil, then reduce heat and simmer on low for at least 2 hours, or all day.


Formed in Los Angeles in 1971, the Eagles' seven albums – Eagles (1972), Desperado (1973), On The Border (1974), One Of These Nights (1975), Hotel California (1976), The Long Run (1979) and a 28-year-wait for Long Road Out of Eden (2007) – have sold millions of copies worldwide, the Recording Industry of America (RIAA) revealing they've sold over 83 million albums in the USA alone.
The band re-teamed for a huge live album in 1994, Hell Freezes Over, and a three-year tour, which broke records worldwide and cemented the group's place in music history. 2007's Long Road Out of Eden was a defining disc, with track 'I Dreamed There Was No War' winning a Grammy for Best Pop Instrumental Performance, taking the Eagles on tour to countries as far flung as South Africa, China and Dubai. Inducted into the Rock and Roll Hall of Fame in 1998, the year following the Eagles were honoured by RIAA for 'Best Selling Album of the Century' for compilation Their Greatest Hits (1971–1975). Notably this album remains the highest selling album of all time in the USA.


text:
JRC and EIT Climate KIC sign collaboration agreement
The European Commission's Joint Research Centre (JRC) and Climate-KIC, a Knowledge and Innovation Community of the European Institute of Innovation and Technology (EIT) have signed a collaboration agreement for an initial two-year period, starting from the end of July 2018. The JRC and Climate-KIC are working together to support innovative climate change mitigation and adaptation strategies. By strengthening their cooperation, they will also help to identify scientific issues and disseminate findings in relevant areas.
The collaboration agreement provides the framework under which the JRC and Climate-KIC may conduct activities. This includes:
Sharing knowledge and best practice, through networks like the Smart Specialisation Platform and the European Institute of Innovation and Technology and its Regional Innovation Scheme (EIT-RIS);
Jointly developing methods and content support to policy;
Organising trainings and workshops;
Promoting open access to research data and bilateral data exchange.
On the basis of a Memorandum of Understanding signed in September 2016, the JRC and the EIT are committed to cooperating in areas of common interest, including Smart Specialisation and the EIT-RIS; education, training and skills; technology transfer; intellectual property; new financing mechanisms; and knowledge management.
JRC - News

redpajama_set_name: RedPajamaCommonCrawl


text:
GCC Exchange Committee releases voluntary unified ESG disclosure metrics
The GCC Exchange Committee has released voluntary unified ESG disclosure metrics comprising 29 standards. The metrics are aligned with the World Federation of Exchanges and the Sustainable Stock Exchange initiative.
The metrics serve as a guideline for companies wishing to disclose ESG-related performance and serve as an important step toward standardizing disclosure across GCC capital markets. It is noteworthy that as the metrics are voluntary, they do not replace existing ESG disclosure guidelines.
"As the Gulf initial public offering boom continues, it is important that issuers are cognizant of the priorities of local, regional and international investors. The GCC ESG Metrics will serve to unify reporting across capital markets, encouraging issuers and industries to look at value beyond the balance sheet and operate as responsible businesses," Mohammed Al Rumaih, CEO of the Saudi Exchange and chairman of the GCC Exchanges Committee, commented.
The metrics, which comprise 10 environmental, 10 social and nine governance metrics, cover disclosure guidelines on greenhouse gas emissions, energy usage, water usage, gender pay, employee turnover, gender diversity, data privacy and ethics.
The exchange committee consists of the Abu Dhabi Securities Exchange, Bahrain Bourse, Bourse Kuwait Dubai Financial Market (DFM), Muscat Stock Exchange, Qatar Stock Exchange and the Saudi Exchange which chairs the committee. The exchange committee aims to support the development of regional capital markets.
GCC capital markets have been making consistent efforts toward adopting ESG best practices with a combination of introducing regulatory and voluntary guidelines for local markets.
Boursa Kuwait launched its ESG Disclosure Guide in September 2021 and is currently collaborating with the Capital Markets Authority on the implementation of sustainable finance. Also as part of its sustainability efforts, the Central Bank of Kuwait introduced guidelines on sustainable finance in the banking sector in November 2022.
Earlier in 2020, the Shariah compliant DFM became one of the first GCC exchanges to track ESG best practice among listed companies.
"We also actively promote sustainable finance by leveraging Dubai's world-class ecosystem. This has accelerated the emirate's position as a global center for sustainable finance, with the total value of sustainable and ESG-linked bonds and Sukuk listed on NASDAQ Dubai reaching US$16.8 billion by the end of 2022," Hamed Ali, CEO of DFM and NASDAQ Dubai, shared.
GCC Exchange Committee
Social investing platform InvestSky officially launches after US$3.4 million pre-seed round
Australian Haven Wealth to launch renewable energy fund in 2023


In late 2003, the watch market was saturated with timepieces that were impossibly complex and adorned with irrelevant interfaces and features. Nike recoginzed the need for a watch that was both accessible to users and of world-class design and premium construction. Scott Wilson, former Global Creative Director for Nike, was brought in to address the market's missing piece.
Wilson created the ultimate in extreme training watches with Nike's Oregon Series Watch Collection. In collaboration with Lance Armstrong and three-time ECO challenge winner Ian Adamson, features and functions for the new series were blueprinted. Wilson's final design for the series was specifically tailored to meet the needs of such adventure racers.
The Oregon Series is based on a solid forged aluminum case and a pinless uni-body strap. Concern for small details such as the knurled buttons and their familiar round form are combined with fluid surfaces through advanced manufacturing techniques creating a truly timeless design. Wilson's constant concern for precision and attention to these small details allowed for a design with the ability to emotionally speak to users through its strong characteristics of durability, longevity and trust.


BEIJING, Nov. 5 (Xinhua) -- Chinese President Xi Jinping sent a congratulatory letter to the 13th Meeting of the International Committee on Global Navigation Satellite Systems (ICG), which started Monday in Xi'an, northwest China's Shaanxi Province.
Xi said satellite navigation systems are significant space infrastructure and important information guarantee for economic and social development to provide humanity with all-day accurate time and space information service on life and work.
Xi noted that this year marks the 50th anniversary of the first UN Conference on the Exploration and Peaceful Uses of Outer Space, and countries should step up international cooperation and coordination in satellite navigation, facilitate the global application of the systems, and make them play a more significant role in improving human welfare.
China attaches importance to the development of satellite navigation systems and actively seeks international cooperation, Xi stressed in the letter, saying the BeiDou Navigation Satellite System has become one of the most significant achievements during China's 40 years of reform and opening-up.
He said the BeiDou system will start serving countries and regions along the Belt and Road by the end of 2018 and expand the service network to the entire globe in 2020, and build a comprehensive space and time system that is more ubiquitous, more integrated and more smart by 2035.
Xi said China is willing to share the achievements of the BeiDou system with other countries, and promote the development of global satellite navigation systems.
Xi called for ICG meeting delegates to deepen communication and pool ideas to make global satellite navigation systems provide better global services for humanity.


text:
Tourism/Transportation
Seaborne Airlines expands to LMM
December 15, 20100752
Seaborne has
Seaborne is expanding its business out of LMM airport.
St. Croix-based Seaborne Airlines will begin new daily flights between the Luis Muñoz Marín International Airport and the islands of St. Croix, St. Thomas and Vieques starting Jan. 12, the company announced Wednesday.
The new schedule expands the carrier's local presence, as it will complement the service it offers from the Isla Grande airport in San Juan. The expansion comes as the company nears its 20th year of business and its 10th serving Puerto Rico.
"Seaborne has always been dedicated to meeting the traveling needs of the USVI and PR communities," said Seaborne Airlines president Omer ErSelcuk. "On the 10th anniversary of Seaborne service in Puerto Rico, we felt the time was right to provide our guests with the route and airport, [LMM], that they have been asking us to serve for years."
The expansion in air access between the neighboring islands represents a step forward in the region's economic development, and further strengthens Puerto Rico's place as a Caribbean hub.
"One of the strategies for the development of air access is to increase the flights offered between the islands of Puerto Rico and the Caribbean, which strengthens our position as a hub in the Caribbean," said Economic Development and Commerce Secretary José R. Pérez-Riera in a statement issued Wednesday.
Additional flights to these islands, especially Vieques and Culebra, are key to their economic development.
"Certainly the increase of Seaborne Airlines flights will bring a positive economic impact to the islands of Puerto Rico," said former Tourism chief Jamie López, who is now the EDC's principal officer of development for Puerto Rico.
Seaborne's expansion comes several months after W hotel in Vieques struck an agreement to charter a daily flight to transport passengers between LMM and the island municipality.
mkantrow@newsismybusiness.com
Michelle Kantrow-Vázquez
Business reporter with 25 years of experience writing for weekly and daily newspapers, as well as trade publications in Puerto Rico. My list of former employers includes Caribbean Business, The San Juan Star, and the Puerto Rico Daily Sun, among others. My areas of expertise include telecommunications, technology, retail, agriculture, tourism, banking and most other areas of the economy.
Related tags : LMMSeaborne
Rum excise tax benefit poised for extension
Bumble Bee plant in Mayagüez sold as part of $980M deal
Hey Buddy!, I found this information for you: "Seaborne Airlines expands to LMM". Here is the website link: https://newsismybusiness.com/seaborne-airlines-expands-to-lmm/. Thank you.


Play Stop ming Full Music Album Download, Soundtracks, Bajirao Mastani ( ) Free MP3 Songs Download, Music Album, Bajirao Mastaani, Download, Hindi Movie MP3 Free Punjabi , Hindi Songs, Music Album, Bollywood Movie MP3 Soundtracks Bollywood Hindi Movie Bajirao Mastani ( ) Free MP3 Songs Bollywood Video Songs : Malhari Bajirao Mastani Vishal Dadlani. Download DJ Kunal Scorpio Malhari - Bajirao Mastani ( Nukkad Style) Hindi Remixes Mp3 Song & Video From album BeatsLock Party Vol. You Can Listen Bajirao Mastani Songs In Mr Jatt Video, We Just Retail Information From Other Sources & Hyperlink To Them. Ranveer Singh Hit Song Song Download Mr jatt.
Singer: Vishal Dadlani Music: Sanjay Leela Bhansali Download songspk, stream Malhari mp3 song ( full version) in high quality , mr jatt, listen, ranveer singh hit song Mp3 Song Download, all in one zip file ranveer singh hit song Mp3 Free, play, djpunjab, pagalworld, pagalworld , ranveer singh hit song 320kbps Download wapking.
Bajirao- Mastani Mp3 Music By -. 7 in High Quality - M bajirao Mastani Songs In Mr Jatt Song Mp3. Each Of The Rights Over The Tunes Would Be The Property Of Their Respective Malhari Mp3 Song from movie Bajirao Mastani in 320kbps/ 128kbps/ 192kbps and 160kbps. Download Free Punjabi and Bollywood Video Songs : Malhari Bajirao Mastani Vishal Dadlani.
Malhari Bajirao Mastani Vishal Dadlani. Malhari Official Mp3 Song Bajirao Mastani Ranveer Singh.
Listen to the full audio song of ' Malhari' from Sanjay Leela Bhansali' s ' Bajirao Mastani' only on Eros Now. Malhari bajirao mastani download mr jatt. The song is sung by singer Vishal Dadlani.
Singer: Vishal Dadlani Music: Sanjay Leela Bhansali. When There Is A Damaged Backlink We' re Not In Control Of It.
Bajirao- Mastani Mp3 Music By -. Download Various Aaj Ibaadat Mp3 Song. Aaj Ibaadat Hindi released on, Download This Hindi Song From.
Bajirao Mastani Various Hindi category album download Bajirao Mastani Various from Hindi Bajirao Mastani Various from Hindi categorykbps malhari Mp3 Free, malhari Mp3 Song Download, malhari 320kbps Download, mr jatt, pagalworld, djpunjab, wapking.
Malhari Song Download Mr jatt. Malhari Full Mp3 Song Bajirao Mastani. Malhari Lyrical Song Bajirao Mastani Ranveer Singh Deepika Padukone. Play Stop Download. Donald Trump Dances To Ranveer Singh& 39 S Malhari.
Bajirao mastani mp3 song download mr jatt title/ name of Song / Music / Video is delivered from Youtube and maybe containing a video' s copy right. This web just only a search engine media, not a storage or cloud server from the file. We just linked the file or embed from Youtube then display them here to make visitor easy to find it.


The United Methodist Church stands firmly in the mainstream of Christian tradition. We share with many other denominations the basic tenets of Christian faith as put forth in the Nicene Creed and the Apostles' Creed:.
The Trinity God, who is one, is revealed in three distinct persons: God the Father, Jesus Christ the Son, and the Holy Spirit.
God God, often referred to as the Father or Creator, is the maker of all things.
Jesus Christ We are saved through faith in Jesus Christ, who is the Son of God and Redeemer of all creation. God became human in Jesus of Nazareth; his life, death, and resurrection demonstrate God's love.
Holy Spirit The Holy Spirit, or Sustainer, is God's present activity in our midst, leading, challenging, supporting, or comforting us.
Human Beings We are made in the image of God (Genesis 1:17). Like the Creator, we have the capacity to love, to communicate, and to create. However, God's image has been marred by human sin.
The Church The church is the body of Christ, an extension of Christ's life and ministry in the world today.
The Bible The Bible is God's Word, the primary authority for our faith and practice.
God's Reign The kingdom or reign of God is both a present reality and future hope.
John and Charles Wesley, the founders of the Methodist movement, placed particular emphasis on "practical divinity." They believed that all people could experience the grace and love of God, and that a Christian life meant putting faith and love into action.
Prevenient Grace is the grace of God inherent in our creation which allows us to discern between good and evil, and causes us to yearn for relationship with God.
Justifying Grace is the grace-filled gift of Jesus Christ, who forgives our sins and reconciles us to God.
Sanctifying Grace is the grace of the Holy Spirit, cooperatively working within us as we seek to live holier and more loving lives, and assuring us of God's love for us.
Faith & Works We are saved by faith in Jesus Christ alone, independent of anything we do. However, United Methodists insist that we respond to God's grace through a life of loving service to those around us. Works of faith, mercy, love, and justice are a witness to our faith, and help us experience God's love more fully. We affirm that "faith by itself, if it has no works, is dead" (James 2:17). Love of God is always linked to love of neighbor and to a passionate commitment to seeking justice and renewal in the world. United Methodists have one of the strongest mission programs in the world, and our social justice ministry is headquartered across the street from the U.S. Capitol.
Head & Heart For Methodists, Christian faith is something to understand and something to feel. We encourage people to reflect on their faith using the tools of scripture, tradition, reason, and experience. Methodists affirm a few essentials (above) and welcome a latitude of belief on non-essentials. But faith is not just head knowledge. It is also a heartfelt assurance that Jesus Christ knows and loves each of us personally and forgives our sins.
Open Communion Communion is a sacrament in which we experience the love and grace of Jesus Christ. Methodists welcome all to participate in this means of grace. In this holy mystery, we remember the loving sacrifice of Christ as we experience his presence in the bread and the cup. As a further expression of openness, Onalaska UMC uses grape juice instead of wine for those who struggle with addiction, and has optional gluten-free bread available for those who need it. Prayer and anointing with oil are available for those who request it during communion.
More extensive information is available from The United Methodist Church website about what we believe. If you have specific questions, feel free to contact the pastor (pastor@onalaskaumc.org).