def main(): config.parse_args(sys.argv) logging.setup(CONF, "ec2api") server = service.WSGIService("ec2api", max_url_len=16384) service.serve(server, workers=server.workers) service.wait()
def main(): config.parse_args(sys.argv) logging.setup(config.CONF, "ec2api") server = s3server.get_wsgi_server() service.serve(server) service.wait()
def main(): config.parse_args(sys.argv) logging.setup(CONF, "ec2api") server = service.WSGIService('metadata') service.serve(server, workers=server.workers) service.wait()
def main(): config.parse_args(sys.argv) logging.setup(CONF, 'ec2api') server = service.WSGIService('ec2api', max_url_len=16384) service.serve(server) service.wait()
def main(): CONF.register_cli_opt(command_opt) config.parse_args(sys.argv) log.setup(CONF, "ec2api") try: CONF.command.func() except Exception as e: sys.exit("ERROR: %s" % e)
def setUpClass(cls): super(DbApiTestCase, cls).setUpClass() conf = cfg.CONF try: config.parse_args([], default_config_files=[]) conf.set_override('connection', 'sqlite://', group='database') conf.set_override('sqlite_synchronous', False, group='database') engine = session.get_engine() conn = engine.connect() migration.db_sync() cls.DB_SCHEMA = "".join(line for line in conn.connection.iterdump()) engine.dispose() finally: conf.reset()
def main(): CONF.register_cli_opt(command_opt) try: config.parse_args(sys.argv) log.setup(CONF, "ec2api") except cfg.ConfigFilesNotFoundError: cfgfile = CONF.config_file[-1] if CONF.config_file else None if cfgfile and not os.access(cfgfile, os.R_OK): st = os.stat(cfgfile) print(_("Could not read %s. Re-running with sudo") % cfgfile) try: os.execvp('sudo', ['sudo', '-u', '#%s' % st.st_uid] + sys.argv) except Exception: print(_('sudo failed, continuing as if nothing happened')) print(_('Please re-run ec2-api-manage as root.')) return(2) try: CONF.command.func() except Exception as e: sys.exit("ERROR: %s" % e)
import ec2api.api.apirequest from ec2api.api import clients from ec2api.api import ec2utils from ec2api import config from ec2api.db import migration from ec2api.db.sqlalchemy import api as db_backend from ec2api.tests.unit import fakes from ec2api.tests.unit import matchers from ec2api.tests.unit import tools import ec2api.wsgi DB_SCHEMA = None config.parse_args([], default_config_files=[]) # TODO(ft): temporary solution to prevent discovery of Nova API version # in clients.nova. This should be removed when all tests either use # MockOSMixin (which should be improved in its turn) to mock novaclient, # or mock clients.nova directly. clients._nova_api_version = '2.3' def skip_not_implemented(test_item): def decorator(test_item): test_item.skip('The feature is not yet implemented') return decorator def create_context(is_os_admin=False): session = (mock.sentinel.admin_session
from oslotest import base as test_base import ec2api.api.apirequest from ec2api.api import clients from ec2api.api import ec2utils from ec2api import config from ec2api.db import migration from ec2api.db.sqlalchemy import api as db_backend from ec2api.tests.unit import fakes from ec2api.tests.unit import matchers from ec2api.tests.unit import tools import ec2api.wsgi DB_SCHEMA = None config.parse_args([], default_config_files=[]) # TODO(ft): temporary solution to prevent discovery of Nova API version # in clients.nova. This should be removed when all tests either use # MockOSMixin (which should be improved in its turn) to mock novaclient, # or mock clients.nova directly. clients._nova_api_version = '2.3' def skip_not_implemented(test_item): def decorator(test_item): test_item.skip('The feature is not yet implemented') return decorator def create_context(is_os_admin=False):