コード例 #1
0
def setup_global_env(program=None, args=None):
    global __setup_complete
    assert not __setup_complete

    from magnetodb import storage
    from magnetodb.common import config
    from magnetodb.openstack.common import log
    from magnetodb.openstack.common import gettextutils

    gettextutils.install(PROJECT_NAME, lazy=False)

    config.parse_args(prog=program, args=args)
    log.setup(PROJECT_NAME)
    storage.setup()

    __setup_complete = True
コード例 #2
0
ファイル: __init__.py プロジェクト: chjwang/magnetodb
def setup_global_env(program=None, args=None):
    global __setup_complete
    assert not __setup_complete

    from magnetodb import storage
    from magnetodb.common import config
    from magnetodb.openstack.common import log
    from magnetodb.openstack.common import gettextutils

    gettextutils.install(PROJECT_NAME, lazy=False)

    config.parse_args(
        prog=program,
        args=args
    )
    log.setup(PROJECT_NAME)
    storage.setup()

    __setup_complete = True
コード例 #3
0
ファイル: ec2token.py プロジェクト: chjwang/magnetodb
#    under the License.

import hashlib
import requests
import webob

from oslo.config import cfg

from magnetodb.common import exception
from magnetodb.common import wsgi

from magnetodb.openstack.common import jsonutils as json
from magnetodb.openstack.common import log as logging
from magnetodb.openstack.common import gettextutils
from magnetodb.openstack.common.gettextutils import _
gettextutils.install('magnetodb')

logger = logging.getLogger(__name__)


opts = [
    cfg.StrOpt('auth_uri',
               default='',
               help=_("Authentication Endpoint URI.")),
    cfg.BoolOpt('multi_cloud',
                default=False,
                help=_('Allow orchestration of multiple clouds.')),
    cfg.ListOpt('allowed_auth_uris',
                default=[],
                help=_('Allowed keystone endpoints for auth_uri when '
                       'multi_cloud is enabled. At least one endpoint needs '
コード例 #4
0
ファイル: wsgi.py プロジェクト: sirmax123/magnetodb
import routes

from magnetodb.openstack.common import gettextutils
from magnetodb.openstack.common import log
from magnetodb.common import wsgi
from magnetodb.common import PROJECT_NAME

from magnetodb import storage

from magnetodb.api.amz import controller as amz_api_controller
from magnetodb.api.amz import wsgi as amazon_wsgi

from magnetodb.common import config

gettextutils.install(PROJECT_NAME, lazy=False)


class MagnetoDBApplication(wsgi.Router):

    """API"""
    def __init__(self, **options):
        args = []
        for k, v in options.iteritems():
            args.append(k)
            args.append(v)

        config.parse_args(
            prog=options.get("program", "magnetodb-api"),
            args=args
        )
コード例 #5
0
import hashlib
import requests
import webob

from oslo.config import cfg

from magnetodb.common import exception
from magnetodb.common import wsgi

from magnetodb.openstack.common import jsonutils as json
from magnetodb.openstack.common import log as logging
from magnetodb.openstack.common import gettextutils
from magnetodb.openstack.common.gettextutils import _

gettextutils.install('magnetodb')

logger = logging.getLogger(__name__)

opts = [
    cfg.StrOpt('auth_uri', default='', help=_("Authentication Endpoint URI.")),
    cfg.BoolOpt('multi_cloud',
                default=False,
                help=_('Allow orchestration of multiple clouds.')),
    cfg.ListOpt('allowed_auth_uris',
                default=[],
                help=_('Allowed keystone endpoints for auth_uri when '
                       'multi_cloud is enabled. At least one endpoint needs '
                       'to be specified.'))
]
cfg.CONF.register_opts(opts, group='ec2authtoken')