From 9bab0960b6276476e1ca361ca12e547f661b5766 Mon Sep 17 00:00:00 2001 From: Brad Hall Date: Wed, 9 Nov 2011 22:57:13 -0800 Subject: [PATCH] Second round of packaging changes This change condenses the directory structure to something more similar to what we had before while producing similar packages. It also introduces version.py which allows us to get the version from git tags (or a fallback version if not available). Fixes lp bug 889336 Fixes lp bug 888795 Change-Id: I86136bd9dbabb5eb1f8366ed665ed9b54f695124 --- MANIFEST.in | 5 + bin/quantum | 17 +-- bin/quantum-server | 12 +- client/lib/quantum/__init__.py | 5 - client/lib/quantum/tests/unit/__init__.py | 38 ------- common/lib/quantum/__init__.py | 5 - common/lib/quantum/run_tests.py | 67 ----------- {server/etc => etc}/init.d/quantum-server | 0 etc/plugins.ini | 3 + {server/etc => etc}/quantum.conf | 0 {server/etc => etc}/quantum.conf.sample | 0 {server/etc => etc}/quantum.conf.test | 0 .../quantum/plugins/cisco}/cisco_plugins.ini | 0 .../quantum/plugins/cisco}/credentials.ini | 0 .../quantum/plugins/cisco}/db_conn.ini | 0 .../plugins/cisco}/l2network_plugin.ini | 0 .../quantum/plugins/cisco}/nexus.ini | 0 .../plugins/cisco}/quantum.conf.ciscoext | 0 .../etc => etc/quantum/plugins/cisco}/ucs.ini | 0 .../quantum/plugins/cisco}/ucs_inventory.ini | 0 .../openvswitch}/ovs_quantum_plugin.ini | 0 plugins/cisco-plugin/MANIFEST.in | 1 - plugins/cisco-plugin/lib/quantum/__init__.py | 5 - .../lib/quantum/plugins/__init__.py | 5 - .../quantum/plugins/cisco/tests/__init__.py | 23 ---- plugins/openvswitch-plugin/MANIFEST.in | 1 - .../lib/quantum/__init__.py | 5 - .../lib/quantum/plugins/__init__.py | 5 - .../plugins/openvswitch/tests/__init__.py | 5 - .../openvswitch/tests/unit/__init__.py | 5 - plugins/sample-plugin/lib/quantum/__init__.py | 5 - .../lib/quantum/plugins/__init__.py | 5 - plugins/sample-plugin/setup.py | 55 --------- {common => quantum}/README | 0 {client/lib => quantum}/__init__.py | 0 .../lib/quantum => quantum}/api/__init__.py | 0 .../lib/quantum => quantum}/api/api_common.py | 0 .../quantum => quantum}/api/attachments.py | 0 {server/lib/quantum => quantum}/api/faults.py | 0 .../lib/quantum => quantum}/api/networks.py | 0 {server/lib/quantum => quantum}/api/ports.py | 0 .../lib/quantum => quantum}/api/versions.py | 0 .../quantum => quantum}/api/views/__init__.py | 0 .../api/views/attachments.py | 0 .../quantum => quantum}/api/views/networks.py | 0 .../quantum => quantum}/api/views/ports.py | 0 .../quantum => quantum}/api/views/versions.py | 0 .../client.py => quantum/client/__init__.py | 0 {client/lib/quantum => quantum/client}/cli.py | 2 +- .../lib/quantum => quantum/client}/cli_lib.py | 2 +- .../quantum => quantum}/common/__init__.py | 0 .../lib/quantum => quantum}/common/config.py | 0 .../quantum => quantum}/common/exceptions.py | 0 .../quantum => quantum}/common/extensions.py | 0 .../lib/quantum => quantum}/common/flags.py | 0 .../quantum => quantum}/common/serializer.py | 0 .../quantum => quantum}/common/test_lib.py | 2 +- .../lib/quantum => quantum}/common/utils.py | 0 .../lib/quantum => quantum}/db/__init__.py | 0 {server/lib/quantum => quantum}/db/api.py | 0 {server/lib/quantum => quantum}/db/models.py | 0 .../extensions/__init__.py | 0 .../extensions/_credential_view.py | 0 .../extensions/_novatenant_view.py | 0 .../extensions/_pprofiles.py | 0 .../extensions/_qos_view.py | 0 .../extensions/credential.py | 0 .../extensions/multiport.py | 0 .../extensions/novatenant.py | 0 .../extensions/portprofile.py | 0 .../lib/quantum => quantum}/extensions/qos.py | 0 {server/lib/quantum => quantum}/manager.py | 0 {common/lib => quantum/plugins}/__init__.py | 0 .../plugins/cisco}/README | 0 .../plugins/cisco/__init__.py | 0 .../plugins/cisco/client/cli.py | 3 +- .../plugins/cisco/common/__init__.py | 0 .../cisco/common/cisco_configparser.py | 0 .../plugins/cisco/common/cisco_constants.py | 0 .../plugins/cisco/common/cisco_credentials.py | 0 .../plugins/cisco/common/cisco_exceptions.py | 0 .../plugins/cisco/common/cisco_faults.py | 0 .../plugins/cisco/common/cisco_utils.py | 0 .../plugins/cisco/db/__init__.py | 0 .../plugins/cisco/db/api.py | 0 .../plugins/cisco/db/l2network_db.py | 0 .../plugins/cisco/db/l2network_models.py | 0 .../plugins/cisco/db/models.py | 0 .../plugins/cisco/db/nexus_db.py | 0 .../plugins/cisco/db/nexus_models.py | 0 .../plugins/cisco/db/ucs_db.py | 0 .../plugins/cisco/db/ucs_models.py | 0 .../plugins/cisco/l2device_inventory_base.py | 0 .../plugins/cisco/l2device_plugin_base.py | 0 .../plugins/cisco/l2network_model_base.py | 0 .../plugins/cisco/l2network_plugin.py | 0 .../cisco/l2network_plugin_configuration.py | 0 .../cisco/l2network_segmentation_base.py | 0 .../plugins/cisco/models/__init__.py | 0 .../cisco/models/l2network_multi_blade.py | 0 .../cisco/models/l2network_single_blade.py | 0 .../plugins/cisco/nexus/__init__.py | 0 .../cisco/nexus/cisco_nexus_configuration.py | 0 .../cisco/nexus/cisco_nexus_network_driver.py | 0 .../plugins/cisco/nexus/cisco_nexus_plugin.py | 0 .../cisco/nexus/cisco_nexus_snippets.py | 0 .../plugins/cisco/nova}/__init__.py | 0 .../nova/quantum_port_aware_scheduler.py | 0 .../plugins/cisco/nova/vifdirect.py | 0 .../plugins/cisco}/pip-requires | 0 .../plugins/cisco/run_tests.py | 1 - .../plugins/cisco/segmentation/__init__.py | 0 .../cisco/segmentation/l2network_vlan_mgr.py | 0 .../plugins/cisco/tests}/__init__.py | 0 .../plugins/cisco/tests/unit/__init__.py | 5 - .../cisco/tests/unit/test_cisco_extension.py | 0 .../plugins/cisco/tests/unit/test_database.py | 0 .../cisco/tests/unit/test_l2networkApi.py | 0 .../tests/unit/test_l2network_multi_blade.py | 0 .../cisco/tests/unit/test_nexus_plugin.py | 0 .../cisco/tests/unit/test_ucs_driver.py | 0 .../cisco/tests/unit/test_ucs_inventory.py | 0 .../cisco/tests/unit/test_ucs_plugin.py | 0 .../plugins/cisco/tests/unit/test_vlan_mgr.py | 0 .../plugins/cisco/ucs/__init__.py | 0 .../plugins/cisco/ucs/cisco_getvif.py | 0 .../cisco/ucs/cisco_ucs_configuration.py | 0 .../plugins/cisco/ucs/cisco_ucs_inventory.py | 0 .../ucs/cisco_ucs_inventory_configuration.py | 0 .../cisco/ucs/cisco_ucs_network_driver.py | 0 .../plugins/cisco/ucs/cisco_ucs_plugin.py | 0 .../plugins/openvswitch/Makefile | 0 .../plugins/openvswitch}/README | 0 .../plugins/openvswitch}/__init__.py | 0 .../openvswitch/agent/ovs_quantum_agent.py | 0 .../openvswitch/agent/xenserver_install.sh | 0 .../plugins/openvswitch/ovs_db.py | 0 .../plugins/openvswitch/ovs_models.py | 0 .../plugins/openvswitch/ovs_quantum_plugin.py | 4 +- .../plugins/openvswitch}/pip-requires | 0 .../plugins/openvswitch/run_tests.py | 28 +---- .../plugins/openvswitch/tests}/__init__.py | 0 .../openvswitch/tests/unit}/__init__.py | 0 .../openvswitch/tests/unit/test_vlan_map.py | 0 .../plugins/sample}/SamplePlugin.py | 2 +- .../plugins/sample}/__init__.py | 0 .../quantum_plugin_base.py | 0 .../server.py => quantum/server/__init__.py | 0 {server/lib/quantum => quantum}/service.py | 0 .../lib/quantum => quantum}/tests/__init__.py | 0 .../tests/unit/__init__.py | 5 - .../tests/unit/client_tools/__init__.py | 0 .../tests/unit/client_tools/stubs.py | 4 +- .../tests/unit/database_stubs.py | 0 .../tests/unit/extension_stubs.py | 0 .../tests/unit/extensions/__init__.py | 0 .../tests/unit/extensions/foxinsocks.py | 0 .../tests/unit/test_api.py | 0 .../tests/unit/test_cli.py | 5 +- .../tests/unit/test_clientlib.py | 0 .../tests/unit/test_database.py | 0 .../tests/unit/test_extensions.py | 4 +- .../tests/unit/testlib_api.py | 0 {server/lib/quantum => quantum}/wsgi.py | 0 run_tests.py | 68 +++++++++++- run_tests.sh | 2 +- server/MANIFEST.in | 2 - server/etc/plugins.ini | 3 - server/lib/quantum/__init__.py | 21 ---- server/lib/quantum/tests/__init__.py | 19 ---- setup.py | 3 +- .../setup.py => setup_cisco_plugin.py | 21 ++-- client/setup.py => setup_client.py | 11 +- common/setup.py => setup_common.py | 22 ++-- .../setup.py => setup_openvswitch_plugin.py | 11 +- quantum/setup.py => setup_sample_plugin.py | 16 +-- server/setup.py => setup_server.py | 26 ++++- tools/build_debs.sh | 7 +- tools/build_rpms.sh | 2 +- tools/source_environment.py | 28 ----- tools/source_nonplugin_environment.py | 26 ----- version.py | 104 ++++++++++++++++++ 182 files changed, 268 insertions(+), 463 deletions(-) create mode 100644 MANIFEST.in delete mode 100644 client/lib/quantum/__init__.py delete mode 100644 client/lib/quantum/tests/unit/__init__.py delete mode 100644 common/lib/quantum/__init__.py delete mode 100644 common/lib/quantum/run_tests.py rename {server/etc => etc}/init.d/quantum-server (100%) create mode 100644 etc/plugins.ini rename {server/etc => etc}/quantum.conf (100%) rename {server/etc => etc}/quantum.conf.sample (100%) rename {server/etc => etc}/quantum.conf.test (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/cisco_plugins.ini (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/credentials.ini (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/db_conn.ini (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/l2network_plugin.ini (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/nexus.ini (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/quantum.conf.ciscoext (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/ucs.ini (100%) rename {plugins/cisco-plugin/etc => etc/quantum/plugins/cisco}/ucs_inventory.ini (100%) rename {plugins/openvswitch-plugin/etc => etc/quantum/plugins/openvswitch}/ovs_quantum_plugin.ini (100%) delete mode 100644 plugins/cisco-plugin/MANIFEST.in delete mode 100644 plugins/cisco-plugin/lib/quantum/__init__.py delete mode 100644 plugins/cisco-plugin/lib/quantum/plugins/__init__.py delete mode 100644 plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/__init__.py delete mode 100644 plugins/openvswitch-plugin/MANIFEST.in delete mode 100644 plugins/openvswitch-plugin/lib/quantum/__init__.py delete mode 100644 plugins/openvswitch-plugin/lib/quantum/plugins/__init__.py delete mode 100644 plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/__init__.py delete mode 100644 plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/unit/__init__.py delete mode 100644 plugins/sample-plugin/lib/quantum/__init__.py delete mode 100644 plugins/sample-plugin/lib/quantum/plugins/__init__.py delete mode 100644 plugins/sample-plugin/setup.py rename {common => quantum}/README (100%) rename {client/lib => quantum}/__init__.py (100%) rename {server/lib/quantum => quantum}/api/__init__.py (100%) rename {server/lib/quantum => quantum}/api/api_common.py (100%) rename {server/lib/quantum => quantum}/api/attachments.py (100%) rename {server/lib/quantum => quantum}/api/faults.py (100%) rename {server/lib/quantum => quantum}/api/networks.py (100%) rename {server/lib/quantum => quantum}/api/ports.py (100%) rename {server/lib/quantum => quantum}/api/versions.py (100%) rename {server/lib/quantum => quantum}/api/views/__init__.py (100%) rename {server/lib/quantum => quantum}/api/views/attachments.py (100%) rename {server/lib/quantum => quantum}/api/views/networks.py (100%) rename {server/lib/quantum => quantum}/api/views/ports.py (100%) rename {server/lib/quantum => quantum}/api/views/versions.py (100%) rename client/lib/quantum/client.py => quantum/client/__init__.py (100%) rename {client/lib/quantum => quantum/client}/cli.py (99%) rename {client/lib/quantum => quantum/client}/cli_lib.py (99%) rename {common/lib/quantum => quantum}/common/__init__.py (100%) rename {common/lib/quantum => quantum}/common/config.py (100%) rename {common/lib/quantum => quantum}/common/exceptions.py (100%) rename {common/lib/quantum => quantum}/common/extensions.py (100%) rename {common/lib/quantum => quantum}/common/flags.py (100%) rename {common/lib/quantum => quantum}/common/serializer.py (100%) rename {common/lib/quantum => quantum}/common/test_lib.py (99%) rename {common/lib/quantum => quantum}/common/utils.py (100%) rename {server/lib/quantum => quantum}/db/__init__.py (100%) rename {server/lib/quantum => quantum}/db/api.py (100%) rename {server/lib/quantum => quantum}/db/models.py (100%) rename {server/lib/quantum => quantum}/extensions/__init__.py (100%) rename {server/lib/quantum => quantum}/extensions/_credential_view.py (100%) rename {server/lib/quantum => quantum}/extensions/_novatenant_view.py (100%) rename {server/lib/quantum => quantum}/extensions/_pprofiles.py (100%) rename {server/lib/quantum => quantum}/extensions/_qos_view.py (100%) rename {server/lib/quantum => quantum}/extensions/credential.py (100%) rename {server/lib/quantum => quantum}/extensions/multiport.py (100%) rename {server/lib/quantum => quantum}/extensions/novatenant.py (100%) rename {server/lib/quantum => quantum}/extensions/portprofile.py (100%) rename {server/lib/quantum => quantum}/extensions/qos.py (100%) rename {server/lib/quantum => quantum}/manager.py (100%) rename {common/lib => quantum/plugins}/__init__.py (100%) rename {plugins/cisco-plugin => quantum/plugins/cisco}/README (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/client/cli.py (99%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/common/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/common/cisco_configparser.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/common/cisco_constants.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/common/cisco_credentials.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/common/cisco_exceptions.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/common/cisco_faults.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/common/cisco_utils.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/api.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/l2network_db.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/l2network_models.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/models.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/nexus_db.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/nexus_models.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/ucs_db.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/db/ucs_models.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/l2device_inventory_base.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/l2device_plugin_base.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/l2network_model_base.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/l2network_plugin.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/l2network_plugin_configuration.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/l2network_segmentation_base.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/models/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/models/l2network_multi_blade.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/models/l2network_single_blade.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/nexus/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/nexus/cisco_nexus_configuration.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/nexus/cisco_nexus_network_driver.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/nexus/cisco_nexus_plugin.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/nexus/cisco_nexus_snippets.py (100%) rename {plugins/cisco-plugin/lib => quantum/plugins/cisco/nova}/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/nova/quantum_port_aware_scheduler.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/nova/vifdirect.py (100%) rename {plugins/cisco-plugin => quantum/plugins/cisco}/pip-requires (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/run_tests.py (97%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/segmentation/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/segmentation/l2network_vlan_mgr.py (100%) rename {plugins/cisco-plugin/lib/quantum/plugins/cisco/nova => quantum/plugins/cisco/tests}/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/__init__.py (85%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_cisco_extension.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_database.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_l2networkApi.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_l2network_multi_blade.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_nexus_plugin.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_ucs_driver.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_ucs_inventory.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_ucs_plugin.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/tests/unit/test_vlan_mgr.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/ucs/__init__.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/ucs/cisco_getvif.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/ucs/cisco_ucs_configuration.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/ucs/cisco_ucs_inventory.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/ucs/cisco_ucs_inventory_configuration.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/ucs/cisco_ucs_network_driver.py (100%) rename {plugins/cisco-plugin/lib/quantum => quantum}/plugins/cisco/ucs/cisco_ucs_plugin.py (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/Makefile (100%) rename {plugins/openvswitch-plugin => quantum/plugins/openvswitch}/README (100%) rename {plugins/openvswitch-plugin/lib => quantum/plugins/openvswitch}/__init__.py (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/agent/ovs_quantum_agent.py (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/agent/xenserver_install.sh (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/ovs_db.py (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/ovs_models.py (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/ovs_quantum_plugin.py (98%) rename {plugins/openvswitch-plugin => quantum/plugins/openvswitch}/pip-requires (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/run_tests.py (69%) rename {plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch => quantum/plugins/openvswitch/tests}/__init__.py (100%) rename {plugins/sample-plugin/lib => quantum/plugins/openvswitch/tests/unit}/__init__.py (100%) rename {plugins/openvswitch-plugin/lib/quantum => quantum}/plugins/openvswitch/tests/unit/test_vlan_map.py (100%) rename {plugins/sample-plugin/lib/quantum/plugins => quantum/plugins/sample}/SamplePlugin.py (99%) rename {server/lib => quantum/plugins/sample}/__init__.py (100%) rename {server/lib/quantum => quantum}/quantum_plugin_base.py (100%) rename server/lib/quantum/server.py => quantum/server/__init__.py (100%) rename {server/lib/quantum => quantum}/service.py (100%) rename {client/lib/quantum => quantum}/tests/__init__.py (100%) rename {server/lib/quantum => quantum}/tests/unit/__init__.py (85%) rename {server/lib/quantum => quantum}/tests/unit/client_tools/__init__.py (100%) rename {server/lib/quantum => quantum}/tests/unit/client_tools/stubs.py (94%) rename {server/lib/quantum => quantum}/tests/unit/database_stubs.py (100%) rename {server/lib/quantum => quantum}/tests/unit/extension_stubs.py (100%) rename {server/lib/quantum => quantum}/tests/unit/extensions/__init__.py (100%) rename {server/lib/quantum => quantum}/tests/unit/extensions/foxinsocks.py (100%) rename {server/lib/quantum => quantum}/tests/unit/test_api.py (100%) rename {server/lib/quantum => quantum}/tests/unit/test_cli.py (99%) rename {client/lib/quantum => quantum}/tests/unit/test_clientlib.py (100%) rename {server/lib/quantum => quantum}/tests/unit/test_database.py (100%) rename {server/lib/quantum => quantum}/tests/unit/test_extensions.py (99%) rename {server/lib/quantum => quantum}/tests/unit/testlib_api.py (100%) rename {server/lib/quantum => quantum}/wsgi.py (100%) mode change 100755 => 100644 run_tests.py delete mode 100644 server/MANIFEST.in delete mode 100644 server/etc/plugins.ini delete mode 100644 server/lib/quantum/__init__.py delete mode 100644 server/lib/quantum/tests/__init__.py rename plugins/cisco-plugin/setup.py => setup_cisco_plugin.py (75%) rename client/setup.py => setup_client.py (85%) rename common/setup.py => setup_common.py (73%) rename plugins/openvswitch-plugin/setup.py => setup_openvswitch_plugin.py (88%) rename quantum/setup.py => setup_sample_plugin.py (77%) rename server/setup.py => setup_server.py (69%) delete mode 100644 tools/source_environment.py delete mode 100644 tools/source_nonplugin_environment.py create mode 100644 version.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000..fee445d391 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include etc/* +include etc/init.d/* +include etc/quantum/plugins/openvswitch/* +include etc/quantum/plugins/cisco/* +include version.py diff --git a/bin/quantum b/bin/quantum index 23389c8a2d..cbcdb1f6ed 100755 --- a/bin/quantum +++ b/bin/quantum @@ -16,16 +16,9 @@ # License for the specific language governing permissions and limitations # under the License. -# If ../quantum/__init__.py exists, add ../ to Python search path, so that -# it will override what happens to be installed in /usr/(local/)lib/python... +import os +import sys +sys.path.insert(0, os.getcwd()) +import quantum.client.cli as cli -import __init__ - -try: - import source_environment -except ImportError: - pass - -from quantum.cli import main as cli - -cli() +cli.main() diff --git a/bin/quantum-server b/bin/quantum-server index 7a09507b05..1ea7a16190 100755 --- a/bin/quantum-server +++ b/bin/quantum-server @@ -16,15 +16,9 @@ # License for the specific language governing permissions and limitations # under the License. -# If ../quantum/__init__.py exists, add ../ to Python search path, so that -# it will override what happens to be installed in /usr/(local/)lib/python... - -import __init__ -try: - import source_environment -except ImportError: - pass - +import os +import sys +sys.path.insert(0, os.getcwd()) from quantum.server import main as server server() diff --git a/client/lib/quantum/__init__.py b/client/lib/quantum/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/client/lib/quantum/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/client/lib/quantum/tests/unit/__init__.py b/client/lib/quantum/tests/unit/__init__.py deleted file mode 100644 index 726786924d..0000000000 --- a/client/lib/quantum/tests/unit/__init__.py +++ /dev/null @@ -1,38 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 OpenStack LLC. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# See http://code.google.com/p/python-nose/issues/detail?id=373 -# The code below enables nosetests to work with i18n _() blocks -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) - -import __builtin__ -import unittest -setattr(__builtin__, '_', lambda x: x) - - -class BaseTest(unittest.TestCase): - - def setUp(self): - pass - - -def setUp(): - pass diff --git a/common/lib/quantum/__init__.py b/common/lib/quantum/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/common/lib/quantum/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/common/lib/quantum/run_tests.py b/common/lib/quantum/run_tests.py deleted file mode 100644 index 7043196035..0000000000 --- a/common/lib/quantum/run_tests.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2010 OpenStack, LLC -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -"""Unittest runner for quantum - -To run all test:: - python run_tests.py - -To run all unit tests:: - python run_tests.py unit - -To run all functional tests:: - python run_tests.py functional - -To run a single unit test:: - python run_tests.py unit.test_stores:TestSwiftBackend.test_get - -To run a single functional test:: - python run_tests.py functional.test_service:TestController.test_create - -To run a single unit test module:: - python run_tests.py unit.test_stores - -To run a single functional test module:: - python run_tests.py functional.test_stores -""" - -import gettext -import os -import unittest -import sys - -from quantum.common.test_lib import run_tests -from nose import config -from nose import core - -import quantum.tests.unit - - -def main(): - c = config.Config(stream=sys.stdout, - env=os.environ, - verbosity=3, - includeExe=True, - traverseNamespace=True, - plugins=core.DefaultPluginManager()) - c.configureWhere(quantum.tests.unit.__path__) - sys.exit(run_tests(c)) - -if __name__ == "__main__": - main() diff --git a/server/etc/init.d/quantum-server b/etc/init.d/quantum-server similarity index 100% rename from server/etc/init.d/quantum-server rename to etc/init.d/quantum-server diff --git a/etc/plugins.ini b/etc/plugins.ini new file mode 100644 index 0000000000..49c660249d --- /dev/null +++ b/etc/plugins.ini @@ -0,0 +1,3 @@ +[PLUGIN] +# Quantum plugin provider module +provider = quantum.plugins.sample.SamplePlugin.FakePlugin diff --git a/server/etc/quantum.conf b/etc/quantum.conf similarity index 100% rename from server/etc/quantum.conf rename to etc/quantum.conf diff --git a/server/etc/quantum.conf.sample b/etc/quantum.conf.sample similarity index 100% rename from server/etc/quantum.conf.sample rename to etc/quantum.conf.sample diff --git a/server/etc/quantum.conf.test b/etc/quantum.conf.test similarity index 100% rename from server/etc/quantum.conf.test rename to etc/quantum.conf.test diff --git a/plugins/cisco-plugin/etc/cisco_plugins.ini b/etc/quantum/plugins/cisco/cisco_plugins.ini similarity index 100% rename from plugins/cisco-plugin/etc/cisco_plugins.ini rename to etc/quantum/plugins/cisco/cisco_plugins.ini diff --git a/plugins/cisco-plugin/etc/credentials.ini b/etc/quantum/plugins/cisco/credentials.ini similarity index 100% rename from plugins/cisco-plugin/etc/credentials.ini rename to etc/quantum/plugins/cisco/credentials.ini diff --git a/plugins/cisco-plugin/etc/db_conn.ini b/etc/quantum/plugins/cisco/db_conn.ini similarity index 100% rename from plugins/cisco-plugin/etc/db_conn.ini rename to etc/quantum/plugins/cisco/db_conn.ini diff --git a/plugins/cisco-plugin/etc/l2network_plugin.ini b/etc/quantum/plugins/cisco/l2network_plugin.ini similarity index 100% rename from plugins/cisco-plugin/etc/l2network_plugin.ini rename to etc/quantum/plugins/cisco/l2network_plugin.ini diff --git a/plugins/cisco-plugin/etc/nexus.ini b/etc/quantum/plugins/cisco/nexus.ini similarity index 100% rename from plugins/cisco-plugin/etc/nexus.ini rename to etc/quantum/plugins/cisco/nexus.ini diff --git a/plugins/cisco-plugin/etc/quantum.conf.ciscoext b/etc/quantum/plugins/cisco/quantum.conf.ciscoext similarity index 100% rename from plugins/cisco-plugin/etc/quantum.conf.ciscoext rename to etc/quantum/plugins/cisco/quantum.conf.ciscoext diff --git a/plugins/cisco-plugin/etc/ucs.ini b/etc/quantum/plugins/cisco/ucs.ini similarity index 100% rename from plugins/cisco-plugin/etc/ucs.ini rename to etc/quantum/plugins/cisco/ucs.ini diff --git a/plugins/cisco-plugin/etc/ucs_inventory.ini b/etc/quantum/plugins/cisco/ucs_inventory.ini similarity index 100% rename from plugins/cisco-plugin/etc/ucs_inventory.ini rename to etc/quantum/plugins/cisco/ucs_inventory.ini diff --git a/plugins/openvswitch-plugin/etc/ovs_quantum_plugin.ini b/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini similarity index 100% rename from plugins/openvswitch-plugin/etc/ovs_quantum_plugin.ini rename to etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini diff --git a/plugins/cisco-plugin/MANIFEST.in b/plugins/cisco-plugin/MANIFEST.in deleted file mode 100644 index 8f082901d0..0000000000 --- a/plugins/cisco-plugin/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include etc/* diff --git a/plugins/cisco-plugin/lib/quantum/__init__.py b/plugins/cisco-plugin/lib/quantum/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/cisco-plugin/lib/quantum/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/cisco-plugin/lib/quantum/plugins/__init__.py b/plugins/cisco-plugin/lib/quantum/plugins/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/cisco-plugin/lib/quantum/plugins/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/__init__.py b/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/__init__.py deleted file mode 100644 index 383dfaa982..0000000000 --- a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 -# -# Copyright 2011 Cisco Systems, Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# @author: Sumit Naiksatam, Cisco Systems, Inc. -# -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/openvswitch-plugin/MANIFEST.in b/plugins/openvswitch-plugin/MANIFEST.in deleted file mode 100644 index 8f082901d0..0000000000 --- a/plugins/openvswitch-plugin/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include etc/* diff --git a/plugins/openvswitch-plugin/lib/quantum/__init__.py b/plugins/openvswitch-plugin/lib/quantum/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/openvswitch-plugin/lib/quantum/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/__init__.py b/plugins/openvswitch-plugin/lib/quantum/plugins/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/openvswitch-plugin/lib/quantum/plugins/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/__init__.py b/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/unit/__init__.py b/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/unit/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/unit/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/sample-plugin/lib/quantum/__init__.py b/plugins/sample-plugin/lib/quantum/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/sample-plugin/lib/quantum/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/sample-plugin/lib/quantum/plugins/__init__.py b/plugins/sample-plugin/lib/quantum/plugins/__init__.py deleted file mode 100644 index d407605e19..0000000000 --- a/plugins/sample-plugin/lib/quantum/plugins/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/plugins/sample-plugin/setup.py b/plugins/sample-plugin/setup.py deleted file mode 100644 index 2ed20c5949..0000000000 --- a/plugins/sample-plugin/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup, find_packages - -Name = 'quantum-sample-plugin' -ProjecUrl = "https://launchpad.net/quantum" -Version = '2012.1dev' -License = 'Apache License 2.0' -# Change as required -Author = 'Netstack' -AuthorEmail = 'netstack@lists.launchpad.net' -Maintainer = '' -Summary = 'Sample functionalities for Quantum' -ShortDescription = Summary -Description = Summary - -requires = [ - 'quantum-common', - 'quantum-server', -] - -EagerResources = [ - 'quantum', -] - -ProjectScripts = [ -] - -PackageData = { -} - -DataFiles = [ -] - -setup( - name=Name, - version=Version, - author=Author, - author_email=AuthorEmail, - description=ShortDescription, - long_description=Description, - license=License, - scripts=ProjectScripts, - install_requires=requires, - include_package_data=True, - packages=find_packages('lib'), - package_data=PackageData, - data_files=DataFiles, - package_dir={'': 'lib'}, - eager_resources=EagerResources, - namespace_packages=['quantum'], -) diff --git a/common/README b/quantum/README similarity index 100% rename from common/README rename to quantum/README diff --git a/client/lib/__init__.py b/quantum/__init__.py similarity index 100% rename from client/lib/__init__.py rename to quantum/__init__.py diff --git a/server/lib/quantum/api/__init__.py b/quantum/api/__init__.py similarity index 100% rename from server/lib/quantum/api/__init__.py rename to quantum/api/__init__.py diff --git a/server/lib/quantum/api/api_common.py b/quantum/api/api_common.py similarity index 100% rename from server/lib/quantum/api/api_common.py rename to quantum/api/api_common.py diff --git a/server/lib/quantum/api/attachments.py b/quantum/api/attachments.py similarity index 100% rename from server/lib/quantum/api/attachments.py rename to quantum/api/attachments.py diff --git a/server/lib/quantum/api/faults.py b/quantum/api/faults.py similarity index 100% rename from server/lib/quantum/api/faults.py rename to quantum/api/faults.py diff --git a/server/lib/quantum/api/networks.py b/quantum/api/networks.py similarity index 100% rename from server/lib/quantum/api/networks.py rename to quantum/api/networks.py diff --git a/server/lib/quantum/api/ports.py b/quantum/api/ports.py similarity index 100% rename from server/lib/quantum/api/ports.py rename to quantum/api/ports.py diff --git a/server/lib/quantum/api/versions.py b/quantum/api/versions.py similarity index 100% rename from server/lib/quantum/api/versions.py rename to quantum/api/versions.py diff --git a/server/lib/quantum/api/views/__init__.py b/quantum/api/views/__init__.py similarity index 100% rename from server/lib/quantum/api/views/__init__.py rename to quantum/api/views/__init__.py diff --git a/server/lib/quantum/api/views/attachments.py b/quantum/api/views/attachments.py similarity index 100% rename from server/lib/quantum/api/views/attachments.py rename to quantum/api/views/attachments.py diff --git a/server/lib/quantum/api/views/networks.py b/quantum/api/views/networks.py similarity index 100% rename from server/lib/quantum/api/views/networks.py rename to quantum/api/views/networks.py diff --git a/server/lib/quantum/api/views/ports.py b/quantum/api/views/ports.py similarity index 100% rename from server/lib/quantum/api/views/ports.py rename to quantum/api/views/ports.py diff --git a/server/lib/quantum/api/views/versions.py b/quantum/api/views/versions.py similarity index 100% rename from server/lib/quantum/api/views/versions.py rename to quantum/api/views/versions.py diff --git a/client/lib/quantum/client.py b/quantum/client/__init__.py similarity index 100% rename from client/lib/quantum/client.py rename to quantum/client/__init__.py diff --git a/client/lib/quantum/cli.py b/quantum/client/cli.py similarity index 99% rename from client/lib/quantum/cli.py rename to quantum/client/cli.py index 8509d1ae51..bc06771787 100755 --- a/client/lib/quantum/cli.py +++ b/quantum/client/cli.py @@ -36,7 +36,7 @@ if os.path.exists(os.path.join(possible_topdir, 'quantum', '__init__.py')): gettext.install('quantum', unicode=1) -from quantum import cli_lib +from quantum.client import cli_lib from quantum.client import Client #Configure logger for client - cli logger is a child of it diff --git a/client/lib/quantum/cli_lib.py b/quantum/client/cli_lib.py similarity index 99% rename from client/lib/quantum/cli_lib.py rename to quantum/client/cli_lib.py index dcdf908814..d7d87748fa 100755 --- a/client/lib/quantum/cli_lib.py +++ b/quantum/client/cli_lib.py @@ -26,7 +26,7 @@ import os import sys FORMAT = "json" -LOG = logging.getLogger('quantum.cli_lib') +LOG = logging.getLogger('quantum.client.cli_lib') class OutputTemplate(object): diff --git a/common/lib/quantum/common/__init__.py b/quantum/common/__init__.py similarity index 100% rename from common/lib/quantum/common/__init__.py rename to quantum/common/__init__.py diff --git a/common/lib/quantum/common/config.py b/quantum/common/config.py similarity index 100% rename from common/lib/quantum/common/config.py rename to quantum/common/config.py diff --git a/common/lib/quantum/common/exceptions.py b/quantum/common/exceptions.py similarity index 100% rename from common/lib/quantum/common/exceptions.py rename to quantum/common/exceptions.py diff --git a/common/lib/quantum/common/extensions.py b/quantum/common/extensions.py similarity index 100% rename from common/lib/quantum/common/extensions.py rename to quantum/common/extensions.py diff --git a/common/lib/quantum/common/flags.py b/quantum/common/flags.py similarity index 100% rename from common/lib/quantum/common/flags.py rename to quantum/common/flags.py diff --git a/common/lib/quantum/common/serializer.py b/quantum/common/serializer.py similarity index 100% rename from common/lib/quantum/common/serializer.py rename to quantum/common/serializer.py diff --git a/common/lib/quantum/common/test_lib.py b/quantum/common/test_lib.py similarity index 99% rename from common/lib/quantum/common/test_lib.py rename to quantum/common/test_lib.py index d31c885c37..ad08a5998c 100644 --- a/common/lib/quantum/common/test_lib.py +++ b/quantum/common/test_lib.py @@ -283,5 +283,5 @@ def run_tests(c=None): # and override the values in it if needed (e.g., run_tests.py in # quantum/plugins/openvswitch/ ) test_config = { - "plugin_name": "quantum.plugins.SamplePlugin.FakePlugin", + "plugin_name": "quantum.plugins.sample.SamplePlugin.FakePlugin", } diff --git a/common/lib/quantum/common/utils.py b/quantum/common/utils.py similarity index 100% rename from common/lib/quantum/common/utils.py rename to quantum/common/utils.py diff --git a/server/lib/quantum/db/__init__.py b/quantum/db/__init__.py similarity index 100% rename from server/lib/quantum/db/__init__.py rename to quantum/db/__init__.py diff --git a/server/lib/quantum/db/api.py b/quantum/db/api.py similarity index 100% rename from server/lib/quantum/db/api.py rename to quantum/db/api.py diff --git a/server/lib/quantum/db/models.py b/quantum/db/models.py similarity index 100% rename from server/lib/quantum/db/models.py rename to quantum/db/models.py diff --git a/server/lib/quantum/extensions/__init__.py b/quantum/extensions/__init__.py similarity index 100% rename from server/lib/quantum/extensions/__init__.py rename to quantum/extensions/__init__.py diff --git a/server/lib/quantum/extensions/_credential_view.py b/quantum/extensions/_credential_view.py similarity index 100% rename from server/lib/quantum/extensions/_credential_view.py rename to quantum/extensions/_credential_view.py diff --git a/server/lib/quantum/extensions/_novatenant_view.py b/quantum/extensions/_novatenant_view.py similarity index 100% rename from server/lib/quantum/extensions/_novatenant_view.py rename to quantum/extensions/_novatenant_view.py diff --git a/server/lib/quantum/extensions/_pprofiles.py b/quantum/extensions/_pprofiles.py similarity index 100% rename from server/lib/quantum/extensions/_pprofiles.py rename to quantum/extensions/_pprofiles.py diff --git a/server/lib/quantum/extensions/_qos_view.py b/quantum/extensions/_qos_view.py similarity index 100% rename from server/lib/quantum/extensions/_qos_view.py rename to quantum/extensions/_qos_view.py diff --git a/server/lib/quantum/extensions/credential.py b/quantum/extensions/credential.py similarity index 100% rename from server/lib/quantum/extensions/credential.py rename to quantum/extensions/credential.py diff --git a/server/lib/quantum/extensions/multiport.py b/quantum/extensions/multiport.py similarity index 100% rename from server/lib/quantum/extensions/multiport.py rename to quantum/extensions/multiport.py diff --git a/server/lib/quantum/extensions/novatenant.py b/quantum/extensions/novatenant.py similarity index 100% rename from server/lib/quantum/extensions/novatenant.py rename to quantum/extensions/novatenant.py diff --git a/server/lib/quantum/extensions/portprofile.py b/quantum/extensions/portprofile.py similarity index 100% rename from server/lib/quantum/extensions/portprofile.py rename to quantum/extensions/portprofile.py diff --git a/server/lib/quantum/extensions/qos.py b/quantum/extensions/qos.py similarity index 100% rename from server/lib/quantum/extensions/qos.py rename to quantum/extensions/qos.py diff --git a/server/lib/quantum/manager.py b/quantum/manager.py similarity index 100% rename from server/lib/quantum/manager.py rename to quantum/manager.py diff --git a/common/lib/__init__.py b/quantum/plugins/__init__.py similarity index 100% rename from common/lib/__init__.py rename to quantum/plugins/__init__.py diff --git a/plugins/cisco-plugin/README b/quantum/plugins/cisco/README similarity index 100% rename from plugins/cisco-plugin/README rename to quantum/plugins/cisco/README diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/__init__.py b/quantum/plugins/cisco/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/__init__.py rename to quantum/plugins/cisco/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/client/cli.py b/quantum/plugins/cisco/client/cli.py similarity index 99% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/client/cli.py rename to quantum/plugins/cisco/client/cli.py index 5517eb83b6..0c0b9dbb3e 100644 --- a/plugins/cisco-plugin/lib/quantum/plugins/cisco/client/cli.py +++ b/quantum/plugins/cisco/client/cli.py @@ -36,8 +36,7 @@ import subprocess from optparse import OptionParser -from tools import source_environment -import quantum.cli as qcli +import quantum.client.cli as qcli POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/common/__init__.py b/quantum/plugins/cisco/common/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/common/__init__.py rename to quantum/plugins/cisco/common/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_configparser.py b/quantum/plugins/cisco/common/cisco_configparser.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_configparser.py rename to quantum/plugins/cisco/common/cisco_configparser.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_constants.py b/quantum/plugins/cisco/common/cisco_constants.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_constants.py rename to quantum/plugins/cisco/common/cisco_constants.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_credentials.py b/quantum/plugins/cisco/common/cisco_credentials.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_credentials.py rename to quantum/plugins/cisco/common/cisco_credentials.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_exceptions.py b/quantum/plugins/cisco/common/cisco_exceptions.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_exceptions.py rename to quantum/plugins/cisco/common/cisco_exceptions.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_faults.py b/quantum/plugins/cisco/common/cisco_faults.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_faults.py rename to quantum/plugins/cisco/common/cisco_faults.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_utils.py b/quantum/plugins/cisco/common/cisco_utils.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/common/cisco_utils.py rename to quantum/plugins/cisco/common/cisco_utils.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/__init__.py b/quantum/plugins/cisco/db/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/__init__.py rename to quantum/plugins/cisco/db/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/api.py b/quantum/plugins/cisco/db/api.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/api.py rename to quantum/plugins/cisco/db/api.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/l2network_db.py b/quantum/plugins/cisco/db/l2network_db.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/l2network_db.py rename to quantum/plugins/cisco/db/l2network_db.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/l2network_models.py b/quantum/plugins/cisco/db/l2network_models.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/l2network_models.py rename to quantum/plugins/cisco/db/l2network_models.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/models.py b/quantum/plugins/cisco/db/models.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/models.py rename to quantum/plugins/cisco/db/models.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/nexus_db.py b/quantum/plugins/cisco/db/nexus_db.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/nexus_db.py rename to quantum/plugins/cisco/db/nexus_db.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/nexus_models.py b/quantum/plugins/cisco/db/nexus_models.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/nexus_models.py rename to quantum/plugins/cisco/db/nexus_models.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/ucs_db.py b/quantum/plugins/cisco/db/ucs_db.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/ucs_db.py rename to quantum/plugins/cisco/db/ucs_db.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/db/ucs_models.py b/quantum/plugins/cisco/db/ucs_models.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/db/ucs_models.py rename to quantum/plugins/cisco/db/ucs_models.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/l2device_inventory_base.py b/quantum/plugins/cisco/l2device_inventory_base.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/l2device_inventory_base.py rename to quantum/plugins/cisco/l2device_inventory_base.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/l2device_plugin_base.py b/quantum/plugins/cisco/l2device_plugin_base.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/l2device_plugin_base.py rename to quantum/plugins/cisco/l2device_plugin_base.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_model_base.py b/quantum/plugins/cisco/l2network_model_base.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_model_base.py rename to quantum/plugins/cisco/l2network_model_base.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_plugin.py b/quantum/plugins/cisco/l2network_plugin.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_plugin.py rename to quantum/plugins/cisco/l2network_plugin.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_plugin_configuration.py b/quantum/plugins/cisco/l2network_plugin_configuration.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_plugin_configuration.py rename to quantum/plugins/cisco/l2network_plugin_configuration.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_segmentation_base.py b/quantum/plugins/cisco/l2network_segmentation_base.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/l2network_segmentation_base.py rename to quantum/plugins/cisco/l2network_segmentation_base.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/models/__init__.py b/quantum/plugins/cisco/models/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/models/__init__.py rename to quantum/plugins/cisco/models/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/models/l2network_multi_blade.py b/quantum/plugins/cisco/models/l2network_multi_blade.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/models/l2network_multi_blade.py rename to quantum/plugins/cisco/models/l2network_multi_blade.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/models/l2network_single_blade.py b/quantum/plugins/cisco/models/l2network_single_blade.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/models/l2network_single_blade.py rename to quantum/plugins/cisco/models/l2network_single_blade.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/__init__.py b/quantum/plugins/cisco/nexus/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/__init__.py rename to quantum/plugins/cisco/nexus/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_configuration.py b/quantum/plugins/cisco/nexus/cisco_nexus_configuration.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_configuration.py rename to quantum/plugins/cisco/nexus/cisco_nexus_configuration.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_network_driver.py b/quantum/plugins/cisco/nexus/cisco_nexus_network_driver.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_network_driver.py rename to quantum/plugins/cisco/nexus/cisco_nexus_network_driver.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_plugin.py b/quantum/plugins/cisco/nexus/cisco_nexus_plugin.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_plugin.py rename to quantum/plugins/cisco/nexus/cisco_nexus_plugin.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_snippets.py b/quantum/plugins/cisco/nexus/cisco_nexus_snippets.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nexus/cisco_nexus_snippets.py rename to quantum/plugins/cisco/nexus/cisco_nexus_snippets.py diff --git a/plugins/cisco-plugin/lib/__init__.py b/quantum/plugins/cisco/nova/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/__init__.py rename to quantum/plugins/cisco/nova/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py b/quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py rename to quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nova/vifdirect.py b/quantum/plugins/cisco/nova/vifdirect.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nova/vifdirect.py rename to quantum/plugins/cisco/nova/vifdirect.py diff --git a/plugins/cisco-plugin/pip-requires b/quantum/plugins/cisco/pip-requires similarity index 100% rename from plugins/cisco-plugin/pip-requires rename to quantum/plugins/cisco/pip-requires diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/run_tests.py b/quantum/plugins/cisco/run_tests.py similarity index 97% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/run_tests.py rename to quantum/plugins/cisco/run_tests.py index 37651ce4d1..b032e1cab5 100644 --- a/plugins/cisco-plugin/lib/quantum/plugins/cisco/run_tests.py +++ b/quantum/plugins/cisco/run_tests.py @@ -32,7 +32,6 @@ from nose import core sys.path.append(os.getcwd()) -import tools.source_environment from quantum.common.test_lib import run_tests import quantum.plugins.cisco.tests.unit diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/segmentation/__init__.py b/quantum/plugins/cisco/segmentation/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/segmentation/__init__.py rename to quantum/plugins/cisco/segmentation/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/segmentation/l2network_vlan_mgr.py b/quantum/plugins/cisco/segmentation/l2network_vlan_mgr.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/segmentation/l2network_vlan_mgr.py rename to quantum/plugins/cisco/segmentation/l2network_vlan_mgr.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/nova/__init__.py b/quantum/plugins/cisco/tests/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/nova/__init__.py rename to quantum/plugins/cisco/tests/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/__init__.py b/quantum/plugins/cisco/tests/unit/__init__.py similarity index 85% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/__init__.py rename to quantum/plugins/cisco/tests/unit/__init__.py index 726786924d..50375f4054 100644 --- a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/__init__.py +++ b/quantum/plugins/cisco/tests/unit/__init__.py @@ -17,11 +17,6 @@ # See http://code.google.com/p/python-nose/issues/detail?id=373 # The code below enables nosetests to work with i18n _() blocks -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) import __builtin__ import unittest diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_cisco_extension.py b/quantum/plugins/cisco/tests/unit/test_cisco_extension.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_cisco_extension.py rename to quantum/plugins/cisco/tests/unit/test_cisco_extension.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_database.py b/quantum/plugins/cisco/tests/unit/test_database.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_database.py rename to quantum/plugins/cisco/tests/unit/test_database.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_l2networkApi.py b/quantum/plugins/cisco/tests/unit/test_l2networkApi.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_l2networkApi.py rename to quantum/plugins/cisco/tests/unit/test_l2networkApi.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_l2network_multi_blade.py b/quantum/plugins/cisco/tests/unit/test_l2network_multi_blade.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_l2network_multi_blade.py rename to quantum/plugins/cisco/tests/unit/test_l2network_multi_blade.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_nexus_plugin.py b/quantum/plugins/cisco/tests/unit/test_nexus_plugin.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_nexus_plugin.py rename to quantum/plugins/cisco/tests/unit/test_nexus_plugin.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_ucs_driver.py b/quantum/plugins/cisco/tests/unit/test_ucs_driver.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_ucs_driver.py rename to quantum/plugins/cisco/tests/unit/test_ucs_driver.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_ucs_inventory.py b/quantum/plugins/cisco/tests/unit/test_ucs_inventory.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_ucs_inventory.py rename to quantum/plugins/cisco/tests/unit/test_ucs_inventory.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_ucs_plugin.py b/quantum/plugins/cisco/tests/unit/test_ucs_plugin.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_ucs_plugin.py rename to quantum/plugins/cisco/tests/unit/test_ucs_plugin.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_vlan_mgr.py b/quantum/plugins/cisco/tests/unit/test_vlan_mgr.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/tests/unit/test_vlan_mgr.py rename to quantum/plugins/cisco/tests/unit/test_vlan_mgr.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/__init__.py b/quantum/plugins/cisco/ucs/__init__.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/__init__.py rename to quantum/plugins/cisco/ucs/__init__.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_getvif.py b/quantum/plugins/cisco/ucs/cisco_getvif.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_getvif.py rename to quantum/plugins/cisco/ucs/cisco_getvif.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_configuration.py b/quantum/plugins/cisco/ucs/cisco_ucs_configuration.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_configuration.py rename to quantum/plugins/cisco/ucs/cisco_ucs_configuration.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_inventory.py b/quantum/plugins/cisco/ucs/cisco_ucs_inventory.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_inventory.py rename to quantum/plugins/cisco/ucs/cisco_ucs_inventory.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_inventory_configuration.py b/quantum/plugins/cisco/ucs/cisco_ucs_inventory_configuration.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_inventory_configuration.py rename to quantum/plugins/cisco/ucs/cisco_ucs_inventory_configuration.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_network_driver.py b/quantum/plugins/cisco/ucs/cisco_ucs_network_driver.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_network_driver.py rename to quantum/plugins/cisco/ucs/cisco_ucs_network_driver.py diff --git a/plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_plugin.py b/quantum/plugins/cisco/ucs/cisco_ucs_plugin.py similarity index 100% rename from plugins/cisco-plugin/lib/quantum/plugins/cisco/ucs/cisco_ucs_plugin.py rename to quantum/plugins/cisco/ucs/cisco_ucs_plugin.py diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/Makefile b/quantum/plugins/openvswitch/Makefile similarity index 100% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/Makefile rename to quantum/plugins/openvswitch/Makefile diff --git a/plugins/openvswitch-plugin/README b/quantum/plugins/openvswitch/README similarity index 100% rename from plugins/openvswitch-plugin/README rename to quantum/plugins/openvswitch/README diff --git a/plugins/openvswitch-plugin/lib/__init__.py b/quantum/plugins/openvswitch/__init__.py similarity index 100% rename from plugins/openvswitch-plugin/lib/__init__.py rename to quantum/plugins/openvswitch/__init__.py diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py b/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py similarity index 100% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py rename to quantum/plugins/openvswitch/agent/ovs_quantum_agent.py diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/agent/xenserver_install.sh b/quantum/plugins/openvswitch/agent/xenserver_install.sh similarity index 100% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/agent/xenserver_install.sh rename to quantum/plugins/openvswitch/agent/xenserver_install.sh diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/ovs_db.py b/quantum/plugins/openvswitch/ovs_db.py similarity index 100% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/ovs_db.py rename to quantum/plugins/openvswitch/ovs_db.py diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/ovs_models.py b/quantum/plugins/openvswitch/ovs_models.py similarity index 100% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/ovs_models.py rename to quantum/plugins/openvswitch/ovs_models.py diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/ovs_quantum_plugin.py b/quantum/plugins/openvswitch/ovs_quantum_plugin.py similarity index 98% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/ovs_quantum_plugin.py rename to quantum/plugins/openvswitch/ovs_quantum_plugin.py index c164c258f9..d823d9ef3d 100644 --- a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/ovs_quantum_plugin.py +++ b/quantum/plugins/openvswitch/ovs_quantum_plugin.py @@ -30,7 +30,9 @@ from quantum.quantum_plugin_base import QuantumPluginBase import quantum.db.api as db import ovs_db -CONF_FILE = find_config_file({}, None, "ovs_quantum_plugin.ini") +CONF_FILE = find_config_file( + {"config_file": "etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini"}, + None, "ovs_quantum_plugin.ini") LOG.basicConfig(level=LOG.WARN) LOG.getLogger("ovs_quantum_plugin") diff --git a/plugins/openvswitch-plugin/pip-requires b/quantum/plugins/openvswitch/pip-requires similarity index 100% rename from plugins/openvswitch-plugin/pip-requires rename to quantum/plugins/openvswitch/pip-requires diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/run_tests.py b/quantum/plugins/openvswitch/run_tests.py similarity index 69% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/run_tests.py rename to quantum/plugins/openvswitch/run_tests.py index 03906d8539..0377dd8943 100644 --- a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/run_tests.py +++ b/quantum/plugins/openvswitch/run_tests.py @@ -21,28 +21,8 @@ This file should be run from the top dir in the quantum directory -To run all test:: - python quantum/plugins/openvswitch/run_tests.py - -To run all unit tests:: - python quantum/plugins/openvswitch/run_tests.py unit - -To run all functional tests:: - python quantum/plugins/openvswitch/run_tests.py functional - -To run a single unit test:: - python quantum/plugins/openvswitch/run_tests.py \ - unit.test_stores:TestSwiftBackend.test_get - -To run a single functional test:: - python quantum/plugins/openvswitch/run_tests.py \ - functional.test_service:TestController.test_create - -To run a single unit test module:: - python quantum/plugins/openvswitch/run_tests.py unit.test_stores - -To run a single functional test module:: - python quantum/plugins/openvswitch/run_tests.py functional.test_stores +To run all tests:: + PLUGIN_DIR=quantum/plugins/openvswitch ./run_tests.sh """ import gettext @@ -57,7 +37,6 @@ from nose import core sys.path.append(os.getcwd()) sys.path.append(os.path.dirname(__file__)) -import tools.source_nonplugin_environment import quantum.tests.unit from quantum.common.test_lib import run_tests, test_config @@ -87,8 +66,7 @@ if __name__ == '__main__': os.chdir(cwd) - working_dir = os.path.abspath("plugins/openvswitch-plugin/" + - "lib/quantum/plugins/openvswitch") + working_dir = os.path.abspath("quantum/plugins/openvswitch") c = config.Config(stream=sys.stdout, env=os.environ, verbosity=3, diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/__init__.py b/quantum/plugins/openvswitch/tests/__init__.py similarity index 100% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/__init__.py rename to quantum/plugins/openvswitch/tests/__init__.py diff --git a/plugins/sample-plugin/lib/__init__.py b/quantum/plugins/openvswitch/tests/unit/__init__.py similarity index 100% rename from plugins/sample-plugin/lib/__init__.py rename to quantum/plugins/openvswitch/tests/unit/__init__.py diff --git a/plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/unit/test_vlan_map.py b/quantum/plugins/openvswitch/tests/unit/test_vlan_map.py similarity index 100% rename from plugins/openvswitch-plugin/lib/quantum/plugins/openvswitch/tests/unit/test_vlan_map.py rename to quantum/plugins/openvswitch/tests/unit/test_vlan_map.py diff --git a/plugins/sample-plugin/lib/quantum/plugins/SamplePlugin.py b/quantum/plugins/sample/SamplePlugin.py similarity index 99% rename from plugins/sample-plugin/lib/quantum/plugins/SamplePlugin.py rename to quantum/plugins/sample/SamplePlugin.py index 156347259f..2f5626609d 100644 --- a/plugins/sample-plugin/lib/quantum/plugins/SamplePlugin.py +++ b/quantum/plugins/sample/SamplePlugin.py @@ -21,7 +21,7 @@ import logging from quantum.common import exceptions as exc from quantum.db import api as db -LOG = logging.getLogger('quantum.plugins.SamplePlugin') +LOG = logging.getLogger('quantum.plugins.sample.SamplePlugin') class QuantumEchoPlugin(object): diff --git a/server/lib/__init__.py b/quantum/plugins/sample/__init__.py similarity index 100% rename from server/lib/__init__.py rename to quantum/plugins/sample/__init__.py diff --git a/server/lib/quantum/quantum_plugin_base.py b/quantum/quantum_plugin_base.py similarity index 100% rename from server/lib/quantum/quantum_plugin_base.py rename to quantum/quantum_plugin_base.py diff --git a/server/lib/quantum/server.py b/quantum/server/__init__.py similarity index 100% rename from server/lib/quantum/server.py rename to quantum/server/__init__.py diff --git a/server/lib/quantum/service.py b/quantum/service.py similarity index 100% rename from server/lib/quantum/service.py rename to quantum/service.py diff --git a/client/lib/quantum/tests/__init__.py b/quantum/tests/__init__.py similarity index 100% rename from client/lib/quantum/tests/__init__.py rename to quantum/tests/__init__.py diff --git a/server/lib/quantum/tests/unit/__init__.py b/quantum/tests/unit/__init__.py similarity index 85% rename from server/lib/quantum/tests/unit/__init__.py rename to quantum/tests/unit/__init__.py index 726786924d..50375f4054 100644 --- a/server/lib/quantum/tests/unit/__init__.py +++ b/quantum/tests/unit/__init__.py @@ -17,11 +17,6 @@ # See http://code.google.com/p/python-nose/issues/detail?id=373 # The code below enables nosetests to work with i18n _() blocks -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) import __builtin__ import unittest diff --git a/server/lib/quantum/tests/unit/client_tools/__init__.py b/quantum/tests/unit/client_tools/__init__.py similarity index 100% rename from server/lib/quantum/tests/unit/client_tools/__init__.py rename to quantum/tests/unit/client_tools/__init__.py diff --git a/server/lib/quantum/tests/unit/client_tools/stubs.py b/quantum/tests/unit/client_tools/stubs.py similarity index 94% rename from server/lib/quantum/tests/unit/client_tools/stubs.py rename to quantum/tests/unit/client_tools/stubs.py index 99f1410d69..34412f53e5 100644 --- a/server/lib/quantum/tests/unit/client_tools/stubs.py +++ b/quantum/tests/unit/client_tools/stubs.py @@ -40,8 +40,8 @@ class FakeHTTPConnection: def __init__(self, _1, _2): # Ignore host and port parameters self._req = None - options = \ - dict(plugin_provider='quantum.plugins.SamplePlugin.FakePlugin') + plugin = 'quantum.plugins.sample.SamplePlugin.FakePlugin' + options = dict(plugin_provider=plugin) self._api = server.APIRouterV1(options) def request(self, method, action, body, headers): diff --git a/server/lib/quantum/tests/unit/database_stubs.py b/quantum/tests/unit/database_stubs.py similarity index 100% rename from server/lib/quantum/tests/unit/database_stubs.py rename to quantum/tests/unit/database_stubs.py diff --git a/server/lib/quantum/tests/unit/extension_stubs.py b/quantum/tests/unit/extension_stubs.py similarity index 100% rename from server/lib/quantum/tests/unit/extension_stubs.py rename to quantum/tests/unit/extension_stubs.py diff --git a/server/lib/quantum/tests/unit/extensions/__init__.py b/quantum/tests/unit/extensions/__init__.py similarity index 100% rename from server/lib/quantum/tests/unit/extensions/__init__.py rename to quantum/tests/unit/extensions/__init__.py diff --git a/server/lib/quantum/tests/unit/extensions/foxinsocks.py b/quantum/tests/unit/extensions/foxinsocks.py similarity index 100% rename from server/lib/quantum/tests/unit/extensions/foxinsocks.py rename to quantum/tests/unit/extensions/foxinsocks.py diff --git a/server/lib/quantum/tests/unit/test_api.py b/quantum/tests/unit/test_api.py similarity index 100% rename from server/lib/quantum/tests/unit/test_api.py rename to quantum/tests/unit/test_api.py diff --git a/server/lib/quantum/tests/unit/test_cli.py b/quantum/tests/unit/test_cli.py similarity index 99% rename from server/lib/quantum/tests/unit/test_cli.py rename to quantum/tests/unit/test_cli.py index 6638f06203..37079f8bfa 100644 --- a/server/lib/quantum/tests/unit/test_cli.py +++ b/quantum/tests/unit/test_cli.py @@ -27,7 +27,7 @@ import sys import unittest from quantum import api as server -from quantum import cli_lib as cli +from quantum.client import cli_lib as cli from quantum.client import Client from quantum.db import api as db from quantum.tests.unit.client_tools import stubs as client_stubs @@ -41,7 +41,8 @@ class CLITest(unittest.TestCase): def setUp(self): """Prepare the test environment""" options = {} - options['plugin_provider'] = 'quantum.plugins.SamplePlugin.FakePlugin' + options['plugin_provider'] = \ + 'quantum.plugins.sample.SamplePlugin.FakePlugin' self.api = server.APIRouterV1(options) self.tenant_id = "test_tenant" diff --git a/client/lib/quantum/tests/unit/test_clientlib.py b/quantum/tests/unit/test_clientlib.py similarity index 100% rename from client/lib/quantum/tests/unit/test_clientlib.py rename to quantum/tests/unit/test_clientlib.py diff --git a/server/lib/quantum/tests/unit/test_database.py b/quantum/tests/unit/test_database.py similarity index 100% rename from server/lib/quantum/tests/unit/test_database.py rename to quantum/tests/unit/test_database.py diff --git a/server/lib/quantum/tests/unit/test_extensions.py b/quantum/tests/unit/test_extensions.py similarity index 99% rename from server/lib/quantum/tests/unit/test_extensions.py rename to quantum/tests/unit/test_extensions.py index 0b279f2fc2..532409ed04 100644 --- a/server/lib/quantum/tests/unit/test_extensions.py +++ b/quantum/tests/unit/test_extensions.py @@ -25,7 +25,9 @@ from webtest import TestApp from quantum import wsgi from quantum.common import config from quantum.common import extensions -from quantum.plugins.SamplePlugin import QuantumEchoPlugin +import sys +print sys.path +from quantum.plugins.sample.SamplePlugin import QuantumEchoPlugin from quantum.tests.unit.extension_stubs import (StubExtension, StubPlugin, StubPluginInterface, StubBaseAppController, diff --git a/server/lib/quantum/tests/unit/testlib_api.py b/quantum/tests/unit/testlib_api.py similarity index 100% rename from server/lib/quantum/tests/unit/testlib_api.py rename to quantum/tests/unit/testlib_api.py diff --git a/server/lib/quantum/wsgi.py b/quantum/wsgi.py similarity index 100% rename from server/lib/quantum/wsgi.py rename to quantum/wsgi.py diff --git a/run_tests.py b/run_tests.py old mode 100755 new mode 100644 index 085e565c90..7043196035 --- a/run_tests.py +++ b/run_tests.py @@ -1,5 +1,67 @@ #!/usr/bin/env python -import tools.source_environment -from quantum.run_tests import main as tests +# vim: tabstop=4 shiftwidth=4 softtabstop=4 -tests() +# Copyright 2010 OpenStack, LLC +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Unittest runner for quantum + +To run all test:: + python run_tests.py + +To run all unit tests:: + python run_tests.py unit + +To run all functional tests:: + python run_tests.py functional + +To run a single unit test:: + python run_tests.py unit.test_stores:TestSwiftBackend.test_get + +To run a single functional test:: + python run_tests.py functional.test_service:TestController.test_create + +To run a single unit test module:: + python run_tests.py unit.test_stores + +To run a single functional test module:: + python run_tests.py functional.test_stores +""" + +import gettext +import os +import unittest +import sys + +from quantum.common.test_lib import run_tests +from nose import config +from nose import core + +import quantum.tests.unit + + +def main(): + c = config.Config(stream=sys.stdout, + env=os.environ, + verbosity=3, + includeExe=True, + traverseNamespace=True, + plugins=core.DefaultPluginManager()) + c.configureWhere(quantum.tests.unit.__path__) + sys.exit(run_tests(c)) + +if __name__ == "__main__": + main() diff --git a/run_tests.sh b/run_tests.sh index ef3e3db905..365cde61aa 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -119,7 +119,7 @@ fi # PEP8_EXCLUDE="vcsversion.py,*.pyc" PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --repeat --show-source" -PEP8_INCLUDE="bin/* quantum server client common plugins tools run_tests.py setup.py" +PEP8_INCLUDE="bin/* quantum tools run_tests.py setup.py" RV=0 run_tests && pep8 $PEP8_OPTIONS $PEP8_INCLUDE || RV=1 diff --git a/server/MANIFEST.in b/server/MANIFEST.in deleted file mode 100644 index a42c1a7258..0000000000 --- a/server/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include etc/* -include etc/init.d/* diff --git a/server/etc/plugins.ini b/server/etc/plugins.ini deleted file mode 100644 index 307d2b48d2..0000000000 --- a/server/etc/plugins.ini +++ /dev/null @@ -1,3 +0,0 @@ -[PLUGIN] -# Quantum plugin provider module -provider = quantum.plugins.SamplePlugin.FakePlugin diff --git a/server/lib/quantum/__init__.py b/server/lib/quantum/__init__.py deleted file mode 100644 index 5846cd9f52..0000000000 --- a/server/lib/quantum/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2011 Nicira Networks, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# @author: Somik Behera, Nicira Networks, Inc. -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/server/lib/quantum/tests/__init__.py b/server/lib/quantum/tests/__init__.py deleted file mode 100644 index 9578283b2d..0000000000 --- a/server/lib/quantum/tests/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 OpenStack LLC. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging -logging.basicConfig() diff --git a/setup.py b/setup.py index cdb14e4abc..78334102f8 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,7 @@ from tools import install_venv ROOT = path.abspath(path.dirname(__file__)) CONFIG_PATH = path.abspath('/etc/quantum') BASE_PACKAGES = ['common', 'server', 'client'] -PLUGINS = ['plugins/sample-plugin', 'plugins/cisco-plugin', - 'plugins/openvswitch-plugin'] +PLUGINS = ['sample_plugin', 'openvswitch_plugin', 'cisco_plugin'] RELATIVE = False diff --git a/plugins/cisco-plugin/setup.py b/setup_cisco_plugin.py similarity index 75% rename from plugins/cisco-plugin/setup.py rename to setup_cisco_plugin.py index 8b47f6378e..e9d26a3adf 100644 --- a/plugins/cisco-plugin/setup.py +++ b/setup_cisco_plugin.py @@ -6,12 +6,12 @@ except ImportError: from setuptools import setup, find_packages import sys +import version Name = 'quantum-cisco-plugin' ProjecUrl = "" -Version = '0.1' +Version = version.get_git_version() License = 'Apache License 2.0' -# Change as required Author = 'Cisco Systems' AuthorEmail = '' Maintainer = '' @@ -43,8 +43,12 @@ if [x for x in relative_locations if x in sys.argv]: DataFiles = [ (config_path, - ['etc/credentials.ini', 'etc/l2network_plugin.ini', 'etc/nexus.ini', - 'etc/ucs.ini', 'etc/cisco_plugins.ini', 'etc/db_conn.ini']) + ['etc/quantum/plugins/cisco/credentials.ini', + 'etc/quantum/plugins/cisco/l2network_plugin.ini', + 'etc/quantum/plugins/cisco/nexus.ini', + 'etc/quantum/plugins/cisco/ucs.ini', + 'etc/quantum/plugins/cisco/cisco_plugins.ini', + 'etc/quantum/plugins/cisco/db_conn.ini']) ] setup( @@ -58,15 +62,8 @@ setup( scripts=ProjectScripts, install_requires=requires, include_package_data=True, - packages=find_packages('lib'), + packages=["quantum.plugins.cisco"], package_data=PackageData, data_files=DataFiles, - package_dir={'': 'lib'}, eager_resources=EagerResources, - namespace_packages=['quantum'], - entry_points={ - 'console_scripts': [ - 'quantum-cisco-tests = quantum.plugins.cisco.run_tests:main' - ] - }, ) diff --git a/client/setup.py b/setup_client.py similarity index 85% rename from client/setup.py rename to setup_client.py index 127bd8a508..43591e2036 100644 --- a/client/setup.py +++ b/setup_client.py @@ -5,11 +5,12 @@ except ImportError: use_setuptools() from setuptools import setup, find_packages +import version + Name = 'quantum-client' Url = "https://launchpad.net/quantum" -Version = '2012.1dev' +Version = version.get_git_version() License = 'Apache License 2.0' -# Change as required Author = 'Netstack' AuthorEmail = 'netstack@lists.launchpad.net' Maintainer = '' @@ -43,12 +44,10 @@ setup( license=License, scripts=ProjectScripts, install_requires=requires, - include_package_data=True, - packages=find_packages('lib'), + include_package_data=False, + packages=["quantum.client"], package_data=PackageData, - package_dir={'': 'lib'}, eager_resources=EagerResources, - namespace_packages=['quantum'], entry_points={ 'console_scripts': [ 'quantum = quantum.cli:main' diff --git a/common/setup.py b/setup_common.py similarity index 73% rename from common/setup.py rename to setup_common.py index 37a4cecf1a..3f39b37446 100644 --- a/common/setup.py +++ b/setup_common.py @@ -5,11 +5,12 @@ except ImportError: use_setuptools() from setuptools import setup, find_packages +import version + Name = 'quantum-common' Url = "https://launchpad.net/quantum" -Version = '2012.1dev' +Version = version.get_git_version() License = 'Apache License 2.0' -# Change as required Author = 'Netstack' AuthorEmail = 'netstack@lists.launchpad.net' Maintainer = '' @@ -41,6 +42,11 @@ ProjectScripts = [ PackageData = { } +exclude = ['quantum.client', 'quantum.client.*', 'quantum.server', + 'quantum.server.*', 'quantum.tests', 'quantum.tests.*', + 'quantum.plugins.*'] +pkgs = find_packages('.', exclude=exclude) +pkgs = filter(lambda x: x.startswith("quantum"), pkgs) setup( name=Name, @@ -53,15 +59,9 @@ setup( license=License, scripts=ProjectScripts, install_requires=requires, - include_package_data=True, - packages=find_packages('lib'), + include_package_data=False, + packages=pkgs, package_data=PackageData, - package_dir={'': 'lib'}, eager_resources=EagerResources, - namespace_packages=['quantum'], - entry_points={ - 'console_scripts': [ - 'quantum-tests = quantum.run_tests:main' - ] - }, + entry_points={}, ) diff --git a/plugins/openvswitch-plugin/setup.py b/setup_openvswitch_plugin.py similarity index 88% rename from plugins/openvswitch-plugin/setup.py rename to setup_openvswitch_plugin.py index b52b3f4860..bdaeb0ce15 100644 --- a/plugins/openvswitch-plugin/setup.py +++ b/setup_openvswitch_plugin.py @@ -5,13 +5,14 @@ except ImportError: use_setuptools() from setuptools import setup, find_packages +import version + import sys Name = 'quantum-openvswitch-plugin' ProjecUrl = "" -Version = '0.1' +Version = version.get_git_version() License = 'Apache License 2.0' -# Change as required Author = 'Open vSwitch Team' AuthorEmail = 'discuss@openvswitch.org' Maintainer = '' @@ -43,7 +44,7 @@ if [x for x in relative_locations if x in sys.argv]: DataFiles = [ (config_path, - ['etc/ovs_quantum_plugin.ini']) + ['etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini']) ] setup( @@ -57,10 +58,8 @@ setup( scripts=ProjectScripts, install_requires=requires, include_package_data=True, - packages=find_packages('lib'), + packages=["quantum.plugins.openvswitch"], package_data=PackageData, data_files=DataFiles, - package_dir={'': 'lib'}, eager_resources=EagerResources, - namespace_packages=['quantum'], ) diff --git a/quantum/setup.py b/setup_sample_plugin.py similarity index 77% rename from quantum/setup.py rename to setup_sample_plugin.py index c6e7f027b8..e3e345eb99 100644 --- a/quantum/setup.py +++ b/setup_sample_plugin.py @@ -5,21 +5,23 @@ except ImportError: use_setuptools() from setuptools import setup, find_packages -Name = 'quantum' +import version +import sys + +Name = 'quantum-sample-plugin' +Summary = 'Sample plugin for Quantum' Url = "https://launchpad.net/quantum" -Version = '2012.1dev' +Version = version.get_git_version() License = 'Apache License 2.0' Author = 'Netstack' AuthorEmail = 'netstack@lists.launchpad.net' Maintainer = '' -Summary = 'Layer 2 network as a service for Openstack' ShortDescription = Summary Description = Summary requires = [ 'quantum-common', - 'quantum-client', - 'quantum-server' + 'quantum-server', ] EagerResources = [ @@ -32,11 +34,9 @@ ProjectScripts = [ PackageData = { } - setup( name=Name, version=Version, - url=Url, author=Author, author_email=AuthorEmail, description=ShortDescription, @@ -45,5 +45,7 @@ setup( scripts=ProjectScripts, install_requires=requires, include_package_data=True, + packages=["quantum.plugins.sample"], package_data=PackageData, + eager_resources=EagerResources, ) diff --git a/server/setup.py b/setup_server.py similarity index 69% rename from server/setup.py rename to setup_server.py index c6eeb1733d..c23e5c424b 100644 --- a/server/setup.py +++ b/setup_server.py @@ -7,10 +7,11 @@ except ImportError: import os import sys +import version Name = 'quantum-server' Url = "https://launchpad.net/quantum" -Version = '2012.1dev' +Version = version.get_git_version() License = 'Apache License 2.0' Author = 'Netstatck' AuthorEmail = 'netstack@lists.launchpad.net' @@ -35,7 +36,7 @@ PackageData = { # If we're installing server-wide, use an aboslute path for config # if not, use a relative path -config_path = '/etc/quantum/' +config_path = '/etc/quantum' init_path = '/etc/init.d' relative_locations = ['--user', '--virtualenv', '--venv'] @@ -43,6 +44,22 @@ if [x for x in relative_locations if x in sys.argv]: config_path = 'etc/quantum/' init_path = 'etc/init.d' +import os +from distutils.command.build_py import build_py as _build_py + +class build_py(_build_py): + def find_data_files(self, package, src_dir): + files = [] + for p in _build_py.find_data_files(self, package, src_dir): + if os.path.isdir(p): + files.extend(os.path.join(par,f) + for par,dirs,files in os.walk(p) + for f in files) + else: + files.append(p) + return files + +print "config_path: %s" % config_path DataFiles = [ (config_path, ['etc/quantum.conf', 'etc/quantum.conf.sample', @@ -62,12 +79,11 @@ setup( scripts=ProjectScripts, install_requires=requires, include_package_data=True, - packages=find_packages('lib'), + packages=["quantum.server"], package_data=PackageData, data_files=DataFiles, - package_dir={'': 'lib'}, + package_dir={'quantum': 'quantum'}, eager_resources=EagerResources, - namespace_packages=['quantum'], entry_points={ 'console_scripts': [ 'quantum-server = quantum.server:main' diff --git a/tools/build_debs.sh b/tools/build_debs.sh index 557876349a..2a7e563e42 100755 --- a/tools/build_debs.sh +++ b/tools/build_debs.sh @@ -13,15 +13,10 @@ if [ `id -u` != 0 ]; then fi fi -ls $@/dist/*.rpm >/dev/null 2>&1 +ls dist/*.rpm >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "You must build rpms before building debian packages" exit 1 fi -cd $@ -if [ $? -ne 0 ]; then - echo "Directory $@ doesn't exist -- what do you want me to build?" - exit 1 -fi $FAKEROOT $ALIEN -c -v -d dist/*.noarch.rpm diff --git a/tools/build_rpms.sh b/tools/build_rpms.sh index 7ae6ef7a2e..9775db0deb 100755 --- a/tools/build_rpms.sh +++ b/tools/build_rpms.sh @@ -1,2 +1,2 @@ #!/bin/bash -cd $@ && python setup.py bdist_rpm +python setup_$@.py bdist_rpm diff --git a/tools/source_environment.py b/tools/source_environment.py deleted file mode 100644 index 960225cb8b..0000000000 --- a/tools/source_environment.py +++ /dev/null @@ -1,28 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 Cisco Systems -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# @author: Tyler Smith, Cisco Systems -import os -import sys - -# To run from the source code, we need to add the various packages -# to our path so we can find all of the modules correctly -packages = ['common', 'server', 'client'] -plugins = ["plugins/%s" % p for p in - os.listdir(os.path.join(os.getcwd(), 'plugins'))] - -for project in packages + plugins: - sys.path.insert(0, os.path.join(os.getcwd(), project, 'lib')) diff --git a/tools/source_nonplugin_environment.py b/tools/source_nonplugin_environment.py deleted file mode 100644 index 0891c2f709..0000000000 --- a/tools/source_nonplugin_environment.py +++ /dev/null @@ -1,26 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# Copyright 2011 Cisco Systems -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# @author: Tyler Smith, Cisco Systems -import os -import sys - -# To run from the source code, we need to add the various packages -# to our path so we can find all of the modules correctly -packages = ['common', 'server', 'client'] - -for project in packages + ["plugins/sample-plugin"]: - sys.path.insert(0, os.path.join(os.getcwd(), project, 'lib')) diff --git a/version.py b/version.py new file mode 100644 index 0000000000..46bf34a592 --- /dev/null +++ b/version.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +# Author: Douglas Creager +# This file is placed into the public domain. + +# Calculates the current version number. If possible, this is the +# output of “git describe”, modified to conform to the versioning +# scheme that setuptools uses. If “git describe” returns an error +# (most likely because we're in an unpacked copy of a release tarball, +# rather than in a git working copy), then we fall back on reading the +# contents of the RELEASE-VERSION file. +# +# To use this script, simply import it your setup.py file, and use the +# results of get_git_version() as your package version: +# +# from version import * +# +# setup( +# version=get_git_version(), +# . +# . +# . +# ) +# +# This will automatically update the RELEASE-VERSION file, if +# necessary. Note that the RELEASE-VERSION file should *not* be +# checked into git; please add it to your top-level .gitignore file. +# +# You'll probably want to distribute the RELEASE-VERSION file in your +# sdist tarballs; to do this, just create a MANIFEST.in file that +# contains the following line: +# +# include RELEASE-VERSION + +__all__ = ("get_git_version") + +from subprocess import Popen, PIPE + +FALLBACK_VERSION="2012.1dev" + +def call_git_describe(abbrev=4): + try: + p = Popen(['git', 'describe', '--abbrev=%d' % abbrev], + stdout=PIPE, stderr=PIPE) + p.stderr.close() + line = p.stdout.readlines()[0] + return line.strip() + except: + return FALLBACK_VERSION + + +def read_release_version(): + try: + f = open("RELEASE-VERSION", "r") + + try: + version = f.readlines()[0] + return version.strip() + + finally: + f.close() + + except: + return None + + +def write_release_version(version): + f = open("RELEASE-VERSION", "w") + f.write("%s\n" % version) + f.close() + + +def get_git_version(abbrev=4): + # Read in the version that's currently in RELEASE-VERSION. + + release_version = read_release_version() + + # First try to get the current version using “git describe”. + + version = call_git_describe(abbrev) + + # If that doesn't work, fall back on the value that's in + # RELEASE-VERSION. + + if version is None: + version = release_version + + # If we still don't have anything, that's an error. + + if version is None: + raise ValueError("Cannot find the version number!") + + # If the current version is different from what's in the + # RELEASE-VERSION file, update the file to be current. + + if version != release_version: + write_release_version(version) + + # Finally, return the current version. + + return version + + +if __name__ == "__main__": + print get_git_version()