Skip to content

Instantly share code, notes, and snippets.

Created March 3, 2014 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/d450c94cb9929b8e1eec to your computer and use it in GitHub Desktop.
Save anonymous/d450c94cb9929b8e1eec to your computer and use it in GitHub Desktop.
# Copyright (c) 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-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.
from oslo.config import cfg
from marconi.common import cli
from marconi.queues import bootstrap
import io
import inspect
import sys
from marconi.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class MockSTDOut(io.StringIO):
def write(self, msg):
msg = str(msg)
caller = inspect.stack()[2][3]
def writelines(self, messages):
msg = '<newline>'.join([str(msg) for msg in messages])
caller = inspect.stack()[2][3]
sys.stdout = sys.stderr = MockSTDOut()
@cli.runnable
def run():
# TODO(kgriffs): For now, we have to use the global config
# to pick up common options from openstack.common.log, since
# that module uses the global CONF instance exclusively.
conf = cfg.CONF
conf(project='marconi', prog='marconi-queues')
server = bootstrap.Bootstrap(conf)
server.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment