From a48ccb03fb7d060c3fbcbb13dfce62a08fb31a1d Mon Sep 17 00:00:00 2001 From: Brandon Logan Date: Fri, 17 Apr 2015 11:46:44 -0500 Subject: [PATCH] Fix ups so pbr and setup works Moved octavia/bin directory to octavia/octavia/cmd and renamed octavia-api to api.py. This follows the new strucutre most openstack projects are doing. Also implemented octavia-api being built when doing setup install. Had to remove the octavia/tests/specs symlink because pbr did not like it and would not allow anything to be built. Also found out the test_titles test was not being run on the specs, so that has been added as a separate tox environment. Change-Id: I92f2bc6eaa346983f7a2479dc9fa43d2040f2cd5 --- {bin => octavia/cmd}/__init__.py | 0 bin/octavia-api => octavia/cmd/api.py | 3 ++- octavia/tests/specs | 1 - requirements.txt | 4 +++- setup.cfg | 6 ++++++ specs-tests/{tests => }/__init__.py | 0 specs-tests/{tests => }/test_titles.py | 0 tox.ini | 7 ++++++- 8 files changed, 17 insertions(+), 4 deletions(-) rename {bin => octavia/cmd}/__init__.py (100%) rename bin/octavia-api => octavia/cmd/api.py (97%) delete mode 120000 octavia/tests/specs rename specs-tests/{tests => }/__init__.py (100%) rename specs-tests/{tests => }/test_titles.py (100%) diff --git a/bin/__init__.py b/octavia/cmd/__init__.py similarity index 100% rename from bin/__init__.py rename to octavia/cmd/__init__.py diff --git a/bin/octavia-api b/octavia/cmd/api.py similarity index 97% rename from bin/octavia-api rename to octavia/cmd/api.py index 1f99cdc936..75d04d8fe8 100755 --- a/bin/octavia-api +++ b/octavia/cmd/api.py @@ -27,7 +27,8 @@ from octavia.i18n import _LI LOG = logging.getLogger(__name__) -if __name__ == '__main__': + +def main(): octavia_service.prepare_service(sys.argv) app = api_app.setup_app() diff --git a/octavia/tests/specs b/octavia/tests/specs deleted file mode 120000 index b306242a17..0000000000 --- a/octavia/tests/specs +++ /dev/null @@ -1 +0,0 @@ -../../specs-tests/tests \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index da906a5196..04e6ea222e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,8 @@ anyjson>=0.3.3 Babel>=1.3 eventlet>=0.16.1,!=0.17.0 requests>=2.2.0,!=2.4.0 +ipaddr==2.1.11 +iso8601>=0.1.9 jsonrpclib keystonemiddleware>=1.5.0 netaddr>=0.7.12 @@ -35,5 +37,5 @@ pyOpenSSL>=0.11 WSME>=0.6 pyasn1 pyasn1_modules - +singledispatch>=3.4.0.3 # For pecan Jinja2>=2.6 # BSD License (3 clause) diff --git a/setup.cfg b/setup.cfg index 25d186a961..e32bfc4b42 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,10 @@ classifier = Programming Language :: Python Programming Language :: Python :: 2.7 +[files] +packages = + octavia + [build_sphinx] all_files = 1 build-dir = doc/build @@ -30,6 +34,8 @@ warnerrors = True universal = 1 [entry_points] +console_scripts = + octavia-api = octavia.cmd.api:main octavia.api.handlers = simulated_handler = octavia.api.v1.handlers.controller_simulator.handler:SimulatedControllerHandler queue_producer = octavia.api.v1.handlers.queue.producer:ProducerHandler diff --git a/specs-tests/tests/__init__.py b/specs-tests/__init__.py similarity index 100% rename from specs-tests/tests/__init__.py rename to specs-tests/__init__.py diff --git a/specs-tests/tests/test_titles.py b/specs-tests/test_titles.py similarity index 100% rename from specs-tests/tests/test_titles.py rename to specs-tests/test_titles.py diff --git a/tox.ini b/tox.ini index 3fb454e734..64cc31c659 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = docs,py27,pep8 +envlist = docs,py27,pep8,specs skipsdist = True [testenv] @@ -26,6 +26,11 @@ commands = flake8 [testenv:docs] commands = python setup.py build_sphinx +[testenv:specs] +commands = + find . -type f -name "*.pyc" -delete + python -m unittest specs-tests.test_titles + [flake8] # Ignoring O321 because it's unnecessarily restricting use of json package. # jsonutils version doesn't add additional value