diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-29 21:11:27 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-29 21:11:27 +0000 |
| commit | 58577aa37208a6394c972e5176af5a3ded2c40ff (patch) | |
| tree | a8a5f9b086fbb919b73dd8977ab0e1848e822359 | |
| parent | 03c04186381bade08c9b69e8c5ea270b50db2e1f (diff) | |
| parent | b677b13560fc1e670022cefa2d330d84dac2304a (diff) | |
| download | oslo-58577aa37208a6394c972e5176af5a3ded2c40ff.tar.gz oslo-58577aa37208a6394c972e5176af5a3ded2c40ff.tar.xz oslo-58577aa37208a6394c972e5176af5a3ded2c40ff.zip | |
Merge "Remove rootwrap from IPC directory creation"
| -rw-r--r-- | openstack/common/rpc/impl_zmq.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py index add3973..c64c772 100644 --- a/openstack/common/rpc/impl_zmq.py +++ b/openstack/common/rpc/impl_zmq.py @@ -30,7 +30,6 @@ from openstack.common import excutils from openstack.common.gettextutils import _ from openstack.common import importutils from openstack.common import jsonutils -from openstack.common import processutils as utils from openstack.common.rpc import common as rpc_common zmq = importutils.try_import('eventlet.green.zmq') @@ -521,23 +520,23 @@ class ZmqProxy(ZmqBaseReactor): CONF.rpc_zmq_port) consumption_proxy = InternalContext(None) - if not os.path.isdir(ipc_dir): - try: - utils.execute('mkdir', '-p', ipc_dir, run_as_root=True) - utils.execute('chown', "%s:%s" % (os.getuid(), os.getgid()), - ipc_dir, run_as_root=True) - utils.execute('chmod', '750', ipc_dir, run_as_root=True) - except utils.ProcessExecutionError: + try: + os.makedirs(ipc_dir) + except os.error: + if not os.path.isdir(ipc_dir): with excutils.save_and_reraise_exception(): - LOG.error(_("Could not create IPC directory %s") % - (ipc_dir, )) - + LOG.error(_("Required IPC directory does not exist at" + " %s") % (ipc_dir, )) try: self.register(consumption_proxy, consume_in, zmq.PULL, out_bind=True) except zmq.ZMQError: + if os.access(ipc_dir, os.X_OK): + with excutils.save_and_reraise_exception(): + LOG.error(_("Permission denied to IPC directory at" + " %s") % (ipc_dir, )) with excutils.save_and_reraise_exception(): LOG.error(_("Could not create ZeroMQ receiver daemon. " "Socket may already be in use.")) |
