~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to bin/nova-rpc-zmq-receiver

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman, Yolanda Robla, James Page
  • Date: 2013-01-11 13:06:56 UTC
  • mfrom: (1.1.67)
  • Revision ID: package-import@ubuntu.com-20130111130656-7n7fkevy03stm3mv
Tags: 2013.1~g2-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/ubuntu-show-tests.patch: Dropped no longer needed.
* debian/nova-xcp-plugins.install: Fix xcp-plugins empty packages
* debian/control: Drop python-nose in favor or testrepository
* debian/control: Add python-coverage as a build dep.
* debian/rules, debian/control: Run pep8 tests.
* debian/*.init: Remove they are not needed and take up space
* debian/control, debian/nova-cells.{install, logrotate, upstart}: Add
  cells support.
* debian/patches/fix-ubuntu-tests.patch: temporarily disable failing tests.
* debian/control, debian/nova-baremetal.{install, logrotate, upstart}: Add
  nova baremetal support.
* debian/control: Remove python-support.

[ Adam Gandelman ]
* debian/*.manpages: Install Sphinx-generated manpages instead of
  our own.
* debian/nova-compute-*.conf: Specify the newly required compute_driver
  flag in addition to libvirt_type.
* debian/control:  Specify required python-webob and python-stevedore
  versions.

[ Yolanda Robla ]
* debian/*.upstart: Use start-stop-daemon instead of su for chuid
  (LP: #1086833).
* debian/rules: Remove override of dh_installinit for discriminating
  between Debian and Ubuntu.
* debian/nova-common.docs: Installing changelogs from rules
* debian/rules: Replacing perms in /etc/nova/logging.conf for 0644
* debian/control: adduser dependency on nova-compute.
* debian/control: added section oldlibs and priority extra on
  nova-ajax-console-proxy.
* debian/nova-xvpvncproxy.postrm: removing because of duplicates.

[ James Page ]
* d/control: Add ~ to python-sqlalchemy-ext versioned dependencies to
  make backporting easier.
* d/control: Updated nova-volume description and depdendencies to
  mark it as a transitional package, moved to oldlibs/extra.
* d/p/fix-libvirt-tests.patch: Dropped; accepted upstream.
* d/control: Added python-stevedore to BD's.
* d/*.postrm: Dropped postrm's that just run update-rc.d; this is not
  required when deploying upstart configurations only.
* d/nova-scheduler.manpages: Add man page for nova-rpc-zmq-receiver.
* d/rules: Install upstream changelog with a policy compliant name.
* d/control: Mark nova-compute-xcp as virtual package.
* d/control: nova-api-os-volume; Depend on cinder-api and mark as
  transitional package.
* d/nova-api-os-volume.lintian-overrides: Dropped - no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
3
 
4
 
#    Copyright 2011 OpenStack Foundation
 
4
#    Copyright 2011 OpenStack LLC
5
5
#
6
6
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
7
7
#    not use this file except in compliance with the License. You may obtain
22
22
import os
23
23
import sys
24
24
 
 
25
import zmq
 
26
 
25
27
# If ../nova/__init__.py exists, add ../ to Python search path, so that
26
28
# it will override what happens to be installed in /usr/(local/)lib/python...
27
29
POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
30
32
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
31
33
    sys.path.insert(0, POSSIBLE_TOPDIR)
32
34
 
33
 
from oslo.config import cfg
34
 
 
 
35
from nova import config
 
36
from nova import exception
 
37
from nova.openstack.common import cfg
35
38
from nova.openstack.common import log as logging
36
39
from nova.openstack.common import rpc
37
40
from nova.openstack.common.rpc import impl_zmq
 
41
from nova import utils
38
42
 
39
43
CONF = cfg.CONF
40
44
CONF.register_opts(rpc.rpc_opts)
42
46
 
43
47
 
44
48
def main():
45
 
    CONF(sys.argv[1:], project='nova')
 
49
    config.parse_args(sys.argv)
46
50
    logging.setup("nova")
 
51
    utils.monkey_patch()
 
52
 
 
53
    ipc_dir = CONF.rpc_zmq_ipc_dir
 
54
 
 
55
    # Create the necessary directories/files for this service.
 
56
    if not os.path.isdir(ipc_dir):
 
57
        try:
 
58
            utils.execute('mkdir', '-p', ipc_dir, run_as_root=True)
 
59
            utils.execute('chown', "%s:%s" % (os.getuid(), os.getgid()),
 
60
                          ipc_dir, run_as_root=True)
 
61
            utils.execute('chmod', '750', ipc_dir, run_as_root=True)
 
62
        except exception.ProcessExecutionError:
 
63
            logging.error(_("Could not create IPC socket directory."))
 
64
            return
47
65
 
48
66
    with contextlib.closing(impl_zmq.ZmqProxy(CONF)) as reactor:
 
67
        consume_in = "tcp://%s:%s" % \
 
68
            (CONF.rpc_zmq_bind_address,
 
69
             CONF.rpc_zmq_port)
 
70
        consumption_proxy = impl_zmq.InternalContext(None)
 
71
 
 
72
        reactor.register(consumption_proxy,
 
73
                         consume_in, zmq.PULL, out_bind=True)
 
74
 
49
75
        reactor.consume_in_thread()
50
76
        reactor.wait()
51
77