Update nova-rpc-zmq-receiver to load nova.conf.
Updates the bin/nova-rpc-zmq-receiver so that it makes use of FLAGS, calls parse_args, and loads the nova.conf config file like all other nova- binaries. Fixes LP Bug #1044153 Change-Id: I904e5d2ae491cd805be78038493d437dd1f7f3cc
This commit is contained in:
@@ -33,22 +33,23 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
|
|||||||
sys.path.insert(0, POSSIBLE_TOPDIR)
|
sys.path.insert(0, POSSIBLE_TOPDIR)
|
||||||
|
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova.openstack.common import cfg
|
from nova import flags
|
||||||
from nova.openstack.common import log as logging
|
from nova.openstack.common import log as logging
|
||||||
from nova.openstack.common import rpc
|
from nova.openstack.common import rpc
|
||||||
from nova.openstack.common.rpc import impl_zmq
|
from nova.openstack.common.rpc import impl_zmq
|
||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
FLAGS = flags.FLAGS
|
||||||
|
FLAGS.register_opts(rpc.rpc_opts)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
CONF.register_opts(rpc.rpc_opts)
|
flags.parse_args(sys.argv)
|
||||||
impl_zmq.register_opts(CONF)
|
impl_zmq.register_opts(FLAGS)
|
||||||
logging.setup("nova")
|
logging.setup("nova")
|
||||||
utils.monkey_patch()
|
utils.monkey_patch()
|
||||||
|
|
||||||
ipc_dir = CONF.rpc_zmq_ipc_dir
|
ipc_dir = FLAGS.rpc_zmq_ipc_dir
|
||||||
|
|
||||||
# Create the necessary directories/files for this service.
|
# Create the necessary directories/files for this service.
|
||||||
if not os.path.isdir(ipc_dir):
|
if not os.path.isdir(ipc_dir):
|
||||||
@@ -61,10 +62,10 @@ def main():
|
|||||||
logging.error(_("Could not create IPC socket directory."))
|
logging.error(_("Could not create IPC socket directory."))
|
||||||
return
|
return
|
||||||
|
|
||||||
with contextlib.closing(impl_zmq.ZmqProxy(CONF)) as reactor:
|
with contextlib.closing(impl_zmq.ZmqProxy(FLAGS)) as reactor:
|
||||||
consume_in = "tcp://%s:%s" % \
|
consume_in = "tcp://%s:%s" % \
|
||||||
(CONF.rpc_zmq_bind_address,
|
(FLAGS.rpc_zmq_bind_address,
|
||||||
CONF.rpc_zmq_port)
|
FLAGS.rpc_zmq_port)
|
||||||
consumption_proxy = impl_zmq.InternalContext(None)
|
consumption_proxy = impl_zmq.InternalContext(None)
|
||||||
|
|
||||||
reactor.register(consumption_proxy,
|
reactor.register(consumption_proxy,
|
||||||
|
|||||||
Reference in New Issue
Block a user