Esempio n. 1
0
def main():
    # Pase config file and command line options, then start logging
    mimic_service.prepare_service(sys.argv)

    # Build and start the WSGI app
    host = CONF.mimic_api_bind_ip
    port = CONF.mimic_api_port
    LOG = log.getLogger(__name__)
    LOG.info("Serving on http://%s:%s" % (host, port))
    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)
    wsgi.server(eventlet.listen((host, port)), app.VersionSelectorApplication())
Esempio n. 2
0
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


import contextlib
import errno
import os

from mimic.openstack.common import excutils
from mimic.openstack.common.gettextutils import _  # noqa
from mimic.openstack.common import log as logging

LOG = logging.getLogger(__name__)

_FILE_CACHE = {}


def ensure_tree(path):
    """Create a directory (and any ancestor directories required)

    :param path: Directory to create
    """
    try:
        os.makedirs(path)
    except OSError as exc:
        if exc.errno == errno.EEXIST:
            if not os.path.isdir(path):
                raise
Esempio n. 3
0
import pprint
import threading

from oslo.config import cfg
import pecan

from mimic.api import config
from mimic.api import hooks
from mimic.api import middleware
from mimic.openstack.common import log as logger
from mimic.openstack.common import memorycache


CONF = cfg.CONF
LOG = logger.getLogger(__name__)


AUTH_OPTIONS = [
    cfg.StrOpt('auth_host',
               default='localhost',
               help='Username to use for openstack service access'),
    cfg.StrOpt('auth_port',
               default='35357',
               help='Username to use for openstack service access'),
    cfg.StrOpt('auth_protocol',
               default='http',
               help='Username to use for openstack service access'),
    cfg.StrOpt('auth_api_version',
               default='v3',
               help='Username to use for openstack service access'),
    cfg.StrOpt('admin_user_domain_name',