diff options
| author | Monty Taylor <mordred@inaugust.com> | 2013-04-03 11:20:33 -0400 |
|---|---|---|
| committer | Monty Taylor <mordred@inaugust.com> | 2013-04-07 02:32:37 -0400 |
| commit | 0b15de18fba81acfcffc5861f34e0199caef8fb9 (patch) | |
| tree | 1f7a1240b95645d2abd0a4c47adcafebe925b2d1 | |
| parent | 49153d44ca6620a5027b56036e4077725aa90faf (diff) | |
| download | oslo-0b15de18fba81acfcffc5861f34e0199caef8fb9.tar.gz oslo-0b15de18fba81acfcffc5861f34e0199caef8fb9.tar.xz oslo-0b15de18fba81acfcffc5861f34e0199caef8fb9.zip | |
Move bin/ scripts to entrypoints.
Instead of propogating more bin scripts, migrate these to be things
that can be consumed as entrypoints.
Change-Id: Ic01e0f16fe9e7634708fbb51499ccea3f4f40d63
| -rwxr-xr-x | openstack/common/rootwrap/cmd.py (renamed from bin/oslo-rootwrap) | 2 | ||||
| -rwxr-xr-x | openstack/common/rpc/zmq_receiver.py (renamed from bin/oslo-rpc-zmq-receiver) | 12 | ||||
| -rw-r--r-- | setup.py | 4 | ||||
| -rw-r--r-- | tests/unit/rpc/test_zmq.py | 2 | ||||
| -rw-r--r-- | update.py | 1 |
5 files changed, 6 insertions, 15 deletions
diff --git a/bin/oslo-rootwrap b/openstack/common/rootwrap/cmd.py index 3acbe7d..92552f1 100755 --- a/bin/oslo-rootwrap +++ b/openstack/common/rootwrap/cmd.py @@ -61,7 +61,7 @@ def _exit_error(execname, message, errorcode, log=True): sys.exit(errorcode) -if __name__ == '__main__': +def main(): # Split arguments, require at least a command execname = sys.argv.pop(0) if len(sys.argv) < 2: diff --git a/bin/oslo-rpc-zmq-receiver b/openstack/common/rpc/zmq_receiver.py index 94092b7..e74da22 100755 --- a/bin/oslo-rpc-zmq-receiver +++ b/openstack/common/rpc/zmq_receiver.py @@ -19,17 +19,8 @@ import eventlet eventlet.monkey_patch() import contextlib -import os import sys -# If ../oslo/__init__.py exists, add ../ to Python search path, so that -# it will override what happens to be installed in /usr/(local/)lib/python... -POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), - os.pardir, - os.pardir)) -if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'oslo', '__init__.py')): - sys.path.insert(0, POSSIBLE_TOPDIR) - from oslo.config import cfg from openstack.common import log as logging @@ -48,6 +39,3 @@ def main(): with contextlib.closing(impl_zmq.ZmqProxy(CONF)) as reactor: reactor.consume_in_thread() reactor.wait() - -if __name__ == '__main__': - main() @@ -67,6 +67,10 @@ setuptools.setup( entry_points={ "openstack.common.scheduler.filters": filters, "openstack.common.tests.fakes.weights": weights, + "console_scripts": [ + 'oslo-rootwrap = openstack.common.rootwrap.cmd:main', + 'oslo-rpc-zmq-receiver = openstack.common.rpc.zmq_receiver:main', + ] }, namespace_packages=['openstack'], ) diff --git a/tests/unit/rpc/test_zmq.py b/tests/unit/rpc/test_zmq.py index 21345a9..564f15e 100644 --- a/tests/unit/rpc/test_zmq.py +++ b/tests/unit/rpc/test_zmq.py @@ -88,7 +88,7 @@ class _RpcZmqBaseTestCase(common.BaseRpcTestCase): reactor.consume_in_thread() else: LOG.warning(_("Detected zmq-receiver socket.")) - LOG.warning(_("Assuming nova-rpc-zmq-receiver is running.")) + LOG.warning(_("Assuming oslo-rpc-zmq-receiver is running.")) LOG.warning(_("Using system zmq receiver deamon.")) super(_RpcZmqBaseTestCase, self).setUp( topic=topic, topic_nested=topic_nested) @@ -196,7 +196,6 @@ def _copy_module(mod, base, dest_dir): copy_pyfile(os.path.join(mod_path, s)) globs_to_copy = [ - os.path.join('bin', 'oslo-' + mod + '*'), os.path.join('tools', mod + '*'), os.path.join('etc', 'oslo', mod + '*.conf'), ] |
