Пример #1
0
def main():
    # Parse config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.tuskar_api_bind_ip
    port = CONF.tuskar_api_port
    wsgi = simple_server.make_server(
        host, port,
        app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)
    # make sure we have tripleo-heat-templates:
    heat_template_path = CONF.tht_local_dir
    try:
        os.listdir(heat_template_path)
    except OSError:
        LOG.info(
            "Can't find local tripleo-heat-template files at %s"
            % (heat_template_path))
        LOG.info(
            "Cannot proceed - missing tripleo heat templates "
            "See INSTALL documentation for more info")
        raise
    LOG.info("Using tripleo-heat-templates at %s" % (heat_template_path))

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
Пример #2
0
def main():

    # Build and start the WSGI app
    host = CONF.tuskar_api_bind_ip
    port = CONF.tuskar_api_port
    wsgi = simple_server.make_server(host, port,
                                     app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)
    # make sure we have tripleo-heat-templates:
    heat_template_path = CONF.tht_local_dir
    try:
        os.listdir(heat_template_path)
    except OSError:
        LOG.info("Can't find local tripleo-heat-template files at %s" %
                 (heat_template_path))
        LOG.info("Cannot proceed - missing tripleo heat templates "
                 "See INSTALL documentation for more info")
        raise
    LOG.info("Using tripleo-heat-templates at %s" % (heat_template_path))

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
Пример #3
0
def notify(_context, message):
    """Notifies the recipient of the desired event given the model.
    Log notifications using openstack's default logging system"""

    priority = message.get('priority',
                           CONF.default_notification_level)
    priority = priority.lower()
    logger = logging.getLogger(
        'tuskar.openstack.common.notification.%s' %
        message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
Пример #4
0
def main():
    # Pase config file and command line options, then start logging
    tuskar_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.tuskar_api_bind_ip
    port = CONF.tuskar_api_port
    wsgi = simple_server.make_server(
            host, port,
            app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
Пример #5
0
def main(argv=None):

    if argv is None:
        argv = sys.argv

    tuskar_service.prepare_service(argv)

    # Build and start the WSGI app
    host = cfg.CONF.tuskar_api_bind_ip
    port = cfg.CONF.tuskar_api_port
    wsgi = simple_server.make_server(
        host, port,
        app.VersionSelectorApplication())

    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    cfg.CONF.log_opt_values(LOG, logging.INFO)

    try:
        wsgi.serve_forever()
    except KeyboardInterrupt:
        pass
Пример #6
0
               help='Heat API user password'),
    cfg.StrOpt('tenant_name',
               default=env.get('OS_TENANT_NAME') or 'admin',
               help='Heat API keystone tenant name'),
    cfg.StrOpt('auth_url',
               default=env.get('OS_AUTH_URL') or 'http://localhost:35357/v2.0',
               help='Keystone authentication URL'),
    cfg.BoolOpt('insecure',
                default=True,
                help='Set to False when Heat API uses HTTPS')
]

CONF = cfg.CONF
CONF.register_opts(heat_opts, group='heat')
CONF.register_opts(heat_keystone_opts, group='heat_keystone')
LOG = logging.getLogger(__name__)

from heatclient.v1.client import Client as heatclient
from keystoneclient.v2_0 import client as ksclient


class HeatClient(object):
    """Heat CloudFormations API client to use in Tuskar"""
    def __init__(self):
        try:
            keystone = ksclient.Client(**CONF.heat_keystone)
            endpoint = keystone.service_catalog.url_for(
                service_type=CONF.heat['service_type'],
                endpoint_type=CONF.heat['endpoint_type'])
            self.connection = heatclient(
                endpoint=endpoint,
Пример #7
0
               help='The tenant name the overcloud is deployed on behalf of'
               ),
    cfg.StrOpt('auth_url',
               default=env.get('OS_AUTH_URL') or 'http://localhost:35357/v2.0',
               help='Keystone authentication URL'
               ),
    cfg.BoolOpt('insecure',
                default=True,
                help='Set to False when Heat API uses HTTPS'
                )
]

CONF = cfg.CONF
CONF.register_opts(heat_opts, group='heat')
CONF.register_opts(heat_keystone_opts, group='heat_keystone')
LOG = logging.getLogger(__name__)

from heatclient.exc import HTTPNotFound as HeatStackNotFound
from heatclient.v1.client import Client as heatclient
from keystoneclient.v2_0 import client as ksclient


class HeatClient(object):
    """Heat CloudFormations API client to use in Tuskar"""

    def __init__(self):
        try:
            keystone = ksclient.Client(**CONF.heat_keystone)
            endpoint = keystone.service_catalog.url_for(
                service_type=CONF.heat['service_type'],
                endpoint_type=CONF.heat['endpoint_type']