From ee3fe4e836ca1c81e50a8324a9b5f982de4fa97f Mon Sep 17 00:00:00 2001 From: Mark McClain Date: Wed, 3 Jul 2013 19:39:46 -0400 Subject: [PATCH] Rename Quantum to Neutron This change renames everything to Neutron while providing backwards compatible adjustments for Grizzly configuration files. implements blueprint: remove-use-of-quantum Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19 --- .bzrignore | 5 + .gitignore | 3 + .pylintrc | 3 +- .testr.conf | 2 +- HACKING.rst | 30 +- MANIFEST.in | 10 +- README.rst | 16 +- TESTING | 12 +- bin/neutron-dhcp-agent-dnsmasq-lease-update | 20 ++ bin/neutron-rootwrap | 133 ++++++++ bin/quantum-check-nvp-config | 2 +- bin/quantum-db-manage | 2 +- bin/quantum-debug | 2 +- bin/quantum-dhcp-agent | 2 +- bin/quantum-dhcp-agent-dnsmasq-lease-update | 2 +- bin/quantum-hyperv-agent | 2 +- bin/quantum-l3-agent | 2 +- bin/quantum-lbaas-agent | 2 +- bin/quantum-linuxbridge-agent | 2 +- bin/quantum-metadata-agent | 2 +- bin/quantum-mlnx-agent | 2 +- bin/quantum-nec-agent | 2 +- bin/quantum-netns-cleanup | 2 +- bin/quantum-ns-metadata-proxy | 2 +- bin/quantum-openvswitch-agent | 2 +- bin/quantum-ovs-cleanup | 2 +- bin/quantum-rootwrap | 22 +- bin/quantum-rpc-zmq-receiver | 14 +- bin/quantum-ryu-agent | 2 +- bin/quantum-server | 2 +- bin/quantum-usage-audit | 12 +- doc/pom.xml | 16 +- doc/source/conf.py | 22 +- doc/source/devref/common.rst | 2 +- doc/source/devref/index.rst | 4 +- doc/source/devref/plugin-api.rst | 4 +- doc/source/index.rst | 20 +- ...{quantum-server.rst => neutron-server.rst} | 22 +- etc/api-paste.ini | 26 +- etc/dhcp_agent.ini | 10 +- etc/init.d/{quantum-server => neutron-server} | 0 etc/l3_agent.ini | 10 +- etc/lbaas_agent.ini | 8 +- etc/metadata_agent.ini | 6 +- etc/{quantum.conf => neutron.conf} | 0 .../plugins/bigswitch/restproxy.ini | 0 .../plugins/brocade/brocade.ini | 0 .../plugins/cisco/cisco_plugins.ini | 0 .../plugins/hyperv/hyperv_neutron_plugin.ini} | 0 .../plugins/linuxbridge/linuxbridge_conf.ini | 0 .../plugins/metaplugin/metaplugin.ini | 0 .../plugins/midonet/midonet.ini | 0 .../plugins/ml2/ml2_conf.ini | 0 .../plugins/mlnx/mlnx_conf.ini | 0 etc/{quantum => neutron}/plugins/nec/nec.ini | 0 .../plugins/nicira/nvp.ini | 0 .../openvswitch/ovs_neutron_plugin.ini} | 0 .../plugins/plumgrid/plumgrid.ini | 0 etc/{quantum => neutron}/plugins/ryu/ryu.ini | 0 .../rootwrap.d/debug.filters | 2 +- .../rootwrap.d/dhcp.filters | 10 +- .../rootwrap.d/iptables-firewall.filters | 6 +- .../rootwrap.d/l3.filters | 8 +- .../rootwrap.d/lbaas-haproxy.filters | 2 +- .../rootwrap.d/linuxbridge-plugin.filters | 2 +- .../rootwrap.d/nec-plugin.filters | 4 +- .../rootwrap.d/openvswitch-plugin.filters | 2 +- .../rootwrap.d/ryu-plugin.filters | 6 +- etc/quantum | 1 + neutron/__init__.py | 21 ++ {quantum => neutron}/agent/__init__.py | 0 {quantum => neutron}/agent/common/__init__.py | 0 {quantum => neutron}/agent/common/config.py | 6 +- {quantum => neutron}/agent/dhcp_agent.py | 75 +++-- {quantum => neutron}/agent/firewall.py | 0 {quantum => neutron}/agent/l3_agent.py | 68 ++-- {quantum => neutron}/agent/linux/__init__.py | 0 {quantum => neutron}/agent/linux/daemon.py | 4 +- {quantum => neutron}/agent/linux/dhcp.py | 26 +- .../agent/linux/external_process.py | 8 +- {quantum => neutron}/agent/linux/interface.py | 22 +- {quantum => neutron}/agent/linux/ip_lib.py | 4 +- .../agent/linux/iptables_firewall.py | 8 +- .../agent/linux/iptables_manager.py | 30 +- {quantum => neutron}/agent/linux/ovs_lib.py | 10 +- {quantum => neutron}/agent/linux/utils.py | 4 +- .../agent/metadata/__init__.py | 0 {quantum => neutron}/agent/metadata/agent.py | 22 +- .../agent/metadata/namespace_proxy.py | 18 +- .../agent/netns_cleanup_util.py | 24 +- .../agent/ovs_cleanup_util.py | 36 +- {quantum => neutron}/agent/rpc.py | 10 +- .../agent/securitygroups_rpc.py | 10 +- .../openstack => neutron/api}/__init__.py | 0 {quantum => neutron}/api/api_common.py | 12 +- {quantum => neutron}/api/extensions.py | 28 +- {quantum => neutron}/api/rpc/__init__.py | 0 .../api/rpc/agentnotifiers/__init__.py | 0 .../rpc/agentnotifiers/dhcp_rpc_agent_api.py | 16 +- .../rpc/agentnotifiers/l3_rpc_agent_api.py | 16 +- {quantum => neutron}/api/v2/__init__.py | 0 {quantum => neutron}/api/v2/attributes.py | 8 +- {quantum => neutron}/api/v2/base.py | 18 +- {quantum => neutron}/api/v2/resource.py | 16 +- {quantum => neutron}/api/v2/router.py | 14 +- {quantum => neutron}/api/versions.py | 8 +- {quantum => neutron}/api/views/__init__.py | 0 {quantum => neutron}/api/views/versions.py | 0 neutron/auth.py | 63 ++++ {quantum => neutron}/common/__init__.py | 0 {quantum => neutron}/common/config.py | 39 ++- {quantum => neutron}/common/constants.py | 0 {quantum => neutron}/common/exceptions.py | 40 +-- neutron/common/legacy.py | 82 +++++ {quantum => neutron}/common/rpc.py | 12 +- {quantum => neutron}/common/test_lib.py | 12 +- {quantum => neutron}/common/topics.py | 0 {quantum => neutron}/common/utils.py | 22 +- {quantum => neutron}/context.py | 8 +- {quantum => neutron}/db/__init__.py | 0 {quantum => neutron}/db/agents_db.py | 18 +- {quantum => neutron}/db/agentschedulers_db.py | 16 +- {quantum => neutron}/db/api.py | 6 +- {quantum => neutron}/db/db_base_plugin_v2.py | 58 ++-- {quantum => neutron}/db/dhcp_rpc_base.py | 22 +- {quantum => neutron}/db/extraroute_db.py | 18 +- {quantum => neutron}/db/l3_db.py | 28 +- {quantum => neutron}/db/l3_gwmode_db.py | 6 +- {quantum => neutron}/db/l3_rpc_base.py | 20 +- .../db/loadbalancer/__init__.py | 0 .../db/loadbalancer/loadbalancer_db.py | 38 +-- {quantum => neutron}/db/migration/README | 32 +- {quantum => neutron}/db/migration/__init__.py | 0 {quantum => neutron}/db/migration/alembic.ini | 2 +- .../migration/alembic_migrations/__init__.py | 0 .../alembic_migrations/common_ext_ops.py | 0 .../db/migration/alembic_migrations/env.py | 22 +- .../alembic_migrations/script.py.mako | 4 +- .../versions/1149d7de0cfa_port_security.py | 4 +- .../versions/128e042a2b68_ext_gw_mode.py | 14 +- .../1341ed32cc1e_nvp_netbinding_update.py | 4 +- .../176a85fc7d79_add_portbindings_db.py | 6 +- .../1b693c095aa3_quota_ext_db_grizzly.py | 4 +- .../1c33fa3cd1a1_extra_route_config.py | 12 +- .../versions/1d76643bcec4_nvp_netbinding.py | 4 +- .../2a6d0b51f4bb_cisco_plugin_cleanup.py | 4 +- .../versions/2c4af419145b_l3_support.py | 12 +- .../32b517556ec9_remove_tunnelip_mode.py | 4 +- .../versions/363468ac592c_nvp_network_gw.py | 4 +- .../versions/38335592a0dc_nvp_portmap.py | 14 +- .../3b54bf9e29f7_nec_plugin_sharednet.py | 4 +- .../3cabb850f4a5_table_to_track_port_.py | 4 +- .../versions/3cb5d900c5de_security_groups.py | 12 +- .../versions/3cbf70257c28_nvp_mac_learning.py | 4 +- .../versions/45680af419f9_nvp_qos.py | 4 +- .../versions/4692d074d587_agent_scheduler.py | 12 +- .../versions/48b6f43f7471_service_type.py | 2 +- .../49332180ca96_ryu_plugin_update.py | 4 +- .../511471cc46b_agent_ext_model_supp.py | 12 +- .../versions/54c2c487e913_lbaas.py | 2 +- .../5918cbddab04_add_tables_for_route.py | 4 +- .../versions/5a875d0e5c_ryu.py | 4 +- .../versions/5ac71e65402c_ml2_initial.py | 4 +- .../alembic_migrations/versions/README | 5 + .../b7a8863760e_rm_cisco_vlan_bindin.py | 0 .../versions/folsom_initial.py | 20 +- .../versions/grizzly_release.py | 0 {quantum => neutron}/db/migration/cli.py | 13 +- {quantum => neutron}/db/model_base.py | 8 +- {quantum => neutron}/db/models_v2.py | 16 +- {quantum => neutron}/db/portbindings_db.py | 16 +- {quantum => neutron}/db/portsecurity_db.py | 6 +- {quantum => neutron}/db/quota_db.py | 6 +- .../db/routedserviceinsertion_db.py | 8 +- .../db/routerservicetype_db.py | 4 +- {quantum => neutron}/db/securitygroups_db.py | 20 +- .../db/securitygroups_rpc_base.py | 12 +- {quantum => neutron}/db/servicetype_db.py | 18 +- {quantum => neutron}/db/sqlalchemyutils.py | 4 +- {quantum => neutron}/debug/README | 14 +- {quantum => neutron}/debug/__init__.py | 0 {quantum => neutron}/debug/commands.py | 12 +- {quantum => neutron}/debug/debug_agent.py | 12 +- {quantum => neutron}/debug/shell.py | 51 +-- {quantum => neutron}/extensions/__init__.py | 0 {quantum => neutron}/extensions/agent.py | 12 +- .../extensions/agentscheduler.py | 34 +- {quantum => neutron}/extensions/extraroute.py | 8 +- {quantum => neutron}/extensions/flavor.py | 6 +- {quantum => neutron}/extensions/l3.py | 20 +- .../extensions/l3_ext_gw_mode.py | 10 +- .../extensions/loadbalancer.py | 22 +- .../extensions/portbindings.py | 10 +- .../extensions/portsecurity.py | 4 +- .../extensions/providernet.py | 8 +- {quantum => neutron}/extensions/quotasv2.py | 26 +- .../extensions/routedserviceinsertion.py | 0 .../extensions/routerservicetype.py | 0 .../extensions/securitygroup.py | 16 +- .../extensions/servicetype.py | 24 +- {quantum => neutron}/hooks.py | 0 .../locale/bg_BG/LC_MESSAGES/neutron.po | 0 .../locale/cs/LC_MESSAGES/neutron.po | 0 .../locale/da/LC_MESSAGES/neutron.po | 0 .../locale/de/LC_MESSAGES/neutron.po | 0 .../locale/es/LC_MESSAGES/neutron.po | 0 .../locale/fi_FI/LC_MESSAGES/neutron.po | 0 .../locale/fr/LC_MESSAGES/neutron.po | 0 .../locale/it/LC_MESSAGES/neutron.po | 0 .../locale/ja/LC_MESSAGES/neutron.po | 0 .../locale/ka_GE/LC_MESSAGES/neutron.po | 0 .../locale/ko_KR/LC_MESSAGES/neutron.po | 0 .../quantum.pot => neutron/locale/neutron.pot | 0 .../locale/pl_PL/LC_MESSAGES/neutron.po | 0 .../locale/pt_BR/LC_MESSAGES/neutron.po | 0 .../locale/ro/LC_MESSAGES/neutron.po | 0 .../locale/ru/LC_MESSAGES/neutron.po | 0 .../locale/sl_SI/LC_MESSAGES/neutron.po | 0 .../locale/vi_VN/LC_MESSAGES/neutron.po | 0 .../locale/zh_CN/LC_MESSAGES/neutron.po | 0 .../locale/zh_TW/LC_MESSAGES/neutron.po | 0 {quantum => neutron}/manager.py | 26 +- .../neutron_plugin_base_v2.py | 84 ++--- .../common => neutron/openstack}/__init__.py | 0 .../openstack/common}/__init__.py | 0 .../openstack/common/context.py | 2 +- .../openstack/common/db/__init__.py | 0 .../openstack/common/db/api.py | 6 +- .../openstack/common/db/exception.py | 2 +- .../common/db/sqlalchemy/__init__.py | 0 .../openstack/common/db/sqlalchemy/models.py | 4 +- .../openstack/common/db/sqlalchemy/session.py | 18 +- .../openstack/common/db/sqlalchemy/utils.py | 4 +- .../openstack/common/eventlet_backdoor.py | 0 .../openstack/common/exception.py | 2 +- .../openstack/common/excutils.py | 2 +- .../openstack/common/fileutils.py | 6 +- .../openstack/common/gettextutils.py | 6 +- .../openstack/common/importutils.py | 0 .../openstack/common/jsonutils.py | 2 +- .../openstack/common/local.py | 0 .../openstack/common/lockutils.py | 8 +- {quantum => neutron}/openstack/common/log.py | 10 +- .../openstack/common/loopingcall.py | 6 +- .../openstack/common/network_utils.py | 2 +- .../openstack/common/notifier/__init__.py | 0 .../openstack/common/notifier/api.py | 12 +- .../openstack/common/notifier/log_notifier.py | 6 +- .../common/notifier/no_op_notifier.py | 0 .../common/notifier/rabbit_notifier.py | 6 +- .../openstack/common/notifier/rpc_notifier.py | 8 +- .../common/notifier/rpc_notifier2.py | 8 +- .../common/notifier/test_notifier.py | 0 .../openstack/common/periodic_task.py | 6 +- .../openstack/common/policy.py | 6 +- .../openstack/common/processutils.py | 4 +- .../openstack/common/rpc/__init__.py | 10 +- .../openstack/common/rpc/amqp.py | 10 +- .../openstack/common/rpc/common.py | 10 +- .../openstack/common/rpc/dispatcher.py | 4 +- .../openstack/common/rpc/impl_fake.py | 2 +- .../openstack/common/rpc/impl_kombu.py | 8 +- .../openstack/common/rpc/impl_qpid.py | 12 +- .../openstack/common/rpc/impl_zmq.py | 12 +- .../openstack/common/rpc/matchmaker.py | 4 +- .../openstack/common/rpc/matchmaker_redis.py | 6 +- .../openstack/common/rpc/matchmaker_ring.py | 6 +- .../openstack/common/rpc/proxy.py | 6 +- .../openstack/common/rpc/serializer.py | 0 .../openstack/common/rpc/service.py | 10 +- .../openstack/common/rpc/zmq_receiver.py | 6 +- .../openstack/common/service.py | 12 +- .../openstack/common/threadgroup.py | 4 +- .../openstack/common/timeutils.py | 0 .../openstack/common/uuidutils.py | 0 {quantum => neutron}/plugins/__init__.py | 4 +- {quantum => neutron}/plugins/bigswitch/README | 10 +- .../plugins/bigswitch/__init__.py | 0 .../plugins/bigswitch/db/__init__.py | 0 .../plugins/bigswitch/db/porttracker_db.py | 6 +- .../plugins/bigswitch/extensions/__init__.py | 0 .../bigswitch/extensions/routerrule.py | 10 +- .../plugins/bigswitch/plugin.py | 287 ++++++++-------- .../plugins/bigswitch/routerrule_db.py | 8 +- .../plugins/bigswitch/tests/__init__.py | 0 .../plugins/bigswitch/tests/test_server.py | 2 +- .../plugins/bigswitch/vcsversion.py | 4 +- .../plugins/bigswitch/version.py | 14 +- .../plugins/brocade/NeutronPlugin.py | 74 +++-- .../plugins/brocade/README.md | 36 +- .../plugins/brocade/__init__.py | 0 .../plugins/brocade/db/__init__.py | 0 .../plugins/brocade/db/models.py | 4 +- .../plugins/brocade/nos/__init__.py | 0 .../plugins/brocade/nos/fake_nosdriver.py | 6 +- .../plugins/brocade/nos/nctemplates.py | 2 +- .../plugins/brocade/nos/nosdriver.py | 10 +- .../plugins/brocade/tests/README | 4 +- .../plugins/brocade/tests/noscli.py | 4 +- .../plugins/brocade/tests/nostest.py | 4 +- .../plugins/brocade/vlanbm.py | 4 +- neutron/plugins/cisco/README | 7 + .../plugins/cisco/__init__.py | 0 .../plugins/cisco/common/__init__.py | 0 .../plugins/cisco/common/cisco_constants.py | 0 .../cisco/common/cisco_credentials_v2.py | 8 +- .../plugins/cisco/common/cisco_exceptions.py | 42 +-- .../plugins/cisco/common/cisco_faults.py | 4 +- .../plugins/cisco/common/cisco_utils.py | 2 +- .../plugins/cisco/common/config.py | 14 +- .../plugins/cisco/db/__init__.py | 0 {quantum => neutron}/plugins/cisco/db/api.py | 6 +- .../plugins/cisco/db/l2network_db.py | 12 +- .../plugins/cisco/db/l2network_models.py | 4 +- .../plugins/cisco/db/models.py | 14 +- .../plugins/cisco/db/network_db_v2.py | 14 +- .../plugins/cisco/db/network_models_v2.py | 6 +- .../plugins/cisco/db/nexus_db_v2.py | 8 +- .../plugins/cisco/db/nexus_models_v2.py | 4 +- .../plugins/cisco/extensions/__init__.py | 0 .../cisco/extensions/_credential_view.py | 2 +- .../plugins/cisco/extensions/_qos_view.py | 2 +- .../plugins/cisco/extensions/credential.py | 20 +- .../plugins/cisco/extensions/qos.py | 20 +- .../plugins/cisco/l2device_plugin_base.py | 0 .../plugins/cisco/models/__init__.py | 0 .../plugins/cisco/models/virt_phy_sw_v2.py | 20 +- .../plugins/cisco/network_plugin.py | 22 +- .../plugins/cisco/nexus/__init__.py | 0 .../nexus/cisco_nexus_network_driver_v2.py | 14 +- .../cisco/nexus/cisco_nexus_plugin_v2.py | 18 +- .../cisco/nexus/cisco_nexus_snippets.py | 0 .../plugins/cisco/test}/__init__.py | 0 .../plugins/cisco/test/nexus/__init__.py | 0 .../cisco/test/nexus/fake_nexus_driver.py | 0 .../plugins/common/__init__.py | 0 .../plugins/common/constants.py | 0 {quantum => neutron}/plugins/common/utils.py | 4 +- .../plugins/hyperv/__init__.py | 0 .../plugins/hyperv/agent/__init__.py | 0 .../hyperv/agent/hyperv_neutron_agent.py | 22 +- .../plugins/hyperv/agent/utils.py | 6 +- .../plugins/hyperv/agent_notifier_api.py | 8 +- .../plugins/hyperv/common/__init__.py | 0 .../plugins/hyperv/common/constants.py | 0 {quantum => neutron}/plugins/hyperv/db.py | 12 +- .../plugins/hyperv/hyperv_neutron_plugin.py | 54 +-- {quantum => neutron}/plugins/hyperv/model.py | 2 +- .../plugins/hyperv/rpc_callbacks.py | 12 +- .../plugins/linuxbridge/README | 66 ++-- .../plugins/linuxbridge}/__init__.py | 0 .../plugins/linuxbridge/agent}/__init__.py | 0 .../agent/linuxbridge_neutron_agent.py | 52 +-- .../plugins/linuxbridge/common/__init__.py | 0 .../plugins/linuxbridge/common/config.py | 4 +- .../plugins/linuxbridge/common/constants.py | 0 .../plugins/linuxbridge/db/__init__.py | 0 .../plugins/linuxbridge/db/l2network_db_v2.py | 20 +- .../linuxbridge/db/l2network_models_v2.py | 2 +- .../plugins/linuxbridge/lb_neutron_plugin.py | 72 ++-- .../plugins/metaplugin/README | 30 +- .../plugins/metaplugin/__init__.py | 0 .../plugins/metaplugin/common/__init__.py | 0 .../plugins/metaplugin/common/config.py | 0 .../plugins/metaplugin/meta_db_v2.py | 2 +- .../plugins/metaplugin/meta_models_v2.py | 2 +- .../plugins/metaplugin/meta_neutron_plugin.py | 30 +- .../metaplugin/proxy_neutron_plugin.py | 18 +- .../plugins/metaplugin/run_tests.py | 12 +- .../plugins/midonet/__init__.py | 0 .../plugins/midonet/config.py | 0 .../plugins/midonet/midonet_lib.py | 6 +- .../plugins/midonet/plugin.py | 64 ++-- {quantum => neutron}/plugins/ml2/README | 0 {quantum => neutron}/plugins/ml2/__init__.py | 0 {quantum => neutron}/plugins/ml2/config.py | 6 +- {quantum => neutron}/plugins/ml2/db.py | 18 +- .../plugins/ml2/driver_api.py | 4 +- .../plugins/ml2/drivers/__init__.py | 0 .../plugins/ml2/drivers/type_flat.py | 8 +- .../plugins/ml2/drivers/type_local.py | 6 +- .../plugins/ml2/drivers/type_vlan.py | 16 +- {quantum => neutron}/plugins/ml2/managers.py | 10 +- {quantum => neutron}/plugins/ml2/models.py | 8 +- {quantum => neutron}/plugins/ml2/plugin.py | 58 ++-- {quantum => neutron}/plugins/ml2/rpc.py | 26 +- {quantum => neutron}/plugins/mlnx/README | 6 +- {quantum => neutron}/plugins/mlnx/__init__.py | 0 .../plugins/mlnx/agent/__init__.py | 0 .../mlnx/agent/eswitch_neutron_agent.py | 36 +- .../plugins/mlnx/agent/utils.py | 6 +- .../plugins/mlnx/agent_notify_api.py | 6 +- .../plugins/mlnx/common/__init__.py | 0 .../plugins/mlnx/common/config.py | 4 +- .../plugins/mlnx/common/constants.py | 0 .../plugins/mlnx/common/exceptions.py | 4 +- .../plugins/mlnx/db/__init__.py | 0 .../plugins/mlnx/db/mlnx_db_v2.py | 12 +- .../plugins/mlnx/db/mlnx_models_v2.py | 2 +- .../plugins/mlnx/mlnx_plugin.py | 46 +-- .../plugins/mlnx/rpc_callbacks.py | 18 +- {quantum => neutron}/plugins/nec/README | 2 +- {quantum => neutron}/plugins/nec/__init__.py | 0 .../plugins/nec/agent/__init__.py | 0 .../plugins/nec/agent/nec_neutron_agent.py | 36 +- .../plugins/nec/common/__init__.py | 0 .../plugins/nec/common/config.py | 6 +- .../plugins/nec/common/exceptions.py | 10 +- .../plugins/nec/common/ofc_client.py | 4 +- .../plugins/nec/db/__init__.py | 0 {quantum => neutron}/plugins/nec/db/api.py | 70 ++-- {quantum => neutron}/plugins/nec/db/models.py | 24 +- .../plugins/nec/db/nec_plugin_base.py | 14 +- .../plugins/nec/drivers/__init__.py | 6 +- .../plugins/nec/drivers/pfc.py | 6 +- .../plugins/nec/drivers/trema.py | 8 +- .../plugins/nec/extensions/__init__.py | 0 .../plugins/nec/extensions/packetfilter.py | 12 +- .../plugins/nec/nec_plugin.py | 64 ++-- .../plugins/nec/ofc_driver_base.py | 24 +- .../plugins/nec/ofc_manager.py | 28 +- .../plugins/nicira/NeutronPlugin.py | 309 +++++++++--------- .../plugins/nicira/NvpApiClient.py | 2 +- {quantum => neutron}/plugins/nicira/README | 22 +- .../plugins/nicira/__init__.py | 0 .../plugins/nicira/api_client/__init__.py | 0 .../plugins/nicira/api_client/client.py | 2 +- .../nicira/api_client/client_eventlet.py | 4 +- .../plugins/nicira/api_client/common.py | 0 .../plugins/nicira/api_client/request.py | 4 +- .../nicira/api_client/request_eventlet.py | 6 +- .../plugins/nicira/check_nvp_config.py | 10 +- .../plugins/nicira/common/__init__.py | 0 .../plugins/nicira/common/config.py | 10 +- .../plugins/nicira/common/exceptions.py | 4 +- .../plugins/nicira/common/metadata_access.py | 24 +- .../plugins/nicira/common/securitygroups.py | 8 +- .../plugins/nicira/dbexts}/__init__.py | 0 .../plugins/nicira/dbexts/maclearning.py | 6 +- .../plugins/nicira/dbexts/nicira_db.py | 18 +- .../plugins/nicira/dbexts/nicira_models.py | 8 +- .../nicira/dbexts/nicira_networkgw_db.py | 20 +- .../plugins/nicira/dbexts/nicira_qos_db.py | 12 +- .../plugins/nicira/extensions/__init__.py | 0 .../plugins/nicira/extensions/maclearning.py | 2 +- .../nicira/extensions/nvp_networkgw.py | 24 +- .../plugins/nicira/extensions/nvp_qos.py | 12 +- .../plugins/nicira/nvp_cluster.py | 4 +- {quantum => neutron}/plugins/nicira/nvplib.py | 100 +++--- .../plugins/openvswitch/README | 2 +- .../plugins/openvswitch}/__init__.py | 0 .../plugins/openvswitch/agent}/__init__.py | 0 .../openvswitch/agent/ovs_neutron_agent.py | 44 +-- .../plugins/openvswitch/agent/xenapi/README | 2 +- .../agent/xenapi/contrib/build-rpm.sh | 12 +- .../SPECS/openstack-quantum-xen-plugins.spec | 8 +- .../agent/xenapi/etc/xapi.d/plugins/netwrap | 2 +- .../plugins/openvswitch/common/__init__.py | 0 .../plugins/openvswitch/common/config.py | 6 +- .../plugins/openvswitch/common/constants.py | 0 .../plugins/openvswitch/ovs_db_v2.py | 20 +- .../plugins/openvswitch/ovs_models_v2.py | 2 +- .../plugins/openvswitch/ovs_neutron_plugin.py | 90 ++--- neutron/plugins/plumgrid/README | 7 + .../plugins/plumgrid/__init__.py | 0 .../plugins/plumgrid/common/__init__.py | 0 .../plugins/plumgrid/common/exceptions.py | 6 +- .../plumgrid/plumgrid_nos_plugin/__init__.py | 0 .../plumgrid_nos_plugin/plugin_ver.py | 0 .../plumgrid_nos_snippets.py | 4 +- .../plumgrid_nos_plugin/plumgrid_plugin.py | 84 ++--- .../plumgrid_nos_plugin/rest_connection.py | 10 +- {quantum => neutron}/plugins/ryu/README | 4 +- .../agent => neutron/plugins/ryu}/__init__.py | 0 .../plugins/ryu/agent}/__init__.py | 0 .../plugins/ryu/agent/ryu_neutron_agent.py | 32 +- .../plugins/ryu/common/__init__.py | 0 .../plugins/ryu/common/config.py | 2 +- neutron/plugins/ryu/db/__init__.py | 0 {quantum => neutron}/plugins/ryu/db/api_v2.py | 18 +- .../plugins/ryu/db/models_v2.py | 2 +- .../plugins/ryu/ryu_neutron_plugin.py | 58 ++-- {quantum => neutron}/policy.py | 30 +- {quantum => neutron}/quota.py | 10 +- {quantum => neutron}/rootwrap/__init__.py | 0 {quantum => neutron}/rootwrap/filters.py | 8 +- {quantum => neutron}/rootwrap/wrapper.py | 2 +- {quantum => neutron}/scheduler/__init__.py | 4 +- .../scheduler/dhcp_agent_scheduler.py | 8 +- .../scheduler/l3_agent_scheduler.py | 10 +- {quantum => neutron}/server/__init__.py | 12 +- {quantum => neutron}/service.py | 48 +-- {quantum => neutron}/services/__init__.py | 0 .../services/loadbalancer/__init__.py | 0 .../services/loadbalancer/constants.py | 0 .../services/loadbalancer/drivers/__init__.py | 0 .../loadbalancer/drivers/abstract_driver.py | 0 .../loadbalancer/drivers/haproxy/__init__.py | 0 .../loadbalancer/drivers/haproxy/agent.py | 14 +- .../loadbalancer/drivers/haproxy/agent_api.py | 2 +- .../drivers/haproxy/agent_manager.py | 14 +- .../loadbalancer/drivers/haproxy/cfg.py | 6 +- .../drivers/haproxy/namespace_driver.py | 10 +- .../drivers/haproxy/plugin_driver.py | 18 +- .../loadbalancer/drivers/noop/__init__.py | 0 .../loadbalancer/drivers/noop/noop_driver.py | 4 +- .../services/loadbalancer/plugin.py | 19 +- {quantum => neutron}/services/service_base.py | 4 +- {quantum => neutron}/tests/__init__.py | 0 {quantum => neutron}/tests/base.py | 2 +- .../tests/etc/api-paste.ini.test | 4 +- .../tests/etc/neutron.conf.test | 4 +- .../tests/etc/rootwrap.d/quantum.test.filters | 4 +- {quantum => neutron}/tests/unit/__init__.py | 0 .../unit/_test_extension_portbindings.py | 28 +- .../tests/unit/_test_rootwrap_exec.py | 10 +- .../tests/unit/bigswitch/__init__.py | 0 .../unit/bigswitch/etc/restproxy.ini.test | 0 .../unit/bigswitch/test_restproxy_plugin.py | 18 +- .../tests/unit/bigswitch/test_router_db.py | 24 +- .../tests/unit/brocade/__init__.py | 0 .../tests/unit/brocade/test_brocade_db.py | 8 +- .../tests/unit/brocade/test_brocade_plugin.py | 18 +- .../tests/unit/brocade/test_brocade_vlan.py | 8 +- .../tests/unit/cisco/__init__.py | 0 .../tests/unit/cisco/test_network_plugin.py | 42 +-- .../tests/unit/cisco/test_nexus_plugin.py | 14 +- .../tests/unit/database_stubs.py | 8 +- .../tests/unit/db/__init__.py | 0 .../tests/unit/db/loadbalancer/__init__.py | 0 .../db/loadbalancer/test_db_loadbalancer.py | 28 +- .../tests/unit/dummy_plugin.py | 24 +- .../tests/unit/extension_stubs.py | 4 +- .../tests/unit/extensions/__init__.py | 0 .../unit/extensions/extendedattribute.py | 2 +- .../unit/extensions/extensionattribute.py | 10 +- .../tests/unit/extensions/foxinsocks.py | 6 +- .../tests/unit/extensions/v2attributes.py | 0 .../tests/unit/hyperv/__init__.py | 0 .../unit/hyperv/test_hyperv_neutron_agent.py | 14 +- .../unit/hyperv/test_hyperv_neutron_plugin.py | 26 +- .../tests/unit/hyperv/test_hyperv_rpcapi.py | 32 +- .../tests/unit/linuxbridge/__init__.py | 0 .../unit/linuxbridge/test_agent_scheduler.py | 4 +- .../tests/unit/linuxbridge/test_defaults.py | 4 +- .../tests/unit/linuxbridge/test_lb_db.py | 12 +- .../unit/linuxbridge/test_lb_neutron_agent.py | 44 +-- .../linuxbridge/test_lb_security_group.py | 22 +- .../linuxbridge/test_linuxbridge_plugin.py | 14 +- .../tests/unit/linuxbridge/test_rpcapi.py | 12 +- .../tests/unit/metaplugin/__init__.py | 0 .../tests/unit/metaplugin/fake_plugin.py | 6 +- .../tests/unit/metaplugin/test_basic.py | 14 +- .../tests/unit/metaplugin/test_metaplugin.py | 34 +- .../tests/unit/midonet/__init__.py | 0 .../tests/unit/midonet/etc/midonet.ini.test | 0 .../tests/unit/midonet/mock_lib.py | 0 .../tests/unit/midonet/test_midonet_lib.py | 6 +- .../tests/unit/midonet/test_midonet_plugin.py | 12 +- .../tests/unit/ml2/__init__.py | 0 .../tests/unit/ml2/test_agent_scheduler.py | 4 +- .../tests/unit/ml2/test_ml2_plugin.py | 8 +- .../tests/unit/ml2/test_rpcapi.py | 12 +- .../tests/unit/ml2/test_security_group.py | 18 +- .../tests/unit/mlnx/__init__.py | 0 .../tests/unit/mlnx/test_defaults.py | 4 +- .../tests/unit/mlnx/test_mlnx_db.py | 12 +- .../tests/unit/mlnx/test_mlnx_plugin.py | 10 +- .../tests/unit/mlnx/test_rpcapi.py | 12 +- .../tests/unit/nec/__init__.py | 0 .../tests/unit/nec/stub_ofc_driver.py | 2 +- .../tests/unit/nec/test_agent_scheduler.py | 4 +- .../tests/unit/nec/test_config.py | 4 +- .../tests/unit/nec/test_db.py | 18 +- .../tests/unit/nec/test_nec_agent.py | 36 +- .../tests/unit/nec/test_nec_plugin.py | 30 +- .../tests/unit/nec/test_ofc_manager.py | 16 +- .../tests/unit/nec/test_pfc_driver.py | 20 +- .../tests/unit/nec/test_security_group.py | 22 +- .../tests/unit/nec/test_trema_driver.py | 14 +- .../tests/unit/nicira/__init__.py | 0 .../unit/nicira/etc/fake_get_gwservice.json | 0 .../unit/nicira/etc/fake_get_lqueue.json | 0 .../unit/nicira/etc/fake_get_lrouter.json | 0 .../nicira/etc/fake_get_lrouter_lport.json | 4 +- .../etc/fake_get_lrouter_lport_att.json | 0 .../unit/nicira/etc/fake_get_lrouter_nat.json | 0 .../unit/nicira/etc/fake_get_lswitch.json | 0 .../nicira/etc/fake_get_lswitch_lport.json | 4 +- .../etc/fake_get_lswitch_lport_att.json | 0 .../etc/fake_get_lswitch_lport_status.json | 0 .../nicira/etc/fake_get_security_profile.json | 0 .../unit/nicira/etc/fake_post_gwservice.json | 0 .../unit/nicira/etc/fake_post_lqueue.json | 0 .../unit/nicira/etc/fake_post_lrouter.json | 0 .../nicira/etc/fake_post_lrouter_lport.json | 0 .../nicira/etc/fake_post_lrouter_nat.json | 0 .../unit/nicira/etc/fake_post_lswitch.json | 0 .../nicira/etc/fake_post_lswitch_lport.json | 4 +- .../etc/fake_post_security_profile.json | 0 .../etc/fake_put_lrouter_lport_att.json | 0 .../etc/fake_put_lswitch_lport_att.json | 0 .../tests/unit/nicira/etc/neutron.conf.test | 0 .../tests/unit/nicira/etc/nvp.ini.basic.test | 0 .../tests/unit/nicira/etc/nvp.ini.full.test | 0 .../unit/nicira/etc/nvp.ini.grizzly.test | 0 .../tests/unit/nicira/etc/nvp.ini.test | 0 .../tests/unit/nicira/fake_nvpapiclient.py | 12 +- .../tests/unit/nicira/test_maclearning.py | 20 +- .../tests/unit/nicira/test_networkgw.py | 42 +-- .../tests/unit/nicira/test_nicira_plugin.py | 90 ++--- .../tests/unit/nicira/test_nvp_api_common.py | 4 +- .../tests/unit/nicira/test_nvp_api_request.py | 2 +- .../nicira/test_nvp_api_request_eventlet.py | 14 +- .../tests/unit/nicira/test_nvplib.py | 76 ++--- .../tests/unit/nicira/test_nvpopts.py | 32 +- .../tests/unit/openvswitch/__init__.py | 0 .../unit/openvswitch/test_agent_scheduler.py | 96 +++--- .../openvswitch/test_openvswitch_plugin.py | 14 +- .../tests/unit/openvswitch/test_ovs_db.py | 12 +- .../unit/openvswitch/test_ovs_defaults.py | 4 +- .../tests/unit/openvswitch/test_ovs_lib.py | 18 +- .../openvswitch/test_ovs_neutron_agent.py | 48 +-- .../tests/unit/openvswitch/test_ovs_rpcapi.py | 14 +- .../openvswitch/test_ovs_security_group.py | 26 +- .../tests/unit/openvswitch/test_ovs_tunnel.py | 66 ++-- .../tests/unit/plumgrid/__init__.py | 0 .../unit/plumgrid/test_plumgrid_plugin.py | 14 +- .../tests/unit/ryu/__init__.py | 0 .../tests/unit/ryu/fake_ryu.py | 0 .../tests/unit/ryu/test_defaults.py | 4 +- .../tests/unit/ryu/test_ryu_agent.py | 24 +- .../tests/unit/ryu/test_ryu_db.py | 12 +- .../tests/unit/ryu/test_ryu_plugin.py | 10 +- .../tests/unit/ryu/test_ryu_security_group.py | 28 +- .../tests/unit/services/__init__.py | 0 .../unit/services/loadbalancer/__init__.py | 0 .../services/loadbalancer/drivers/__init__.py | 0 .../loadbalancer/drivers/haproxy/__init__.py | 0 .../drivers/haproxy/test_agent.py | 6 +- .../drivers/haproxy/test_agent_manager.py | 6 +- .../loadbalancer/drivers/haproxy/test_api.py | 4 +- .../loadbalancer/drivers/haproxy/test_cfg.py | 14 +- .../drivers/haproxy/test_namespace_driver.py | 22 +- .../drivers/haproxy/test_plugin_driver.py | 22 +- .../loadbalancer/test_loadbalancer_plugin.py | 26 +- .../tests/unit/test_agent_config.py | 6 +- .../tests/unit/test_agent_ext_plugin.py | 52 +-- .../tests/unit/test_agent_linux_utils.py | 4 +- .../tests/unit/test_agent_netns_cleanup.py | 28 +- .../tests/unit/test_agent_ovs_cleanup.py | 34 +- .../tests/unit/test_agent_rpc.py | 10 +- .../tests/unit/test_api_api_common.py | 6 +- .../tests/unit/test_api_v2.py | 82 ++--- .../tests/unit/test_api_v2_resource.py | 44 +-- .../tests/unit/test_attributes.py | 6 +- {quantum => neutron}/tests/unit/test_auth.py | 12 +- .../tests/unit/test_common_utils.py | 8 +- .../tests/unit/test_config.py | 6 +- .../tests/unit/test_db_migration.py | 6 +- .../tests/unit/test_db_plugin.py | 204 ++++++------ .../tests/unit/test_db_rpc_base.py | 8 +- .../tests/unit/test_debug_commands.py | 40 +-- .../tests/unit/test_dhcp_agent.py | 88 ++--- .../tests/unit/test_extension_ext_gw_mode.py | 34 +- .../unit/test_extension_extended_attribute.py | 38 +-- .../tests/unit/test_extension_extraroute.py | 22 +- .../tests/unit/test_extension_pnet.py | 30 +- .../tests/unit/test_extension_portsecurity.py | 52 +-- .../unit/test_extension_security_group.py | 40 +-- .../tests/unit/test_extensions.py | 36 +- .../tests/unit/test_iptables_firewall.py | 12 +- .../tests/unit/test_iptables_manager.py | 58 ++-- .../tests/unit/test_l3_agent.py | 46 +-- .../tests/unit/test_l3_plugin.py | 84 ++--- neutron/tests/unit/test_legacy.py | 83 +++++ .../tests/unit/test_linux_daemon.py | 10 +- .../tests/unit/test_linux_dhcp.py | 38 +-- .../tests/unit/test_linux_external_process.py | 6 +- .../tests/unit/test_linux_interface.py | 32 +- .../tests/unit/test_linux_ip_lib.py | 14 +- .../tests/unit/test_metadata_agent.py | 20 +- .../unit/test_metadata_namespace_proxy.py | 30 +- .../tests/unit/test_neutron_context.py | 18 +- .../tests/unit/test_neutron_manager.py | 52 +-- .../tests/unit/test_policy.py | 36 +- .../tests/unit/test_quota_ext.py | 90 ++--- .../tests/unit/test_rootwrap.py | 20 +- .../tests/unit/test_routerserviceinsertion.py | 54 +-- .../tests/unit/test_security_groups_rpc.py | 106 +++--- .../tests/unit/test_servicetype.py | 52 +-- {quantum => neutron}/tests/unit/test_wsgi.py | 10 +- .../tests/unit/testlib_api.py | 8 +- {quantum => neutron}/tests/var/ca.crt | 0 .../tests/var/certificate.crt | 0 {quantum => neutron}/tests/var/privatekey.key | 0 {quantum => neutron}/version.py | 2 +- {quantum => neutron}/wsgi.py | 18 +- openstack-common.conf | 2 +- quantum/__init__.py | 9 +- quantum/api/__init__.py | 34 ++ quantum/auth.py | 57 +--- .../alembic_migrations/versions/README | 5 - quantum/plugins/cisco/README | 7 - quantum/plugins/plumgrid/README | 7 - requirements.txt | 2 +- run_tests.py | 8 +- run_tests.sh | 6 +- setup.cfg | 132 ++++---- tools/clean.sh | 2 +- tools/i18n_cfg.py | 4 +- tools/install_venv.py | 10 +- tools/patch_tox_venv.py | 2 +- tox.ini | 2 +- 714 files changed, 4918 insertions(+), 4439 deletions(-) create mode 100755 bin/neutron-dhcp-agent-dnsmasq-lease-update create mode 100755 bin/neutron-rootwrap rename doc/source/man/{quantum-server.rst => neutron-server.rst} (75%) rename etc/init.d/{quantum-server => neutron-server} (100%) rename etc/{quantum.conf => neutron.conf} (100%) rename etc/{quantum => neutron}/plugins/bigswitch/restproxy.ini (100%) rename etc/{quantum => neutron}/plugins/brocade/brocade.ini (100%) rename etc/{quantum => neutron}/plugins/cisco/cisco_plugins.ini (100%) rename etc/{quantum/plugins/hyperv/hyperv_quantum_plugin.ini => neutron/plugins/hyperv/hyperv_neutron_plugin.ini} (100%) rename etc/{quantum => neutron}/plugins/linuxbridge/linuxbridge_conf.ini (100%) rename etc/{quantum => neutron}/plugins/metaplugin/metaplugin.ini (100%) rename etc/{quantum => neutron}/plugins/midonet/midonet.ini (100%) rename etc/{quantum => neutron}/plugins/ml2/ml2_conf.ini (100%) rename etc/{quantum => neutron}/plugins/mlnx/mlnx_conf.ini (100%) rename etc/{quantum => neutron}/plugins/nec/nec.ini (100%) rename etc/{quantum => neutron}/plugins/nicira/nvp.ini (100%) rename etc/{quantum/plugins/openvswitch/ovs_quantum_plugin.ini => neutron/plugins/openvswitch/ovs_neutron_plugin.ini} (100%) rename etc/{quantum => neutron}/plugins/plumgrid/plumgrid.ini (100%) rename etc/{quantum => neutron}/plugins/ryu/ryu.ini (100%) rename etc/{quantum => neutron}/rootwrap.d/debug.filters (86%) rename etc/{quantum => neutron}/rootwrap.d/dhcp.filters (75%) rename etc/{quantum => neutron}/rootwrap.d/iptables-firewall.filters (78%) rename etc/{quantum => neutron}/rootwrap.d/l3.filters (73%) rename etc/{quantum => neutron}/rootwrap.d/lbaas-haproxy.filters (89%) rename etc/{quantum => neutron}/rootwrap.d/linuxbridge-plugin.filters (86%) rename etc/{quantum => neutron}/rootwrap.d/nec-plugin.filters (72%) rename etc/{quantum => neutron}/rootwrap.d/openvswitch-plugin.filters (88%) rename etc/{quantum => neutron}/rootwrap.d/ryu-plugin.filters (72%) create mode 120000 etc/quantum create mode 100644 neutron/__init__.py rename {quantum => neutron}/agent/__init__.py (100%) rename {quantum => neutron}/agent/common/__init__.py (100%) rename {quantum => neutron}/agent/common/config.py (95%) rename {quantum => neutron}/agent/dhcp_agent.py (94%) rename {quantum => neutron}/agent/firewall.py (100%) rename {quantum => neutron}/agent/l3_agent.py (95%) rename {quantum => neutron}/agent/linux/__init__.py (100%) rename {quantum => neutron}/agent/linux/daemon.py (97%) rename {quantum => neutron}/agent/linux/dhcp.py (95%) rename {quantum => neutron}/agent/linux/external_process.py (94%) rename {quantum => neutron}/agent/linux/interface.py (96%) rename {quantum => neutron}/agent/linux/ip_lib.py (99%) rename {quantum => neutron}/agent/linux/iptables_firewall.py (98%) rename {quantum => neutron}/agent/linux/iptables_manager.py (93%) rename {quantum => neutron}/agent/linux/ovs_lib.py (98%) rename {quantum => neutron}/agent/linux/utils.py (97%) rename {quantum => neutron}/agent/metadata/__init__.py (100%) rename {quantum => neutron}/agent/metadata/agent.py (94%) rename {quantum => neutron}/agent/metadata/namespace_proxy.py (92%) rename {quantum => neutron}/agent/netns_cleanup_util.py (91%) rename {quantum => neutron}/agent/ovs_cleanup_util.py (75%) rename {quantum => neutron}/agent/rpc.py (93%) rename {quantum => neutron}/agent/securitygroups_rpc.py (96%) rename {quantum/openstack => neutron/api}/__init__.py (100%) rename {quantum => neutron}/api/api_common.py (97%) rename {quantum => neutron}/api/extensions.py (97%) rename {quantum => neutron}/api/rpc/__init__.py (100%) rename {quantum => neutron}/api/rpc/agentnotifiers/__init__.py (100%) rename {quantum => neutron}/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py (94%) rename {quantum => neutron}/api/rpc/agentnotifiers/l3_rpc_agent_api.py (93%) rename {quantum => neutron}/api/v2/__init__.py (100%) rename {quantum => neutron}/api/v2/attributes.py (99%) rename {quantum => neutron}/api/v2/base.py (98%) rename {quantum => neutron}/api/v2/resource.py (92%) rename {quantum => neutron}/api/v2/router.py (94%) rename {quantum => neutron}/api/versions.py (90%) rename {quantum => neutron}/api/views/__init__.py (100%) rename {quantum => neutron}/api/views/versions.py (100%) create mode 100644 neutron/auth.py rename {quantum => neutron}/common/__init__.py (100%) rename {quantum => neutron}/common/config.py (83%) rename {quantum => neutron}/common/constants.py (100%) rename {quantum => neutron}/common/exceptions.py (89%) create mode 100644 neutron/common/legacy.py rename {quantum => neutron}/common/rpc.py (83%) rename {quantum => neutron}/common/test_lib.py (97%) rename {quantum => neutron}/common/topics.py (100%) rename {quantum => neutron}/common/utils.py (90%) rename {quantum => neutron}/context.py (96%) rename {quantum => neutron}/db/__init__.py (100%) rename {quantum => neutron}/db/agents_db.py (94%) rename {quantum => neutron}/db/agentschedulers_db.py (97%) rename {quantum => neutron}/db/api.py (93%) rename {quantum => neutron}/db/db_base_plugin_v2.py (97%) rename {quantum => neutron}/db/dhcp_rpc_base.py (93%) rename {quantum => neutron}/db/extraroute_db.py (95%) rename {quantum => neutron}/db/l3_db.py (98%) rename {quantum => neutron}/db/l3_gwmode_db.py (95%) rename {quantum => neutron}/db/l3_rpc_base.py (82%) rename {quantum => neutron}/db/loadbalancer/__init__.py (100%) rename {quantum => neutron}/db/loadbalancer/loadbalancer_db.py (96%) rename {quantum => neutron}/db/migration/README (78%) rename {quantum => neutron}/db/migration/__init__.py (100%) rename {quantum => neutron}/db/migration/alembic.ini (93%) rename {quantum => neutron}/db/migration/alembic_migrations/__init__.py (100%) rename {quantum => neutron}/db/migration/alembic_migrations/common_ext_ops.py (100%) rename {quantum => neutron}/db/migration/alembic_migrations/env.py (80%) rename {quantum => neutron}/db/migration/alembic_migrations/script.py.mako (94%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/1149d7de0cfa_port_security.py (97%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py (79%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py (96%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py (91%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/1b693c095aa3_quota_ext_db_grizzly.py (95%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/1c33fa3cd1a1_extra_route_config.py (85%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py (95%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py (97%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/2c4af419145b_l3_support.py (79%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py (93%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/363468ac592c_nvp_network_gw.py (97%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py (80%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py (96%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py (95%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/3cb5d900c5de_security_groups.py (91%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py (94%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/45680af419f9_nvp_qos.py (97%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py (88%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/48b6f43f7471_service_type.py (98%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py (94%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py (87%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/54c2c487e913_lbaas.py (99%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/5918cbddab04_add_tables_for_route.py (96%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py (95%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/5ac71e65402c_ml2_initial.py (97%) create mode 100644 neutron/db/migration/alembic_migrations/versions/README rename {quantum => neutron}/db/migration/alembic_migrations/versions/b7a8863760e_rm_cisco_vlan_bindin.py (100%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/folsom_initial.py (96%) rename {quantum => neutron}/db/migration/alembic_migrations/versions/grizzly_release.py (100%) rename {quantum => neutron}/db/migration/cli.py (92%) rename {quantum => neutron}/db/model_base.py (93%) rename {quantum => neutron}/db/models_v2.py (93%) rename {quantum => neutron}/db/portbindings_db.py (90%) rename {quantum => neutron}/db/portsecurity_db.py (97%) rename {quantum => neutron}/db/quota_db.py (98%) rename {quantum => neutron}/db/routedserviceinsertion_db.py (94%) rename {quantum => neutron}/db/routerservicetype_db.py (96%) rename {quantum => neutron}/db/securitygroups_db.py (97%) rename {quantum => neutron}/db/securitygroups_rpc_base.py (97%) rename {quantum => neutron}/db/servicetype_db.py (96%) rename {quantum => neutron}/db/sqlalchemyutils.py (97%) rename {quantum => neutron}/debug/README (73%) rename {quantum => neutron}/debug/__init__.py (100%) rename {quantum => neutron}/debug/commands.py (94%) rename {quantum => neutron}/debug/debug_agent.py (96%) rename {quantum => neutron}/debug/shell.py (59%) rename {quantum => neutron}/extensions/__init__.py (100%) rename {quantum => neutron}/extensions/agent.py (95%) rename {quantum => neutron}/extensions/agentscheduler.py (90%) rename {quantum => neutron}/extensions/extraroute.py (91%) rename {quantum => neutron}/extensions/flavor.py (93%) rename {quantum => neutron}/extensions/l3.py (95%) rename {quantum => neutron}/extensions/l3_ext_gw_mode.py (89%) rename {quantum => neutron}/extensions/loadbalancer.py (97%) rename {quantum => neutron}/extensions/portbindings.py (93%) rename {quantum => neutron}/extensions/portsecurity.py (96%) rename {quantum => neutron}/extensions/providernet.py (94%) rename {quantum => neutron}/extensions/quotasv2.py (89%) rename {quantum => neutron}/extensions/routedserviceinsertion.py (100%) rename {quantum => neutron}/extensions/routerservicetype.py (100%) rename {quantum => neutron}/extensions/securitygroup.py (97%) rename {quantum => neutron}/extensions/servicetype.py (94%) rename {quantum => neutron}/hooks.py (100%) rename quantum/locale/bg_BG/LC_MESSAGES/quantum.po => neutron/locale/bg_BG/LC_MESSAGES/neutron.po (100%) rename quantum/locale/cs/LC_MESSAGES/quantum.po => neutron/locale/cs/LC_MESSAGES/neutron.po (100%) rename quantum/locale/da/LC_MESSAGES/quantum.po => neutron/locale/da/LC_MESSAGES/neutron.po (100%) rename quantum/locale/de/LC_MESSAGES/quantum.po => neutron/locale/de/LC_MESSAGES/neutron.po (100%) rename quantum/locale/es/LC_MESSAGES/quantum.po => neutron/locale/es/LC_MESSAGES/neutron.po (100%) rename quantum/locale/fi_FI/LC_MESSAGES/quantum.po => neutron/locale/fi_FI/LC_MESSAGES/neutron.po (100%) rename quantum/locale/fr/LC_MESSAGES/quantum.po => neutron/locale/fr/LC_MESSAGES/neutron.po (100%) rename quantum/locale/it/LC_MESSAGES/quantum.po => neutron/locale/it/LC_MESSAGES/neutron.po (100%) rename quantum/locale/ja/LC_MESSAGES/quantum.po => neutron/locale/ja/LC_MESSAGES/neutron.po (100%) rename quantum/locale/ka_GE/LC_MESSAGES/quantum.po => neutron/locale/ka_GE/LC_MESSAGES/neutron.po (100%) rename quantum/locale/ko_KR/LC_MESSAGES/quantum.po => neutron/locale/ko_KR/LC_MESSAGES/neutron.po (100%) rename quantum/locale/quantum.pot => neutron/locale/neutron.pot (100%) rename quantum/locale/pl_PL/LC_MESSAGES/quantum.po => neutron/locale/pl_PL/LC_MESSAGES/neutron.po (100%) rename quantum/locale/pt_BR/LC_MESSAGES/quantum.po => neutron/locale/pt_BR/LC_MESSAGES/neutron.po (100%) rename quantum/locale/ro/LC_MESSAGES/quantum.po => neutron/locale/ro/LC_MESSAGES/neutron.po (100%) rename quantum/locale/ru/LC_MESSAGES/quantum.po => neutron/locale/ru/LC_MESSAGES/neutron.po (100%) rename quantum/locale/sl_SI/LC_MESSAGES/quantum.po => neutron/locale/sl_SI/LC_MESSAGES/neutron.po (100%) rename quantum/locale/vi_VN/LC_MESSAGES/quantum.po => neutron/locale/vi_VN/LC_MESSAGES/neutron.po (100%) rename quantum/locale/zh_CN/LC_MESSAGES/quantum.po => neutron/locale/zh_CN/LC_MESSAGES/neutron.po (100%) rename quantum/locale/zh_TW/LC_MESSAGES/quantum.po => neutron/locale/zh_TW/LC_MESSAGES/neutron.po (100%) rename {quantum => neutron}/manager.py (90%) rename quantum/quantum_plugin_base_v2.py => neutron/neutron_plugin_base_v2.py (82%) rename {quantum/openstack/common => neutron/openstack}/__init__.py (100%) rename {quantum/plugins/cisco/test => neutron/openstack/common}/__init__.py (100%) rename {quantum => neutron}/openstack/common/context.py (98%) rename {quantum => neutron}/openstack/common/db/__init__.py (100%) rename {quantum => neutron}/openstack/common/db/api.py (95%) rename {quantum => neutron}/openstack/common/db/exception.py (96%) rename {quantum => neutron}/openstack/common/db/sqlalchemy/__init__.py (100%) rename {quantum => neutron}/openstack/common/db/sqlalchemy/models.py (96%) rename {quantum => neutron}/openstack/common/db/sqlalchemy/session.py (98%) rename {quantum => neutron}/openstack/common/db/sqlalchemy/utils.py (97%) rename {quantum => neutron}/openstack/common/eventlet_backdoor.py (100%) rename {quantum => neutron}/openstack/common/exception.py (98%) rename {quantum => neutron}/openstack/common/excutils.py (97%) rename {quantum => neutron}/openstack/common/fileutils.py (94%) rename {quantum => neutron}/openstack/common/gettextutils.py (97%) rename {quantum => neutron}/openstack/common/importutils.py (100%) rename {quantum => neutron}/openstack/common/jsonutils.py (99%) rename {quantum => neutron}/openstack/common/local.py (100%) rename {quantum => neutron}/openstack/common/lockutils.py (98%) rename {quantum => neutron}/openstack/common/log.py (98%) rename {quantum => neutron}/openstack/common/loopingcall.py (96%) rename {quantum => neutron}/openstack/common/network_utils.py (97%) rename {quantum => neutron}/openstack/common/notifier/__init__.py (100%) rename {quantum => neutron}/openstack/common/notifier/api.py (94%) rename {quantum => neutron}/openstack/common/notifier/log_notifier.py (87%) rename {quantum => neutron}/openstack/common/notifier/no_op_notifier.py (100%) rename {quantum => neutron}/openstack/common/notifier/rabbit_notifier.py (85%) rename {quantum => neutron}/openstack/common/notifier/rpc_notifier.py (87%) rename {quantum => neutron}/openstack/common/notifier/rpc_notifier2.py (89%) rename {quantum => neutron}/openstack/common/notifier/test_notifier.py (100%) rename {quantum => neutron}/openstack/common/periodic_task.py (97%) rename {quantum => neutron}/openstack/common/policy.py (99%) rename {quantum => neutron}/openstack/common/processutils.py (98%) rename {quantum => neutron}/openstack/common/rpc/__init__.py (97%) rename {quantum => neutron}/openstack/common/rpc/amqp.py (98%) rename {quantum => neutron}/openstack/common/rpc/common.py (98%) rename {quantum => neutron}/openstack/common/rpc/dispatcher.py (98%) rename {quantum => neutron}/openstack/common/rpc/impl_fake.py (98%) rename {quantum => neutron}/openstack/common/rpc/impl_kombu.py (99%) rename {quantum => neutron}/openstack/common/rpc/impl_qpid.py (98%) rename {quantum => neutron}/openstack/common/rpc/impl_zmq.py (98%) rename {quantum => neutron}/openstack/common/rpc/matchmaker.py (98%) rename {quantum => neutron}/openstack/common/rpc/matchmaker_redis.py (96%) rename {quantum => neutron}/openstack/common/rpc/matchmaker_ring.py (95%) rename {quantum => neutron}/openstack/common/rpc/proxy.py (98%) rename {quantum => neutron}/openstack/common/rpc/serializer.py (100%) rename {quantum => neutron}/openstack/common/rpc/service.py (90%) rename {quantum => neutron}/openstack/common/rpc/zmq_receiver.py (88%) rename {quantum => neutron}/openstack/common/service.py (96%) rename {quantum => neutron}/openstack/common/threadgroup.py (97%) rename {quantum => neutron}/openstack/common/timeutils.py (100%) rename {quantum => neutron}/openstack/common/uuidutils.py (100%) rename {quantum => neutron}/plugins/__init__.py (89%) rename {quantum => neutron}/plugins/bigswitch/README (51%) rename {quantum => neutron}/plugins/bigswitch/__init__.py (100%) rename {quantum => neutron}/plugins/bigswitch/db/__init__.py (100%) rename {quantum => neutron}/plugins/bigswitch/db/porttracker_db.py (92%) rename {quantum => neutron}/plugins/bigswitch/extensions/__init__.py (100%) rename {quantum => neutron}/plugins/bigswitch/extensions/routerrule.py (94%) rename {quantum => neutron}/plugins/bigswitch/plugin.py (85%) rename {quantum => neutron}/plugins/bigswitch/routerrule_db.py (97%) rename {quantum => neutron}/plugins/bigswitch/tests/__init__.py (100%) rename {quantum => neutron}/plugins/bigswitch/tests/test_server.py (99%) rename {quantum => neutron}/plugins/bigswitch/vcsversion.py (90%) rename {quantum => neutron}/plugins/bigswitch/version.py (80%) rename quantum/plugins/brocade/QuantumPlugin.py => neutron/plugins/brocade/NeutronPlugin.py (90%) rename {quantum => neutron}/plugins/brocade/README.md (72%) rename {quantum => neutron}/plugins/brocade/__init__.py (100%) rename {quantum => neutron}/plugins/brocade/db/__init__.py (100%) rename {quantum => neutron}/plugins/brocade/db/models.py (98%) rename {quantum => neutron}/plugins/brocade/nos/__init__.py (100%) rename {quantum => neutron}/plugins/brocade/nos/fake_nosdriver.py (95%) rename {quantum => neutron}/plugins/brocade/nos/nctemplates.py (99%) rename {quantum => neutron}/plugins/brocade/nos/nosdriver.py (96%) rename {quantum => neutron}/plugins/brocade/tests/README (82%) rename {quantum => neutron}/plugins/brocade/tests/noscli.py (96%) rename {quantum => neutron}/plugins/brocade/tests/nostest.py (94%) rename {quantum => neutron}/plugins/brocade/vlanbm.py (95%) create mode 100644 neutron/plugins/cisco/README rename {quantum => neutron}/plugins/cisco/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/common/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/common/cisco_constants.py (100%) rename {quantum => neutron}/plugins/cisco/common/cisco_credentials_v2.py (91%) rename {quantum => neutron}/plugins/cisco/common/cisco_exceptions.py (75%) rename {quantum => neutron}/plugins/cisco/common/cisco_faults.py (97%) rename {quantum => neutron}/plugins/cisco/common/cisco_utils.py (95%) rename {quantum => neutron}/plugins/cisco/common/config.py (89%) rename {quantum => neutron}/plugins/cisco/db/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/db/api.py (98%) rename {quantum => neutron}/plugins/cisco/db/l2network_db.py (97%) rename {quantum => neutron}/plugins/cisco/db/l2network_models.py (97%) rename {quantum => neutron}/plugins/cisco/db/models.py (91%) rename {quantum => neutron}/plugins/cisco/db/network_db_v2.py (96%) rename {quantum => neutron}/plugins/cisco/db/network_models_v2.py (96%) rename {quantum => neutron}/plugins/cisco/db/nexus_db_v2.py (96%) rename {quantum => neutron}/plugins/cisco/db/nexus_models_v2.py (94%) rename {quantum => neutron}/plugins/cisco/extensions/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/extensions/_credential_view.py (96%) rename {quantum => neutron}/plugins/cisco/extensions/_qos_view.py (96%) rename {quantum => neutron}/plugins/cisco/extensions/credential.py (91%) rename {quantum => neutron}/plugins/cisco/extensions/qos.py (90%) rename {quantum => neutron}/plugins/cisco/l2device_plugin_base.py (100%) rename {quantum => neutron}/plugins/cisco/models/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/models/virt_phy_sw_v2.py (97%) rename {quantum => neutron}/plugins/cisco/network_plugin.py (96%) rename {quantum => neutron}/plugins/cisco/nexus/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py (96%) rename {quantum => neutron}/plugins/cisco/nexus/cisco_nexus_plugin_v2.py (96%) rename {quantum => neutron}/plugins/cisco/nexus/cisco_nexus_snippets.py (100%) rename {quantum/plugins/linuxbridge => neutron/plugins/cisco/test}/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/test/nexus/__init__.py (100%) rename {quantum => neutron}/plugins/cisco/test/nexus/fake_nexus_driver.py (100%) rename {quantum => neutron}/plugins/common/__init__.py (100%) rename {quantum => neutron}/plugins/common/constants.py (100%) rename {quantum => neutron}/plugins/common/utils.py (96%) rename {quantum => neutron}/plugins/hyperv/__init__.py (100%) rename {quantum => neutron}/plugins/hyperv/agent/__init__.py (100%) rename quantum/plugins/hyperv/agent/hyperv_quantum_agent.py => neutron/plugins/hyperv/agent/hyperv_neutron_agent.py (96%) rename {quantum => neutron}/plugins/hyperv/agent/utils.py (98%) rename {quantum => neutron}/plugins/hyperv/agent_notifier_api.py (94%) rename {quantum => neutron}/plugins/hyperv/common/__init__.py (100%) rename {quantum => neutron}/plugins/hyperv/common/constants.py (100%) rename {quantum => neutron}/plugins/hyperv/db.py (97%) rename quantum/plugins/hyperv/hyperv_quantum_plugin.py => neutron/plugins/hyperv/hyperv_neutron_plugin.py (89%) rename {quantum => neutron}/plugins/hyperv/model.py (97%) rename {quantum => neutron}/plugins/hyperv/rpc_callbacks.py (93%) rename {quantum => neutron}/plugins/linuxbridge/README (70%) rename {quantum/plugins/linuxbridge/agent => neutron/plugins/linuxbridge}/__init__.py (100%) rename {quantum/plugins/nicira/dbexts => neutron/plugins/linuxbridge/agent}/__init__.py (100%) rename quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py => neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py (95%) rename {quantum => neutron}/plugins/linuxbridge/common/__init__.py (100%) rename {quantum => neutron}/plugins/linuxbridge/common/config.py (96%) rename {quantum => neutron}/plugins/linuxbridge/common/constants.py (100%) rename {quantum => neutron}/plugins/linuxbridge/db/__init__.py (100%) rename {quantum => neutron}/plugins/linuxbridge/db/l2network_db_v2.py (95%) rename {quantum => neutron}/plugins/linuxbridge/db/l2network_models_v2.py (98%) rename quantum/plugins/linuxbridge/lb_quantum_plugin.py => neutron/plugins/linuxbridge/lb_neutron_plugin.py (92%) rename {quantum => neutron}/plugins/metaplugin/README (69%) rename {quantum => neutron}/plugins/metaplugin/__init__.py (100%) rename {quantum => neutron}/plugins/metaplugin/common/__init__.py (100%) rename {quantum => neutron}/plugins/metaplugin/common/config.py (100%) rename {quantum => neutron}/plugins/metaplugin/meta_db_v2.py (96%) rename {quantum => neutron}/plugins/metaplugin/meta_models_v2.py (97%) rename quantum/plugins/metaplugin/meta_quantum_plugin.py => neutron/plugins/metaplugin/meta_neutron_plugin.py (94%) rename quantum/plugins/metaplugin/proxy_quantum_plugin.py => neutron/plugins/metaplugin/proxy_neutron_plugin.py (93%) rename {quantum => neutron}/plugins/metaplugin/run_tests.py (78%) rename {quantum => neutron}/plugins/midonet/__init__.py (100%) rename {quantum => neutron}/plugins/midonet/config.py (100%) rename {quantum => neutron}/plugins/midonet/midonet_lib.py (99%) rename {quantum => neutron}/plugins/midonet/plugin.py (94%) rename {quantum => neutron}/plugins/ml2/README (100%) rename {quantum => neutron}/plugins/ml2/__init__.py (100%) rename {quantum => neutron}/plugins/ml2/config.py (89%) rename {quantum => neutron}/plugins/ml2/db.py (90%) rename {quantum => neutron}/plugins/ml2/driver_api.py (97%) rename {quantum => neutron}/plugins/ml2/drivers/__init__.py (100%) rename {quantum => neutron}/plugins/ml2/drivers/type_flat.py (96%) rename {quantum => neutron}/plugins/ml2/drivers/type_local.py (93%) rename {quantum => neutron}/plugins/ml2/drivers/type_vlan.py (97%) rename {quantum => neutron}/plugins/ml2/managers.py (94%) rename {quantum => neutron}/plugins/ml2/models.py (85%) rename {quantum => neutron}/plugins/ml2/plugin.py (90%) rename {quantum => neutron}/plugins/ml2/rpc.py (93%) rename {quantum => neutron}/plugins/mlnx/README (54%) rename {quantum => neutron}/plugins/mlnx/__init__.py (100%) rename {quantum => neutron}/plugins/mlnx/agent/__init__.py (100%) rename quantum/plugins/mlnx/agent/eswitch_quantum_agent.py => neutron/plugins/mlnx/agent/eswitch_neutron_agent.py (94%) rename {quantum => neutron}/plugins/mlnx/agent/utils.py (97%) rename {quantum => neutron}/plugins/mlnx/agent_notify_api.py (94%) rename {quantum => neutron}/plugins/mlnx/common/__init__.py (100%) rename {quantum => neutron}/plugins/mlnx/common/config.py (96%) rename {quantum => neutron}/plugins/mlnx/common/constants.py (100%) rename {quantum => neutron}/plugins/mlnx/common/exceptions.py (88%) rename {quantum => neutron}/plugins/mlnx/db/__init__.py (100%) rename {quantum => neutron}/plugins/mlnx/db/mlnx_db_v2.py (97%) rename {quantum => neutron}/plugins/mlnx/db/mlnx_models_v2.py (98%) rename {quantum => neutron}/plugins/mlnx/mlnx_plugin.py (93%) rename {quantum => neutron}/plugins/mlnx/rpc_callbacks.py (91%) rename {quantum => neutron}/plugins/nec/README (86%) rename {quantum => neutron}/plugins/nec/__init__.py (100%) rename {quantum => neutron}/plugins/nec/agent/__init__.py (100%) rename quantum/plugins/nec/agent/nec_quantum_agent.py => neutron/plugins/nec/agent/nec_neutron_agent.py (90%) rename {quantum => neutron}/plugins/nec/common/__init__.py (100%) rename {quantum => neutron}/plugins/nec/common/config.py (94%) rename {quantum => neutron}/plugins/nec/common/exceptions.py (81%) rename {quantum => neutron}/plugins/nec/common/ofc_client.py (97%) rename {quantum => neutron}/plugins/nec/db/__init__.py (100%) rename {quantum => neutron}/plugins/nec/db/api.py (74%) rename {quantum => neutron}/plugins/nec/db/models.py (82%) rename {quantum => neutron}/plugins/nec/db/nec_plugin_base.py (93%) rename {quantum => neutron}/plugins/nec/drivers/__init__.py (89%) rename {quantum => neutron}/plugins/nec/drivers/pfc.py (97%) rename {quantum => neutron}/plugins/nec/drivers/trema.py (98%) rename {quantum => neutron}/plugins/nec/extensions/__init__.py (100%) rename {quantum => neutron}/plugins/nec/extensions/packetfilter.py (95%) rename {quantum => neutron}/plugins/nec/nec_plugin.py (95%) rename {quantum => neutron}/plugins/nec/ofc_driver_base.py (86%) rename {quantum => neutron}/plugins/nec/ofc_manager.py (88%) rename quantum/plugins/nicira/QuantumPlugin.py => neutron/plugins/nicira/NeutronPlugin.py (92%) rename {quantum => neutron}/plugins/nicira/NvpApiClient.py (99%) rename {quantum => neutron}/plugins/nicira/README (66%) rename {quantum => neutron}/plugins/nicira/__init__.py (100%) rename {quantum => neutron}/plugins/nicira/api_client/__init__.py (100%) rename {quantum => neutron}/plugins/nicira/api_client/client.py (99%) rename {quantum => neutron}/plugins/nicira/api_client/client_eventlet.py (98%) rename {quantum => neutron}/plugins/nicira/api_client/common.py (100%) rename {quantum => neutron}/plugins/nicira/api_client/request.py (99%) rename {quantum => neutron}/plugins/nicira/api_client/request_eventlet.py (98%) rename {quantum => neutron}/plugins/nicira/check_nvp_config.py (94%) rename {quantum => neutron}/plugins/nicira/common/__init__.py (100%) rename {quantum => neutron}/plugins/nicira/common/config.py (95%) rename {quantum => neutron}/plugins/nicira/common/exceptions.py (95%) rename {quantum => neutron}/plugins/nicira/common/metadata_access.py (93%) rename {quantum => neutron}/plugins/nicira/common/securitygroups.py (95%) rename {quantum/plugins/openvswitch => neutron/plugins/nicira/dbexts}/__init__.py (100%) rename {quantum => neutron}/plugins/nicira/dbexts/maclearning.py (94%) rename {quantum => neutron}/plugins/nicira/dbexts/nicira_db.py (83%) rename {quantum => neutron}/plugins/nicira/dbexts/nicira_models.py (91%) rename {quantum => neutron}/plugins/nicira/dbexts/nicira_networkgw_db.py (97%) rename {quantum => neutron}/plugins/nicira/dbexts/nicira_qos_db.py (97%) rename {quantum => neutron}/plugins/nicira/extensions/__init__.py (100%) rename {quantum => neutron}/plugins/nicira/extensions/maclearning.py (97%) rename {quantum => neutron}/plugins/nicira/extensions/nvp_networkgw.py (91%) rename {quantum => neutron}/plugins/nicira/extensions/nvp_qos.py (96%) rename {quantum => neutron}/plugins/nicira/nvp_cluster.py (98%) rename {quantum => neutron}/plugins/nicira/nvplib.py (93%) rename {quantum => neutron}/plugins/openvswitch/README (72%) rename {quantum/plugins/openvswitch/agent => neutron/plugins/openvswitch}/__init__.py (100%) rename {quantum/plugins/ryu => neutron/plugins/openvswitch/agent}/__init__.py (100%) rename quantum/plugins/openvswitch/agent/ovs_quantum_agent.py => neutron/plugins/openvswitch/agent/ovs_neutron_agent.py (97%) rename {quantum => neutron}/plugins/openvswitch/agent/xenapi/README (91%) rename {quantum => neutron}/plugins/openvswitch/agent/xenapi/contrib/build-rpm.sh (67%) rename {quantum => neutron}/plugins/openvswitch/agent/xenapi/contrib/rpmbuild/SPECS/openstack-quantum-xen-plugins.spec (79%) rename {quantum => neutron}/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap (98%) rename {quantum => neutron}/plugins/openvswitch/common/__init__.py (100%) rename {quantum => neutron}/plugins/openvswitch/common/config.py (95%) rename {quantum => neutron}/plugins/openvswitch/common/constants.py (100%) rename {quantum => neutron}/plugins/openvswitch/ovs_db_v2.py (96%) rename {quantum => neutron}/plugins/openvswitch/ovs_models_v2.py (98%) rename quantum/plugins/openvswitch/ovs_quantum_plugin.py => neutron/plugins/openvswitch/ovs_neutron_plugin.py (91%) create mode 100644 neutron/plugins/plumgrid/README rename {quantum => neutron}/plugins/plumgrid/__init__.py (100%) rename {quantum => neutron}/plugins/plumgrid/common/__init__.py (100%) rename {quantum => neutron}/plugins/plumgrid/common/exceptions.py (86%) rename {quantum => neutron}/plugins/plumgrid/plumgrid_nos_plugin/__init__.py (100%) rename {quantum => neutron}/plugins/plumgrid/plumgrid_nos_plugin/plugin_ver.py (100%) rename {quantum => neutron}/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_nos_snippets.py (92%) rename {quantum => neutron}/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py (81%) rename {quantum => neutron}/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py (92%) rename {quantum => neutron}/plugins/ryu/README (79%) rename {quantum/plugins/ryu/agent => neutron/plugins/ryu}/__init__.py (100%) rename {quantum/plugins/ryu/db => neutron/plugins/ryu/agent}/__init__.py (100%) rename quantum/plugins/ryu/agent/ryu_quantum_agent.py => neutron/plugins/ryu/agent/ryu_neutron_agent.py (92%) rename {quantum => neutron}/plugins/ryu/common/__init__.py (100%) rename {quantum => neutron}/plugins/ryu/common/config.py (97%) create mode 100644 neutron/plugins/ryu/db/__init__.py rename {quantum => neutron}/plugins/ryu/db/api_v2.py (95%) rename {quantum => neutron}/plugins/ryu/db/models_v2.py (97%) rename quantum/plugins/ryu/ryu_quantum_plugin.py => neutron/plugins/ryu/ryu_neutron_plugin.py (85%) rename {quantum => neutron}/policy.py (95%) rename {quantum => neutron}/quota.py (98%) rename {quantum => neutron}/rootwrap/__init__.py (100%) rename {quantum => neutron}/rootwrap/filters.py (97%) rename {quantum => neutron}/rootwrap/wrapper.py (99%) rename {quantum => neutron}/scheduler/__init__.py (93%) rename {quantum => neutron}/scheduler/dhcp_agent_scheduler.py (96%) rename {quantum => neutron}/scheduler/l3_agent_scheduler.py (97%) rename {quantum => neutron}/server/__init__.py (81%) rename {quantum => neutron}/service.py (88%) rename {quantum => neutron}/services/__init__.py (100%) rename {quantum => neutron}/services/loadbalancer/__init__.py (100%) rename {quantum => neutron}/services/loadbalancer/constants.py (100%) rename {quantum => neutron}/services/loadbalancer/drivers/__init__.py (100%) rename {quantum => neutron}/services/loadbalancer/drivers/abstract_driver.py (100%) rename {quantum => neutron}/services/loadbalancer/drivers/haproxy/__init__.py (100%) rename {quantum => neutron}/services/loadbalancer/drivers/haproxy/agent.py (82%) rename {quantum => neutron}/services/loadbalancer/drivers/haproxy/agent_api.py (98%) rename {quantum => neutron}/services/loadbalancer/drivers/haproxy/agent_manager.py (95%) rename {quantum => neutron}/services/loadbalancer/drivers/haproxy/cfg.py (97%) rename {quantum => neutron}/services/loadbalancer/drivers/haproxy/namespace_driver.py (97%) rename {quantum => neutron}/services/loadbalancer/drivers/haproxy/plugin_driver.py (95%) rename {quantum => neutron}/services/loadbalancer/drivers/noop/__init__.py (100%) rename {quantum => neutron}/services/loadbalancer/drivers/noop/noop_driver.py (96%) rename {quantum => neutron}/services/loadbalancer/plugin.py (94%) rename {quantum => neutron}/services/service_base.py (94%) rename {quantum => neutron}/tests/__init__.py (100%) rename {quantum => neutron}/tests/base.py (98%) rename {quantum => neutron}/tests/etc/api-paste.ini.test (55%) rename quantum/tests/etc/quantum.conf.test => neutron/tests/etc/neutron.conf.test (83%) rename {quantum => neutron}/tests/etc/rootwrap.d/quantum.test.filters (66%) rename {quantum => neutron}/tests/unit/__init__.py (100%) rename {quantum => neutron}/tests/unit/_test_extension_portbindings.py (90%) rename {quantum => neutron}/tests/unit/_test_rootwrap_exec.py (92%) rename {quantum => neutron}/tests/unit/bigswitch/__init__.py (100%) rename {quantum => neutron}/tests/unit/bigswitch/etc/restproxy.ini.test (100%) rename {quantum => neutron}/tests/unit/bigswitch/test_restproxy_plugin.py (91%) rename {quantum => neutron}/tests/unit/bigswitch/test_router_db.py (97%) rename {quantum => neutron}/tests/unit/brocade/__init__.py (100%) rename {quantum => neutron}/tests/unit/brocade/test_brocade_db.py (94%) rename {quantum => neutron}/tests/unit/brocade/test_brocade_plugin.py (80%) rename {quantum => neutron}/tests/unit/brocade/test_brocade_vlan.py (92%) rename {quantum => neutron}/tests/unit/cisco/__init__.py (100%) rename {quantum => neutron}/tests/unit/cisco/test_network_plugin.py (95%) rename {quantum => neutron}/tests/unit/cisco/test_nexus_plugin.py (94%) rename {quantum => neutron}/tests/unit/database_stubs.py (97%) rename {quantum => neutron}/tests/unit/db/__init__.py (100%) rename {quantum => neutron}/tests/unit/db/loadbalancer/__init__.py (100%) rename {quantum => neutron}/tests/unit/db/loadbalancer/test_db_loadbalancer.py (98%) rename {quantum => neutron}/tests/unit/dummy_plugin.py (88%) rename {quantum => neutron}/tests/unit/extension_stubs.py (96%) rename {quantum => neutron}/tests/unit/extensions/__init__.py (100%) rename {quantum => neutron}/tests/unit/extensions/extendedattribute.py (98%) rename {quantum => neutron}/tests/unit/extensions/extensionattribute.py (94%) rename {quantum => neutron}/tests/unit/extensions/foxinsocks.py (97%) rename {quantum => neutron}/tests/unit/extensions/v2attributes.py (100%) rename {quantum => neutron}/tests/unit/hyperv/__init__.py (100%) rename quantum/tests/unit/hyperv/test_hyperv_quantum_agent.py => neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py (91%) rename quantum/tests/unit/hyperv/test_hyperv_quantum_plugin.py => neutron/tests/unit/hyperv/test_hyperv_neutron_plugin.py (70%) rename {quantum => neutron}/tests/unit/hyperv/test_hyperv_rpcapi.py (85%) rename {quantum => neutron}/tests/unit/linuxbridge/__init__.py (100%) rename {quantum => neutron}/tests/unit/linuxbridge/test_agent_scheduler.py (88%) rename {quantum => neutron}/tests/unit/linuxbridge/test_defaults.py (93%) rename {quantum => neutron}/tests/unit/linuxbridge/test_lb_db.py (96%) rename quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py => neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py (95%) rename {quantum => neutron}/tests/unit/linuxbridge/test_lb_security_group.py (86%) rename {quantum => neutron}/tests/unit/linuxbridge/test_linuxbridge_plugin.py (84%) rename {quantum => neutron}/tests/unit/linuxbridge/test_rpcapi.py (95%) rename {quantum => neutron}/tests/unit/metaplugin/__init__.py (100%) rename {quantum => neutron}/tests/unit/metaplugin/fake_plugin.py (94%) rename {quantum => neutron}/tests/unit/metaplugin/test_basic.py (82%) rename {quantum => neutron}/tests/unit/metaplugin/test_metaplugin.py (93%) rename {quantum => neutron}/tests/unit/midonet/__init__.py (100%) rename {quantum => neutron}/tests/unit/midonet/etc/midonet.ini.test (100%) rename {quantum => neutron}/tests/unit/midonet/mock_lib.py (100%) rename {quantum => neutron}/tests/unit/midonet/test_midonet_lib.py (98%) rename {quantum => neutron}/tests/unit/midonet/test_midonet_plugin.py (91%) rename {quantum => neutron}/tests/unit/ml2/__init__.py (100%) rename {quantum => neutron}/tests/unit/ml2/test_agent_scheduler.py (90%) rename {quantum => neutron}/tests/unit/ml2/test_ml2_plugin.py (87%) rename {quantum => neutron}/tests/unit/ml2/test_rpcapi.py (94%) rename {quantum => neutron}/tests/unit/ml2/test_security_group.py (88%) rename {quantum => neutron}/tests/unit/mlnx/__init__.py (100%) rename {quantum => neutron}/tests/unit/mlnx/test_defaults.py (93%) rename {quantum => neutron}/tests/unit/mlnx/test_mlnx_db.py (96%) rename {quantum => neutron}/tests/unit/mlnx/test_mlnx_plugin.py (81%) rename {quantum => neutron}/tests/unit/mlnx/test_rpcapi.py (94%) rename {quantum => neutron}/tests/unit/nec/__init__.py (100%) rename {quantum => neutron}/tests/unit/nec/stub_ofc_driver.py (97%) rename {quantum => neutron}/tests/unit/nec/test_agent_scheduler.py (90%) rename {quantum => neutron}/tests/unit/nec/test_config.py (95%) rename {quantum => neutron}/tests/unit/nec/test_db.py (96%) rename {quantum => neutron}/tests/unit/nec/test_nec_agent.py (91%) rename {quantum => neutron}/tests/unit/nec/test_nec_plugin.py (96%) rename {quantum => neutron}/tests/unit/nec/test_ofc_manager.py (96%) rename {quantum => neutron}/tests/unit/nec/test_pfc_driver.py (96%) rename {quantum => neutron}/tests/unit/nec/test_security_group.py (83%) rename {quantum => neutron}/tests/unit/nec/test_trema_driver.py (98%) rename {quantum => neutron}/tests/unit/nicira/__init__.py (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_gwservice.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lqueue.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lrouter.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lrouter_lport.json (85%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lrouter_lport_att.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lrouter_nat.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lswitch.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lswitch_lport.json (84%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lswitch_lport_att.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_lswitch_lport_status.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_get_security_profile.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_gwservice.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_lqueue.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_lrouter.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_lrouter_lport.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_lrouter_nat.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_lswitch.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_lswitch_lport.json (77%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_post_security_profile.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_put_lrouter_lport_att.json (100%) rename {quantum => neutron}/tests/unit/nicira/etc/fake_put_lswitch_lport_att.json (100%) rename quantum/tests/unit/nicira/etc/quantum.conf.test => neutron/tests/unit/nicira/etc/neutron.conf.test (100%) rename {quantum => neutron}/tests/unit/nicira/etc/nvp.ini.basic.test (100%) rename {quantum => neutron}/tests/unit/nicira/etc/nvp.ini.full.test (100%) rename {quantum => neutron}/tests/unit/nicira/etc/nvp.ini.grizzly.test (100%) rename {quantum => neutron}/tests/unit/nicira/etc/nvp.ini.test (100%) rename {quantum => neutron}/tests/unit/nicira/fake_nvpapiclient.py (98%) rename {quantum => neutron}/tests/unit/nicira/test_maclearning.py (92%) rename {quantum => neutron}/tests/unit/nicira/test_networkgw.py (96%) rename {quantum => neutron}/tests/unit/nicira/test_nicira_plugin.py (95%) rename {quantum => neutron}/tests/unit/nicira/test_nvp_api_common.py (90%) rename {quantum => neutron}/tests/unit/nicira/test_nvp_api_request.py (95%) rename {quantum => neutron}/tests/unit/nicira/test_nvp_api_request_eventlet.py (97%) rename {quantum => neutron}/tests/unit/nicira/test_nvplib.py (95%) rename {quantum => neutron}/tests/unit/nicira/test_nvpopts.py (89%) rename {quantum => neutron}/tests/unit/openvswitch/__init__.py (100%) rename {quantum => neutron}/tests/unit/openvswitch/test_agent_scheduler.py (95%) rename {quantum => neutron}/tests/unit/openvswitch/test_openvswitch_plugin.py (84%) rename {quantum => neutron}/tests/unit/openvswitch/test_ovs_db.py (97%) rename {quantum => neutron}/tests/unit/openvswitch/test_ovs_defaults.py (93%) rename {quantum => neutron}/tests/unit/openvswitch/test_ovs_lib.py (97%) rename quantum/tests/unit/openvswitch/test_ovs_quantum_agent.py => neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py (91%) rename {quantum => neutron}/tests/unit/openvswitch/test_ovs_rpcapi.py (93%) rename {quantum => neutron}/tests/unit/openvswitch/test_ovs_security_group.py (84%) rename {quantum => neutron}/tests/unit/openvswitch/test_ovs_tunnel.py (89%) rename {quantum => neutron}/tests/unit/plumgrid/__init__.py (100%) rename {quantum => neutron}/tests/unit/plumgrid/test_plumgrid_plugin.py (84%) rename {quantum => neutron}/tests/unit/ryu/__init__.py (100%) rename {quantum => neutron}/tests/unit/ryu/fake_ryu.py (100%) rename {quantum => neutron}/tests/unit/ryu/test_defaults.py (93%) rename {quantum => neutron}/tests/unit/ryu/test_ryu_agent.py (97%) rename {quantum => neutron}/tests/unit/ryu/test_ryu_db.py (86%) rename {quantum => neutron}/tests/unit/ryu/test_ryu_plugin.py (79%) rename {quantum => neutron}/tests/unit/ryu/test_ryu_security_group.py (84%) rename {quantum => neutron}/tests/unit/services/__init__.py (100%) rename {quantum => neutron}/tests/unit/services/loadbalancer/__init__.py (100%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/__init__.py (100%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/haproxy/__init__.py (100%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py (91%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/haproxy/test_agent_manager.py (98%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/haproxy/test_api.py (97%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py (96%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py (95%) rename {quantum => neutron}/tests/unit/services/loadbalancer/drivers/haproxy/test_plugin_driver.py (96%) rename {quantum => neutron}/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py (97%) rename {quantum => neutron}/tests/unit/test_agent_config.py (91%) rename {quantum => neutron}/tests/unit/test_agent_ext_plugin.py (85%) rename {quantum => neutron}/tests/unit/test_agent_linux_utils.py (98%) rename {quantum => neutron}/tests/unit/test_agent_netns_cleanup.py (91%) rename {quantum => neutron}/tests/unit/test_agent_ovs_cleanup.py (78%) rename {quantum => neutron}/tests/unit/test_agent_rpc.py (94%) rename {quantum => neutron}/tests/unit/test_api_api_common.py (95%) rename {quantum => neutron}/tests/unit/test_api_v2.py (96%) rename {quantum => neutron}/tests/unit/test_api_v2_resource.py (90%) rename {quantum => neutron}/tests/unit/test_attributes.py (99%) rename {quantum => neutron}/tests/unit/test_auth.py (93%) rename {quantum => neutron}/tests/unit/test_common_utils.py (98%) rename {quantum => neutron}/tests/unit/test_config.py (93%) rename {quantum => neutron}/tests/unit/test_db_migration.py (97%) rename {quantum => neutron}/tests/unit/test_db_plugin.py (96%) rename {quantum => neutron}/tests/unit/test_db_rpc_base.py (96%) rename {quantum => neutron}/tests/unit/test_debug_commands.py (93%) rename {quantum => neutron}/tests/unit/test_dhcp_agent.py (95%) rename {quantum => neutron}/tests/unit/test_extension_ext_gw_mode.py (95%) rename {quantum => neutron}/tests/unit/test_extension_extended_attribute.py (84%) rename {quantum => neutron}/tests/unit/test_extension_extraroute.py (97%) rename {quantum => neutron}/tests/unit/test_extension_pnet.py (90%) rename {quantum => neutron}/tests/unit/test_extension_portsecurity.py (93%) rename {quantum => neutron}/tests/unit/test_extension_security_group.py (98%) rename {quantum => neutron}/tests/unit/test_extensions.py (96%) rename {quantum => neutron}/tests/unit/test_iptables_firewall.py (99%) rename {quantum => neutron}/tests/unit/test_iptables_manager.py (87%) rename {quantum => neutron}/tests/unit/test_l3_agent.py (95%) rename {quantum => neutron}/tests/unit/test_l3_plugin.py (97%) create mode 100644 neutron/tests/unit/test_legacy.py rename {quantum => neutron}/tests/unit/test_linux_daemon.py (96%) rename {quantum => neutron}/tests/unit/test_linux_dhcp.py (96%) rename {quantum => neutron}/tests/unit/test_linux_external_process.py (98%) rename {quantum => neutron}/tests/unit/test_linux_interface.py (95%) rename {quantum => neutron}/tests/unit/test_linux_ip_lib.py (98%) rename {quantum => neutron}/tests/unit/test_metadata_agent.py (96%) rename {quantum => neutron}/tests/unit/test_metadata_namespace_proxy.py (94%) rename quantum/tests/unit/test_quantum_context.py => neutron/tests/unit/test_neutron_context.py (83%) rename quantum/tests/unit/test_quantum_manager.py => neutron/tests/unit/test_neutron_manager.py (71%) rename {quantum => neutron}/tests/unit/test_policy.py (95%) rename {quantum => neutron}/tests/unit/test_quota_ext.py (85%) rename {quantum => neutron}/tests/unit/test_rootwrap.py (96%) rename {quantum => neutron}/tests/unit/test_routerserviceinsertion.py (93%) rename {quantum => neutron}/tests/unit/test_security_groups_rpc.py (96%) rename {quantum => neutron}/tests/unit/test_servicetype.py (94%) rename {quantum => neutron}/tests/unit/test_wsgi.py (99%) rename {quantum => neutron}/tests/unit/testlib_api.py (94%) rename {quantum => neutron}/tests/var/ca.crt (100%) rename {quantum => neutron}/tests/var/certificate.crt (100%) rename {quantum => neutron}/tests/var/privatekey.key (100%) rename {quantum => neutron}/version.py (93%) rename {quantum => neutron}/wsgi.py (99%) delete mode 100644 quantum/db/migration/alembic_migrations/versions/README delete mode 100644 quantum/plugins/cisco/README delete mode 100644 quantum/plugins/plumgrid/README diff --git a/.bzrignore b/.bzrignore index d4e18c6093..6d1d90ad8c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -3,10 +3,15 @@ quantum.egg-info quantum_tests.sqlite quantum.sqlite *.quantum-venv +neutron.egg-info +neutron_tests.sqlite +neutron.sqlite +*.neutron-venv .venv dist/ ChangeLog *.pid *.log +neutron/vcsversion.py quantum/vcsversion.py .ropeproject diff --git a/.gitignore b/.gitignore index 07b0b050f3..45ab0b328d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ dist/ doc/build *.DS_Store *.pyc +neutron.egg-info/ +neutron/vcsversion.py +neutron/versioninfo quantum.egg-info/ quantum/vcsversion.py quantum/versioninfo diff --git a/.pylintrc b/.pylintrc index bd677fd6a5..021856b92b 100644 --- a/.pylintrc +++ b/.pylintrc @@ -23,7 +23,8 @@ argument-rgx=[a-z_][a-z0-9_]{1,30}$ # and be lowecased with underscores method-rgx=([a-z_][a-z0-9_]{2,50}|setUp|tearDown)$ -# Module names matching quantum-* are ok (files in bin/) +# Module names matching neutron-* are ok (files in bin/) +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(neutron-[a-z0-9_-]+))$ module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(quantum-[a-z0-9_-]+))$ # Don't require docstrings on tests. diff --git a/.testr.conf b/.testr.conf index 54f82b3628..7191440466 100644 --- a/.testr.conf +++ b/.testr.conf @@ -1,4 +1,4 @@ [DEFAULT] -test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ quantum/tests/unit $LISTOPT $IDOPTION +test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ neutron/tests/unit $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/HACKING.rst b/HACKING.rst index d3330c023a..98c8a12638 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,4 @@ -Quantum Style Commandments +Neutron Style Commandments ========================== - Step 1: Read http://www.python.org/dev/peps/pep-0008/ @@ -35,13 +35,13 @@ Example:: The following imports, - from quantum.api import networks - from quantum import wsgi + from neutron.api import networks + from neutron import wsgi are considered equivalent for ordering purposes to - import quantum.api.networks - import quantum.wsgi + import neutron.api.networks + import neutron.wsgi - Organize your imports according to the following template @@ -52,7 +52,7 @@ Example:: \n {{third-party lib imports in human alphabetical order}} \n - {{quantum imports in human alphabetical order}} + {{neutron imports in human alphabetical order}} \n \n {{begin your code}} @@ -71,13 +71,13 @@ Example:: import testtools import webob.exc - import quantum.api.networks - from quantum.api import ports - from quantum.db import models - from quantum.extensions import multiport - from quantum.openstack.common import log as logging - import quantum.manager - from quantum import service + import neutron.api.networks + from neutron.api import ports + from neutron.db import models + from neutron.extensions import multiport + from neutron.openstack.common import log as logging + import neutron.manager + from neutron import service Docstrings @@ -202,8 +202,8 @@ submitted bug fix does have a unit test, be sure to add a new one that fails without the patch and passes with the patch. All unittest classes must ultimately inherit from testtools.TestCase. In the -Quantum test suite, this should be done by inheriting from -quantum.tests.base.BaseTestCase. +Neutron test suite, this should be done by inheriting from +neutron.tests.base.BaseTestCase. All setUp and tearDown methods must upcall using the super() method. tearDown methods should be avoided and addCleanup calls should be preferred. diff --git a/MANIFEST.in b/MANIFEST.in index a4da452855..4e527c7fae 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,11 +2,11 @@ include AUTHORS include README.rst include ChangeLog include LICENSE -include quantum/db/migration/README -include quantum/db/migration/alembic.ini -include quantum/db/migration/alembic_migrations/script.py.mako -include quantum/db/migration/alembic_migrations/versions/README -recursive-include quantum/locale * +include neutron/db/migration/README +include neutron/db/migration/alembic.ini +include neutron/db/migration/alembic_migrations/script.py.mako +include neutron/db/migration/alembic_migrations/versions/README +recursive-include neutron/locale * exclude .gitignore exclude .gitreview diff --git a/README.rst b/README.rst index ebeae4166c..57a5930b04 100644 --- a/README.rst +++ b/README.rst @@ -1,25 +1,25 @@ # -- Welcome! You have come across a cloud computing network fabric controller. It has - identified itself as "Quantum." It aims to tame your (cloud) networking! + identified itself as "Neutron." It aims to tame your (cloud) networking! # -- External Resources: - The homepage for Quantum is: http://launchpad.net/quantum . Use this + The homepage for Neutron is: http://launchpad.net/neutron . Use this site for asking for help, and filing bugs. Code is available on github at - . + . - The latest and most in-depth documentation on how to use Quantum is + The latest and most in-depth documentation on how to use Neutron is available at: . This includes: - Quantum Administrator Guide + Neutron Administrator Guide http://docs.openstack.org/trunk/openstack-network/admin/content/ - Quantum API Reference: + Neutron API Reference: http://docs.openstack.org/api/openstack-network/2.0/content/ The start of some developer documentation is available at: - http://wiki.openstack.org/QuantumDevelopment + http://wiki.openstack.org/NeutronDevelopment - For help using or hacking on Quantum, you can send mail to + For help using or hacking on Neutron, you can send mail to . diff --git a/TESTING b/TESTING index d084156f0d..8162b2fd66 100644 --- a/TESTING +++ b/TESTING @@ -1,11 +1,11 @@ -Testing Quantum +Testing Neutron ============================================================= Overview The unit tests are meant to cover as much code as possible and should be executed without the service running. They are designed to test - the various pieces of the quantum tree to make sure any new changes + the various pieces of the neutron tree to make sure any new changes don't break existing functionality. Running tests @@ -30,17 +30,17 @@ Running individual tests class separating it from the module path with a colon. For example, the following would run only the JSONV2TestCase tests from - quantum/tests/unit/test_api_v2.py: + neutron/tests/unit/test_api_v2.py: - $ ./run_tests.sh quantum.tests.unit.test_api_v2:JSONV2TestCase + $ ./run_tests.sh neutron.tests.unit.test_api_v2:JSONV2TestCase or - $ ./tox quantum.tests.unit.test_api_v2:JSONV2TestCase + $ ./tox neutron.tests.unit.test_api_v2:JSONV2TestCase Adding more tests - Quantum has a fast growing code base and there is plenty of areas that + Neutron has a fast growing code base and there is plenty of areas that need to be covered by unit tests. To get a grasp of the areas where unit tests are needed, you can check diff --git a/bin/neutron-dhcp-agent-dnsmasq-lease-update b/bin/neutron-dhcp-agent-dnsmasq-lease-update new file mode 100755 index 0000000000..41bbbe382d --- /dev/null +++ b/bin/neutron-dhcp-agent-dnsmasq-lease-update @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2012 OpenStack Foundation. +# 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. + +from neutron.agent.linux import dhcp +dhcp.Dnsmasq.lease_update() diff --git a/bin/neutron-rootwrap b/bin/neutron-rootwrap new file mode 100755 index 0000000000..73ec76d91c --- /dev/null +++ b/bin/neutron-rootwrap @@ -0,0 +1,133 @@ +#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2012 OpenStack Foundation. +# 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. + +"""Root wrapper for Neutron + + Filters which commands neutron is allowed to run as another user. + + To use this, you should set the following in neutron.conf and the + various .ini files for the agent plugins: + root_helper=sudo neutron-rootwrap /etc/neutron/rootwrap.conf + + You also need to let the neutron user run neutron-rootwrap as root in + /etc/sudoers: + neutron ALL = (root) NOPASSWD: /usr/bin/neutron-rootwrap + /etc/neutron/rootwrap.conf * + + Filter specs live in /etc/neutron/rootwrap.d/*.filters, or + other locations pointed to by /etc/neutron/rootwrap.conf. + To make allowed commands node-specific, your packaging should only + install apropriate .filters for commands which are needed on each + node. +""" + +from __future__ import print_function + +import ConfigParser +import logging +import os +import pwd +import signal +import subprocess +import sys + + +RC_UNAUTHORIZED = 99 +RC_NOCOMMAND = 98 +RC_BADCONFIG = 97 +RC_NOEXECFOUND = 96 + + +def _subprocess_setup(): + # Python installs a SIGPIPE handler by default. This is usually not what + # non-Python subprocesses expect. + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + + +def _exit_error(execname, message, errorcode, log=True): + print("%s: %s" % (execname, message)) + if log: + logging.error(message) + sys.exit(errorcode) + + +if __name__ == '__main__': + # Split arguments, require at least a command + execname = sys.argv.pop(0) + if len(sys.argv) < 2: + _exit_error(execname, "No command specified", RC_NOCOMMAND, log=False) + + configfile = sys.argv.pop(0) + userargs = sys.argv[:] + + # Add ../ to sys.path to allow running from branch + possible_topdir = os.path.normpath(os.path.join(os.path.abspath(execname), + os.pardir, os.pardir)) + if os.path.exists(os.path.join(possible_topdir, "neutron", "__init__.py")): + sys.path.insert(0, possible_topdir) + + from neutron.rootwrap import wrapper + + # Load configuration + try: + rawconfig = ConfigParser.RawConfigParser() + rawconfig.read(configfile) + config = wrapper.RootwrapConfig(rawconfig) + except ValueError as exc: + msg = "Incorrect value in %s: %s" % (configfile, exc.message) + _exit_error(execname, msg, RC_BADCONFIG, log=False) + except ConfigParser.Error: + _exit_error(execname, "Incorrect configuration file: %s" % configfile, + RC_BADCONFIG, log=False) + + if config.use_syslog: + wrapper.setup_syslog(execname, + config.syslog_log_facility, + config.syslog_log_level) + + # Execute command if it matches any of the loaded filters + filters = wrapper.load_filters(config.filters_path) + try: + filtermatch = wrapper.match_filter(filters, userargs, + exec_dirs=config.exec_dirs) + if filtermatch: + command = filtermatch.get_command(userargs, + exec_dirs=config.exec_dirs) + if config.use_syslog: + logging.info("(%s > %s) Executing %s (filter match = %s)" % ( + os.getlogin(), pwd.getpwuid(os.getuid())[0], + command, filtermatch.name)) + + obj = subprocess.Popen(command, + stdin=sys.stdin, + stdout=sys.stdout, + stderr=sys.stderr, + preexec_fn=_subprocess_setup, + env=filtermatch.get_environment(userargs)) + obj.wait() + sys.exit(obj.returncode) + + except wrapper.FilterMatchNotExecutable as exc: + msg = ("Executable not found: %s (filter match = %s)" + % (exc.match.exec_path, exc.match.name)) + _exit_error(execname, msg, RC_NOEXECFOUND, log=config.use_syslog) + + except wrapper.NoFilterMatched: + msg = ("Unauthorized command: %s (no filter matched)" + % ' '.join(userargs)) + _exit_error(execname, msg, RC_UNAUTHORIZED, log=config.use_syslog) diff --git a/bin/quantum-check-nvp-config b/bin/quantum-check-nvp-config index 23f19018c5..57bdbc2fd1 100755 --- a/bin/quantum-check-nvp-config +++ b/bin/quantum-check-nvp-config @@ -23,7 +23,7 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.plugins.nicira.check_nvp_config import main +from neutron.plugins.nicira.check_nvp_config import main main(sys.argv) diff --git a/bin/quantum-db-manage b/bin/quantum-db-manage index a28abe484a..24a491ec65 100755 --- a/bin/quantum-db-manage +++ b/bin/quantum-db-manage @@ -20,7 +20,7 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.db.migration.cli import main +from neutron.db.migration.cli import main main() diff --git a/bin/quantum-debug b/bin/quantum-debug index 4a7d6c3c24..5c4c67265a 100755 --- a/bin/quantum-debug +++ b/bin/quantum-debug @@ -16,5 +16,5 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.debug.shell import main +from neutron.debug.shell import main main() diff --git a/bin/quantum-dhcp-agent b/bin/quantum-dhcp-agent index 18b892717d..a160a6a565 100755 --- a/bin/quantum-dhcp-agent +++ b/bin/quantum-dhcp-agent @@ -16,5 +16,5 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent.dhcp_agent import main +from neutron.agent.dhcp_agent import main main() diff --git a/bin/quantum-dhcp-agent-dnsmasq-lease-update b/bin/quantum-dhcp-agent-dnsmasq-lease-update index 8c8b5958ac..41bbbe382d 100755 --- a/bin/quantum-dhcp-agent-dnsmasq-lease-update +++ b/bin/quantum-dhcp-agent-dnsmasq-lease-update @@ -16,5 +16,5 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent.linux import dhcp +from neutron.agent.linux import dhcp dhcp.Dnsmasq.lease_update() diff --git a/bin/quantum-hyperv-agent b/bin/quantum-hyperv-agent index 42e9c558ce..29c220838a 100755 --- a/bin/quantum-hyperv-agent +++ b/bin/quantum-hyperv-agent @@ -20,7 +20,7 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.plugins.hyperv.agent.hyperv_quantum_agent import main +from neutron.plugins.hyperv.agent.hyperv_neutron_agent import main main() diff --git a/bin/quantum-l3-agent b/bin/quantum-l3-agent index d23168632e..cd56f53845 100755 --- a/bin/quantum-l3-agent +++ b/bin/quantum-l3-agent @@ -16,5 +16,5 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent.l3_agent import main +from neutron.agent.l3_agent import main main() diff --git a/bin/quantum-lbaas-agent b/bin/quantum-lbaas-agent index 878385c231..dca1f932bc 100755 --- a/bin/quantum-lbaas-agent +++ b/bin/quantum-lbaas-agent @@ -20,7 +20,7 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.services.loadbalancer.drivers.haproxy.agent import main +from neutron.services.loadbalancer.drivers.haproxy.agent import main main() diff --git a/bin/quantum-linuxbridge-agent b/bin/quantum-linuxbridge-agent index 92f7ca2501..ce7d1e081b 100755 --- a/bin/quantum-linuxbridge-agent +++ b/bin/quantum-linuxbridge-agent @@ -19,6 +19,6 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.plugins.linuxbridge.agent.linuxbridge_quantum_agent import main +from neutron.plugins.linuxbridge.agent.linuxbridge_neutron_agent import main main() diff --git a/bin/quantum-metadata-agent b/bin/quantum-metadata-agent index 6fede5fe4f..8834909709 100755 --- a/bin/quantum-metadata-agent +++ b/bin/quantum-metadata-agent @@ -16,5 +16,5 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent.metadata.agent import main +from neutron.agent.metadata.agent import main main() diff --git a/bin/quantum-mlnx-agent b/bin/quantum-mlnx-agent index 263e103732..56d03bf033 100755 --- a/bin/quantum-mlnx-agent +++ b/bin/quantum-mlnx-agent @@ -19,7 +19,7 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.plugins.mlnx.agent.eswitch_quantum_agent import main +from neutron.plugins.mlnx.agent.eswitch_neutron_agent import main main() diff --git a/bin/quantum-nec-agent b/bin/quantum-nec-agent index b99e45f42b..796e4ddc7f 100755 --- a/bin/quantum-nec-agent +++ b/bin/quantum-nec-agent @@ -19,6 +19,6 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.plugins.nec.agent.nec_quantum_agent import main +from neutron.plugins.nec.agent.nec_neutron_agent import main main() diff --git a/bin/quantum-netns-cleanup b/bin/quantum-netns-cleanup index 06710cba01..86fbdbe011 100755 --- a/bin/quantum-netns-cleanup +++ b/bin/quantum-netns-cleanup @@ -16,5 +16,5 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent.netns_cleanup_util import main +from neutron.agent.netns_cleanup_util import main main() diff --git a/bin/quantum-ns-metadata-proxy b/bin/quantum-ns-metadata-proxy index 00fff9beba..3a8c3b0fc2 100755 --- a/bin/quantum-ns-metadata-proxy +++ b/bin/quantum-ns-metadata-proxy @@ -16,5 +16,5 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent.metadata.namespace_proxy import main +from neutron.agent.metadata.namespace_proxy import main main() diff --git a/bin/quantum-openvswitch-agent b/bin/quantum-openvswitch-agent index 4948542654..ccba60419c 100755 --- a/bin/quantum-openvswitch-agent +++ b/bin/quantum-openvswitch-agent @@ -19,6 +19,6 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.plugins.openvswitch.agent.ovs_quantum_agent import main +from neutron.plugins.openvswitch.agent.ovs_neutron_agent import main main() diff --git a/bin/quantum-ovs-cleanup b/bin/quantum-ovs-cleanup index be02bfbb8b..b77775d6cd 100755 --- a/bin/quantum-ovs-cleanup +++ b/bin/quantum-ovs-cleanup @@ -20,7 +20,7 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.agent.ovs_cleanup_util import main +from neutron.agent.ovs_cleanup_util import main main() diff --git a/bin/quantum-rootwrap b/bin/quantum-rootwrap index 8f0158c71a..73ec76d91c 100755 --- a/bin/quantum-rootwrap +++ b/bin/quantum-rootwrap @@ -16,21 +16,21 @@ # License for the specific language governing permissions and limitations # under the License. -"""Root wrapper for Quantum +"""Root wrapper for Neutron - Filters which commands quantum is allowed to run as another user. + Filters which commands neutron is allowed to run as another user. - To use this, you should set the following in quantum.conf and the + To use this, you should set the following in neutron.conf and the various .ini files for the agent plugins: - root_helper=sudo quantum-rootwrap /etc/quantum/rootwrap.conf + root_helper=sudo neutron-rootwrap /etc/neutron/rootwrap.conf - You also need to let the quantum user run quantum-rootwrap as root in + You also need to let the neutron user run neutron-rootwrap as root in /etc/sudoers: - quantum ALL = (root) NOPASSWD: /usr/bin/quantum-rootwrap - /etc/quantum/rootwrap.conf * + neutron ALL = (root) NOPASSWD: /usr/bin/neutron-rootwrap + /etc/neutron/rootwrap.conf * - Filter specs live in /etc/quantum/rootwrap.d/*.filters, or - other locations pointed to by /etc/quantum/rootwrap.conf. + Filter specs live in /etc/neutron/rootwrap.d/*.filters, or + other locations pointed to by /etc/neutron/rootwrap.conf. To make allowed commands node-specific, your packaging should only install apropriate .filters for commands which are needed on each node. @@ -78,10 +78,10 @@ if __name__ == '__main__': # Add ../ to sys.path to allow running from branch possible_topdir = os.path.normpath(os.path.join(os.path.abspath(execname), os.pardir, os.pardir)) - if os.path.exists(os.path.join(possible_topdir, "quantum", "__init__.py")): + if os.path.exists(os.path.join(possible_topdir, "neutron", "__init__.py")): sys.path.insert(0, possible_topdir) - from quantum.rootwrap import wrapper + from neutron.rootwrap import wrapper # Load configuration try: diff --git a/bin/quantum-rpc-zmq-receiver b/bin/quantum-rpc-zmq-receiver index 36b0f1ac08..d52ca9609e 100755 --- a/bin/quantum-rpc-zmq-receiver +++ b/bin/quantum-rpc-zmq-receiver @@ -22,19 +22,19 @@ import contextlib import os import sys -# If ../quantum/__init__.py exists, add ../ to Python search path, so that +# If ../neutron/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir)) -if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'quantum', '__init__.py')): +if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'neutron', '__init__.py')): sys.path.insert(0, POSSIBLE_TOPDIR) from oslo.config import cfg -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import impl_zmq +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import impl_zmq CONF = cfg.CONF CONF.register_opts(rpc.rpc_opts) @@ -42,8 +42,8 @@ CONF.register_opts(impl_zmq.zmq_opts) def main(): - CONF(sys.argv[1:], project='quantum') - logging.setup("quantum") + CONF(sys.argv[1:], project='neutron') + logging.setup("neutron") with contextlib.closing(impl_zmq.ZmqProxy(CONF)) as reactor: reactor.consume_in_thread() diff --git a/bin/quantum-ryu-agent b/bin/quantum-ryu-agent index 3c0d98f589..d6815a3c3a 100755 --- a/bin/quantum-ryu-agent +++ b/bin/quantum-ryu-agent @@ -19,6 +19,6 @@ import os import sys sys.path.insert(0, os.getcwd()) -from quantum.plugins.ryu.agent.ryu_quantum_agent import main +from neutron.plugins.ryu.agent.ryu_neutron_agent import main main() diff --git a/bin/quantum-server b/bin/quantum-server index ec0f70f89d..54ee21bd72 100755 --- a/bin/quantum-server +++ b/bin/quantum-server @@ -22,6 +22,6 @@ eventlet.monkey_patch() import os import sys sys.path.insert(0, os.getcwd()) -from quantum.server import main as server +from neutron.server import main as server server() diff --git a/bin/quantum-usage-audit b/bin/quantum-usage-audit index fd841e77cf..b1c1b1203a 100755 --- a/bin/quantum-usage-audit +++ b/bin/quantum-usage-audit @@ -23,17 +23,17 @@ subnets. from oslo.config import cfg -from quantum import context -from quantum import manager -from quantum.common import config -from quantum.openstack.common.notifier import api as notifier_api +from neutron import context +from neutron import manager +from neutron.common import config +from neutron.openstack.common.notifier import api as notifier_api if __name__ == '__main__': - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') config.setup_logging(cfg.CONF) context = context.get_admin_context() - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() for network in plugin.get_networks(context): notifier_api.notify(context, notifier_api.publisher_id('network'), diff --git a/doc/pom.xml b/doc/pom.xml index dcc387cd12..6fc579f805 100644 --- a/doc/pom.xml +++ b/doc/pom.xml @@ -92,28 +92,28 @@ 0 - - + + + todir="${basedir}/target/docbkx/webhelp/trunk/developer/neutron-api-1.0"> + dir="${basedir}/target/docbkx/webhelp/neutron-api-1.0/neutron-api-guide/"> + file="${basedir}/target/docbkx/pdf/neutron-api-1.0/neutron-api-guide.pdf" + tofile="${basedir}/target/docbkx/webhelp/trunk/developer/neutron-api-1.0/neutron-api-guide-trunk.pdf"/> + dir="${basedir}/target/docbkx/webhelp/neutron-api-1.0"/> @@ -123,7 +123,7 @@ true source/docbkx - quantum-api-1.0/quantum-api-guide.xml + neutron-api-1.0/neutron-api-guide.xml reviewer openstack diff --git a/doc/source/conf.py b/doc/source/conf.py index e5e764fbba..51801f5a8a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -34,8 +34,8 @@ import sys # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -QUANTUM_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) -sys.path.insert(0, QUANTUM_DIR) +NEUTRON_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", "..")) +sys.path.insert(0, NEUTRON_DIR) # -- General configuration --------------------------------------------------- @@ -68,7 +68,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'Quantum' +project = u'Neutron' copyright = u'2011-present, OpenStack Foundation.' # The version info for the project you're documenting, acts as replacement for @@ -76,10 +76,10 @@ copyright = u'2011-present, OpenStack Foundation.' # built documents. # # Version info -from quantum.version import version_info as quantum_version -release = quantum_version.release_string() +from neutron.version import version_info as neutron_version +release = neutron_version.release_string() # The short X.Y version. -version = quantum_version.version_string() +version = neutron_version.version_string() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -116,7 +116,7 @@ show_authors = True pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -modindex_common_prefix = ['quantum.'] +modindex_common_prefix = ['neutron.'] # -- Options for man page output -------------------------------------------- @@ -124,7 +124,7 @@ modindex_common_prefix = ['quantum.'] # List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' man_pages = [ - ('man/quantum-server', 'quantum-server', u'Quantum Server', + ('man/neutron-server', 'neutron-server', u'Neutron Server', [u'OpenStack'], 1) ] @@ -203,7 +203,7 @@ html_last_updated_fmt = os.popen(git_cmd).read() #html_file_suffix = '' # Output file base name for HTML help builder. -htmlhelp_basename = 'quantumdoc' +htmlhelp_basename = 'neutrondoc' # -- Options for LaTeX output ------------------------------------------------ @@ -218,8 +218,8 @@ htmlhelp_basename = 'quantumdoc' # (source start file, target name, title, author, # documentclass [howto/manual]). latex_documents = [ - ('index', 'Quantum.tex', u'Quantum Documentation', - u'Quantum development team', 'manual'), + ('index', 'Neutron.tex', u'Neutron Documentation', + u'Neutron development team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/doc/source/devref/common.rst b/doc/source/devref/common.rst index bcadcdad87..537d4c291b 100644 --- a/doc/source/devref/common.rst +++ b/doc/source/devref/common.rst @@ -19,7 +19,7 @@ Open Stack Common ================= A number of modules used are from the openstack-common project. -The imported files are in 'quantum/openstack-common.conf'. +The imported files are in 'neutron/openstack-common.conf'. More information can be found at `OpenStack Common`_. .. _`OpenStack Common`: https://launchpad.net/openstack-common diff --git a/doc/source/devref/index.rst b/doc/source/devref/index.rst index 3d8c7609d2..bf0a005a61 100644 --- a/doc/source/devref/index.rst +++ b/doc/source/devref/index.rst @@ -18,6 +18,6 @@ Developer Guide =============== -The `Quantum Wiki`_ is a very good place to start. +The `Neutron Wiki`_ is a very good place to start. -.. _`Quantum wiki`: http://wiki.openstack.org/Quantum +.. _`Neutron wiki`: http://wiki.openstack.org/Neutron diff --git a/doc/source/devref/plugin-api.rst b/doc/source/devref/plugin-api.rst index fbf72abf74..12b862cfdc 100644 --- a/doc/source/devref/plugin-api.rst +++ b/doc/source/devref/plugin-api.rst @@ -1,7 +1,7 @@ Plugin API ========== -.. automodule:: quantum.quantum_plugin_base_v2 +.. automodule:: neutron.neutron_plugin_base_v2 -.. autoclass:: QuantumPluginBaseV2 +.. autoclass:: NeutronPluginBaseV2 :members: diff --git a/doc/source/index.rst b/doc/source/index.rst index 5539a78d4c..3e253ae5d2 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -14,27 +14,27 @@ License for the specific language governing permissions and limitations under the License. -Welcome to Quantum's developer documentation! +Welcome to Neutron's developer documentation! ============================================= -Quantum is an OpenStack project to provide "network connectivity as a service" +Neutron is an OpenStack project to provide "network connectivity as a service" between interface devices (e.g., vNICs) managed by other Openstack services -(e.g., nova). It implements the `Quantum API Guide`_. +(e.g., nova). It implements the `Neutron API Guide`_. -.. _`Quantum API Guide`: http://docs.openstack.org/incubation/openstack-network/developer/quantum-api-1.0/content/ +.. _`Neutron API Guide`: http://docs.openstack.org/incubation/openstack-network/developer/quantum-api-1.0/content/ -This document describes Quantum for contributors of the project, and assumes -that you are already familiar with Quantum from an `end-user perspective`_. +This document describes Neutron for contributors of the project, and assumes +that you are already familiar with Neutron from an `end-user perspective`_. .. _`end-user perspective`: http://docs.openstack.org/trunk/openstack-network/admin/content/index.html This documentation is generated by the Sphinx toolkit and lives in the source -tree. Additional documentation on Quantum and other components of OpenStack -can be found on the `OpenStack wiki`_. The `Quantum Development wiki`_ is a very good +tree. Additional documentation on Neutron and other components of OpenStack +can be found on the `OpenStack wiki`_. The `Neutron Development wiki`_ is a very good place to start. .. _`OpenStack wiki`: http://wiki.openstack.org -.. _`Quantum Development wiki`: http://wiki.openstack.org/QuantumDevelopment +.. _`Neutron Development wiki`: http://wiki.openstack.org/NeutronDevelopment Enjoy! @@ -53,4 +53,4 @@ Man Pages .. toctree:: - man/quantum-server + man/neutron-server diff --git a/doc/source/man/quantum-server.rst b/doc/source/man/neutron-server.rst similarity index 75% rename from doc/source/man/quantum-server.rst rename to doc/source/man/neutron-server.rst index 6a0bc9a64f..d1726770b3 100644 --- a/doc/source/man/quantum-server.rst +++ b/doc/source/man/neutron-server.rst @@ -1,9 +1,9 @@ ============== -quantum-server +neutron-server ============== -------------- -Quantum Server +Neutron Server -------------- :Author: openstack@lists.launchpad.net @@ -16,13 +16,13 @@ Quantum Server SYNOPSIS ======== - quantum-server [options] + neutron-server [options] DESCRIPTION =========== -quantum-server provides a webserver that exposes the Quantum API, and -passes all webservice calls to the Quantum plugin for processing. +neutron-server provides a webserver that exposes the Neutron API, and +passes all webservice calls to the Neutron plugin for processing. OPTIONS ======= @@ -32,12 +32,12 @@ OPTIONS -v, --verbose Print more verbose output -d, --debug Print debugging output --config-file=PATH Path to the config file to use, for example, - /etc/quantum/quantum.conf. When not specified + /etc/neutron/neutron.conf. When not specified (the default), we generally look at the first argument specified to be a config file, and if that is also missing, we search standard directories for a config - file. (/etc/quantum/, - /usr/lib/pythonX/site-packages/quantum/) + file. (/etc/neutron/, + /usr/lib/pythonX/site-packages/neutron/) Logging Options: The following configuration options are specific to logging @@ -61,15 +61,15 @@ FILES ======== plugins.ini file contains the plugin information -quantum.conf file contains configuration information in the form of python-gflags. +neutron.conf file contains configuration information in the form of python-gflags. SEE ALSO ======== -* `OpenStack Quantum `__ +* `OpenStack Neutron `__ BUGS ==== -* Quantum is sourced in Launchpad so you can view current bugs at `OpenStack Bugs `__ +* Neutron is sourced in Launchpad so you can view current bugs at `OpenStack Bugs `__ diff --git a/etc/api-paste.ini b/etc/api-paste.ini index b8e8ee1425..8c084953fe 100644 --- a/etc/api-paste.ini +++ b/etc/api-paste.ini @@ -1,24 +1,24 @@ -[composite:quantum] +[composite:neutron] use = egg:Paste#urlmap -/: quantumversions -/v2.0: quantumapi_v2_0 +/: neutronversions +/v2.0: neutronapi_v2_0 -[composite:quantumapi_v2_0] -use = call:quantum.auth:pipeline_factory -noauth = extensions quantumapiapp_v2_0 -keystone = authtoken keystonecontext extensions quantumapiapp_v2_0 +[composite:neutronapi_v2_0] +use = call:neutron.auth:pipeline_factory +noauth = extensions neutronapiapp_v2_0 +keystone = authtoken keystonecontext extensions neutronapiapp_v2_0 [filter:keystonecontext] -paste.filter_factory = quantum.auth:QuantumKeystoneContext.factory +paste.filter_factory = neutron.auth:NeutronKeystoneContext.factory [filter:authtoken] paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory [filter:extensions] -paste.filter_factory = quantum.api.extensions:plugin_aware_extension_middleware_factory +paste.filter_factory = neutron.api.extensions:plugin_aware_extension_middleware_factory -[app:quantumversions] -paste.app_factory = quantum.api.versions:Versions.factory +[app:neutronversions] +paste.app_factory = neutron.api.versions:Versions.factory -[app:quantumapiapp_v2_0] -paste.app_factory = quantum.api.v2.router:APIRouter.factory +[app:neutronapiapp_v2_0] +paste.app_factory = neutron.api.v2.router:APIRouter.factory diff --git a/etc/dhcp_agent.ini b/etc/dhcp_agent.ini index 01872e3535..bab650b799 100644 --- a/etc/dhcp_agent.ini +++ b/etc/dhcp_agent.ini @@ -2,7 +2,7 @@ # Show debugging output in log (sets DEBUG log level output) # debug = true -# The DHCP agent will resync its state with Quantum to recover from any +# The DHCP agent will resync its state with Neutron to recover from any # transient notification or rpc errors. The interval is number of # seconds between attempts. # resync_interval = 5 @@ -11,16 +11,16 @@ # matches you plugin. # OVS based plugins(OVS, Ryu, NEC, NVP, BigSwitch/Floodlight) -interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver +interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver # OVS based plugins(Ryu, NEC, NVP, BigSwitch/Floodlight) that use OVS # as OpenFlow switch and check port status #ovs_use_veth = True # LinuxBridge -#interface_driver = quantum.agent.linux.interface.BridgeInterfaceDriver +#interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver # The agent can use other DHCP drivers. Dnsmasq is the simplest and requires # no additional setup of the DHCP server. -dhcp_driver = quantum.agent.linux.dhcp.Dnsmasq +dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq # Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and # iproute2 package that supports namespaces). @@ -35,7 +35,7 @@ dhcp_driver = quantum.agent.linux.dhcp.Dnsmasq # Allows for serving metadata requests coming from a dedicated metadata # access network whose cidr is 169.254.169.254/16 (or larger prefix), and -# is connected to a Quantum router from which the VMs send metadata +# is connected to a Neutron router from which the VMs send metadata # request. In this case DHCP Option 121 will not be injected in VMs, as # they will be able to reach 169.254.169.254 through a router. # This option requires enable_isolated_metadata = True diff --git a/etc/init.d/quantum-server b/etc/init.d/neutron-server similarity index 100% rename from etc/init.d/quantum-server rename to etc/init.d/neutron-server diff --git a/etc/l3_agent.ini b/etc/l3_agent.ini index 962c3afbe2..3485aed7fa 100644 --- a/etc/l3_agent.ini +++ b/etc/l3_agent.ini @@ -6,12 +6,12 @@ # matches your plugin. # OVS based plugins (OVS, Ryu, NEC) that supports L3 agent -interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver +interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver # OVS based plugins(Ryu, NEC) that use OVS # as OpenFlow switch and check port status #ovs_use_veth = True # LinuxBridge -#interface_driver = quantum.agent.linux.interface.BridgeInterfaceDriver +#interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver # Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and # iproute2 package that supports namespaces). @@ -30,7 +30,7 @@ interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver # Indicates that this L3 agent should also handle routers that do not have # an external network gateway configured. This option should be True only -# for a single agent in a Quantum deployment, and may be False for all agents +# for a single agent in a Neutron deployment, and may be False for all agents # if all routers must have an external network gateway # handle_internal_only_routers = True @@ -38,7 +38,7 @@ interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver # empty value for the linux bridge # external_network_bridge = br-ex -# TCP Port used by Quantum metadata server +# TCP Port used by Neutron metadata server # metadata_port = 9697 # Send this many gratuitous ARPs for HA setup. Set it below or equal to 0 @@ -54,4 +54,4 @@ interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver # enable_metadata_proxy, which is true by default, can be set to False # if the Nova metadata server is not available -# enable_metadata_proxy = True \ No newline at end of file +# enable_metadata_proxy = True diff --git a/etc/lbaas_agent.ini b/etc/lbaas_agent.ini index b0f7d8d2ae..ecfb88273a 100644 --- a/etc/lbaas_agent.ini +++ b/etc/lbaas_agent.ini @@ -2,22 +2,22 @@ # Show debugging output in log (sets DEBUG log level output) # debug = true -# The LBaaS agent will resync its state with Quantum to recover from any +# The LBaaS agent will resync its state with Neutron to recover from any # transient notification or rpc errors. The interval is number of # seconds between attempts. # periodic_interval = 10 # OVS based plugins(OVS, Ryu, NEC, NVP, BigSwitch/Floodlight) -interface_driver = quantum.agent.linux.interface.OVSInterfaceDriver +interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver # OVS based plugins(Ryu, NEC, NVP, BigSwitch/Floodlight) that use OVS # as OpenFlow switch and check port status # ovs_use_veth = True # LinuxBridge -# interface_driver = quantum.agent.linux.interface.BridgeInterfaceDriver +# interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver # The agent requires a driver to manage the loadbalancer. HAProxy is the # opensource version. -#device_driver = quantum.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver +#device_driver = neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver # Allow overlapping IP (Must have kernel build with CONFIG_NET_NS=y and # iproute2 package that supports namespaces). diff --git a/etc/metadata_agent.ini b/etc/metadata_agent.ini index 45294927a1..a76b18a419 100644 --- a/etc/metadata_agent.ini +++ b/etc/metadata_agent.ini @@ -2,7 +2,7 @@ # Show debugging output in log (sets DEBUG log level output) # debug = True -# The Quantum user information for accessing the Quantum API. +# The Neutron user information for accessing the Neutron API. auth_url = http://localhost:35357/v2.0 auth_region = RegionOne admin_tenant_name = %SERVICE_TENANT_NAME% @@ -18,8 +18,8 @@ admin_password = %SERVICE_PASSWORD% # TCP Port used by Nova metadata server # nova_metadata_port = 8775 -# When proxying metadata requests, Quantum signs the Instance-ID header with a +# When proxying metadata requests, Neutron signs the Instance-ID header with a # shared secret to prevent spoofing. You may select any string for a secret, # but it must match here and in the configuration used by the Nova Metadata -# Server. NOTE: Nova uses a different key: quantum_metadata_proxy_shared_secret +# Server. NOTE: Nova uses a different key: neutron_metadata_proxy_shared_secret # metadata_proxy_shared_secret = diff --git a/etc/quantum.conf b/etc/neutron.conf similarity index 100% rename from etc/quantum.conf rename to etc/neutron.conf diff --git a/etc/quantum/plugins/bigswitch/restproxy.ini b/etc/neutron/plugins/bigswitch/restproxy.ini similarity index 100% rename from etc/quantum/plugins/bigswitch/restproxy.ini rename to etc/neutron/plugins/bigswitch/restproxy.ini diff --git a/etc/quantum/plugins/brocade/brocade.ini b/etc/neutron/plugins/brocade/brocade.ini similarity index 100% rename from etc/quantum/plugins/brocade/brocade.ini rename to etc/neutron/plugins/brocade/brocade.ini diff --git a/etc/quantum/plugins/cisco/cisco_plugins.ini b/etc/neutron/plugins/cisco/cisco_plugins.ini similarity index 100% rename from etc/quantum/plugins/cisco/cisco_plugins.ini rename to etc/neutron/plugins/cisco/cisco_plugins.ini diff --git a/etc/quantum/plugins/hyperv/hyperv_quantum_plugin.ini b/etc/neutron/plugins/hyperv/hyperv_neutron_plugin.ini similarity index 100% rename from etc/quantum/plugins/hyperv/hyperv_quantum_plugin.ini rename to etc/neutron/plugins/hyperv/hyperv_neutron_plugin.ini diff --git a/etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini b/etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini similarity index 100% rename from etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini rename to etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini diff --git a/etc/quantum/plugins/metaplugin/metaplugin.ini b/etc/neutron/plugins/metaplugin/metaplugin.ini similarity index 100% rename from etc/quantum/plugins/metaplugin/metaplugin.ini rename to etc/neutron/plugins/metaplugin/metaplugin.ini diff --git a/etc/quantum/plugins/midonet/midonet.ini b/etc/neutron/plugins/midonet/midonet.ini similarity index 100% rename from etc/quantum/plugins/midonet/midonet.ini rename to etc/neutron/plugins/midonet/midonet.ini diff --git a/etc/quantum/plugins/ml2/ml2_conf.ini b/etc/neutron/plugins/ml2/ml2_conf.ini similarity index 100% rename from etc/quantum/plugins/ml2/ml2_conf.ini rename to etc/neutron/plugins/ml2/ml2_conf.ini diff --git a/etc/quantum/plugins/mlnx/mlnx_conf.ini b/etc/neutron/plugins/mlnx/mlnx_conf.ini similarity index 100% rename from etc/quantum/plugins/mlnx/mlnx_conf.ini rename to etc/neutron/plugins/mlnx/mlnx_conf.ini diff --git a/etc/quantum/plugins/nec/nec.ini b/etc/neutron/plugins/nec/nec.ini similarity index 100% rename from etc/quantum/plugins/nec/nec.ini rename to etc/neutron/plugins/nec/nec.ini diff --git a/etc/quantum/plugins/nicira/nvp.ini b/etc/neutron/plugins/nicira/nvp.ini similarity index 100% rename from etc/quantum/plugins/nicira/nvp.ini rename to etc/neutron/plugins/nicira/nvp.ini diff --git a/etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini b/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini similarity index 100% rename from etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini rename to etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini diff --git a/etc/quantum/plugins/plumgrid/plumgrid.ini b/etc/neutron/plugins/plumgrid/plumgrid.ini similarity index 100% rename from etc/quantum/plugins/plumgrid/plumgrid.ini rename to etc/neutron/plugins/plumgrid/plumgrid.ini diff --git a/etc/quantum/plugins/ryu/ryu.ini b/etc/neutron/plugins/ryu/ryu.ini similarity index 100% rename from etc/quantum/plugins/ryu/ryu.ini rename to etc/neutron/plugins/ryu/ryu.ini diff --git a/etc/quantum/rootwrap.d/debug.filters b/etc/neutron/rootwrap.d/debug.filters similarity index 86% rename from etc/quantum/rootwrap.d/debug.filters rename to etc/neutron/rootwrap.d/debug.filters index 0ff40e5c74..b61d960178 100644 --- a/etc/quantum/rootwrap.d/debug.filters +++ b/etc/neutron/rootwrap.d/debug.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neutron-rootwrap command filters for nodes on which neutron is # expected to control network # # This file should be owned by (and only-writeable by) the root user diff --git a/etc/quantum/rootwrap.d/dhcp.filters b/etc/neutron/rootwrap.d/dhcp.filters similarity index 75% rename from etc/quantum/rootwrap.d/dhcp.filters rename to etc/neutron/rootwrap.d/dhcp.filters index f8d2a45ebb..af55f521e8 100644 --- a/etc/quantum/rootwrap.d/dhcp.filters +++ b/etc/neutron/rootwrap.d/dhcp.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neutron-rootwrap command filters for nodes on which neutron is # expected to control network # # This file should be owned by (and only-writeable by) the root user @@ -14,7 +14,7 @@ dnsmasq: DnsmasqFilter, /sbin/dnsmasq, root dnsmasq_usr: DnsmasqFilter, /usr/sbin/dnsmasq, root # dhcp-agent uses kill as well, that's handled by the generic KillFilter # it looks like these are the only signals needed, per -# quantum/agent/linux/dhcp.py +# neutron/agent/linux/dhcp.py kill_dnsmasq: KillFilter, root, /sbin/dnsmasq, -9, -HUP kill_dnsmasq_usr: KillFilter, root, /usr/sbin/dnsmasq, -9, -HUP @@ -24,10 +24,12 @@ ovs-vsctl: CommandFilter, ovs-vsctl, root ivs-ctl: CommandFilter, ivs-ctl, root # metadata proxy -metadata_proxy: CommandFilter, quantum-ns-metadata-proxy, root +metadata_proxy: CommandFilter, neutron-ns-metadata-proxy, root +metadata_proxy_quantum: CommandFilter, quantum-ns-metadata-proxy, root # If installed from source (say, by devstack), the prefix will be # /usr/local instead of /usr/bin. -metadata_proxy_local: CommandFilter, /usr/local/bin/quantum-ns-metadata-proxy, root +metadata_proxy_local: CommandFilter, /usr/local/bin/neutron-ns-metadata-proxy, root +metadata_proxy_local_quantum: CommandFilter, /usr/local/bin/quantum-ns-metadata-proxy, root # RHEL invocation of the metadata proxy will report /usr/bin/python kill_metadata: KillFilter, root, /usr/bin/python, -9 kill_metadata7: KillFilter, root, /usr/bin/python2.7, -9 diff --git a/etc/quantum/rootwrap.d/iptables-firewall.filters b/etc/neutron/rootwrap.d/iptables-firewall.filters similarity index 78% rename from etc/quantum/rootwrap.d/iptables-firewall.filters rename to etc/neutron/rootwrap.d/iptables-firewall.filters index 8725596ad8..b8a6ab5b3b 100644 --- a/etc/quantum/rootwrap.d/iptables-firewall.filters +++ b/etc/neutron/rootwrap.d/iptables-firewall.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neutron-rootwrap command filters for nodes on which neutron is # expected to control network # # This file should be owned by (and only-writeable by) the root user @@ -8,14 +8,14 @@ [Filters] -# quantum/agent/linux/iptables_manager.py +# neutron/agent/linux/iptables_manager.py # "iptables-save", ... iptables-save: CommandFilter, iptables-save, root iptables-restore: CommandFilter, iptables-restore, root ip6tables-save: CommandFilter, ip6tables-save, root ip6tables-restore: CommandFilter, ip6tables-restore, root -# quantum/agent/linux/iptables_manager.py +# neutron/agent/linux/iptables_manager.py # "iptables", "-A", ... iptables: CommandFilter, iptables, root ip6tables: CommandFilter, ip6tables, root diff --git a/etc/quantum/rootwrap.d/l3.filters b/etc/neutron/rootwrap.d/l3.filters similarity index 73% rename from etc/quantum/rootwrap.d/l3.filters rename to etc/neutron/rootwrap.d/l3.filters index 5e7892cf8f..d3aca3fed4 100644 --- a/etc/quantum/rootwrap.d/l3.filters +++ b/etc/neutron/rootwrap.d/l3.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neutron-rootwrap command filters for nodes on which neutron is # expected to control network # # This file should be owned by (and only-writeable by) the root user @@ -16,10 +16,12 @@ sysctl: CommandFilter, sysctl, root route: CommandFilter, route, root # metadata proxy -metadata_proxy: CommandFilter, quantum-ns-metadata-proxy, root +metadata_proxy: CommandFilter, neutron-ns-metadata-proxy, root +metadata_proxy_quantum: CommandFilter, quantum-ns-metadata-proxy, root # If installed from source (say, by devstack), the prefix will be # /usr/local instead of /usr/bin. -metadata_proxy_local: CommandFilter, /usr/local/bin/quantum-ns-metadata-proxy, root +metadata_proxy_local: CommandFilter, /usr/local/bin/neuton-ns-metadata-proxy, root +metadata_proxy_local_quantum: CommandFilter, /usr/local/bin/quantum-ns-metadata-proxy, root # RHEL invocation of the metadata proxy will report /usr/bin/python kill_metadata: KillFilter, root, /usr/bin/python, -9 kill_metadata7: KillFilter, root, /usr/bin/python2.7, -9 diff --git a/etc/quantum/rootwrap.d/lbaas-haproxy.filters b/etc/neutron/rootwrap.d/lbaas-haproxy.filters similarity index 89% rename from etc/quantum/rootwrap.d/lbaas-haproxy.filters rename to etc/neutron/rootwrap.d/lbaas-haproxy.filters index b87657e2c7..4475604022 100644 --- a/etc/quantum/rootwrap.d/lbaas-haproxy.filters +++ b/etc/neutron/rootwrap.d/lbaas-haproxy.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neuton-rootwrap command filters for nodes on which neuton is # expected to control network # # This file should be owned by (and only-writeable by) the root user diff --git a/etc/quantum/rootwrap.d/linuxbridge-plugin.filters b/etc/neutron/rootwrap.d/linuxbridge-plugin.filters similarity index 86% rename from etc/quantum/rootwrap.d/linuxbridge-plugin.filters rename to etc/neutron/rootwrap.d/linuxbridge-plugin.filters index 7814c95c9b..4f98ce94e6 100644 --- a/etc/quantum/rootwrap.d/linuxbridge-plugin.filters +++ b/etc/neutron/rootwrap.d/linuxbridge-plugin.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neuton-rootwrap command filters for nodes on which neuton is # expected to control network # # This file should be owned by (and only-writeable by) the root user diff --git a/etc/quantum/rootwrap.d/nec-plugin.filters b/etc/neutron/rootwrap.d/nec-plugin.filters similarity index 72% rename from etc/quantum/rootwrap.d/nec-plugin.filters rename to etc/neutron/rootwrap.d/nec-plugin.filters index f175b4d681..33eca7df67 100644 --- a/etc/quantum/rootwrap.d/nec-plugin.filters +++ b/etc/neutron/rootwrap.d/nec-plugin.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neuton-rootwrap command filters for nodes on which neuton is # expected to control network # # This file should be owned by (and only-writeable by) the root user @@ -8,5 +8,5 @@ [Filters] -# nec_quantum_agent +# nec_neutron_agent ovs-vsctl: CommandFilter, ovs-vsctl, root diff --git a/etc/quantum/rootwrap.d/openvswitch-plugin.filters b/etc/neutron/rootwrap.d/openvswitch-plugin.filters similarity index 88% rename from etc/quantum/rootwrap.d/openvswitch-plugin.filters rename to etc/neutron/rootwrap.d/openvswitch-plugin.filters index 5cf14ab594..bdb306c8f6 100644 --- a/etc/quantum/rootwrap.d/openvswitch-plugin.filters +++ b/etc/neutron/rootwrap.d/openvswitch-plugin.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neutron-rootwrap command filters for nodes on which neutron is # expected to control network # # This file should be owned by (and only-writeable by) the root user diff --git a/etc/quantum/rootwrap.d/ryu-plugin.filters b/etc/neutron/rootwrap.d/ryu-plugin.filters similarity index 72% rename from etc/quantum/rootwrap.d/ryu-plugin.filters rename to etc/neutron/rootwrap.d/ryu-plugin.filters index a7f9b9c36c..0a70b8bc95 100644 --- a/etc/quantum/rootwrap.d/ryu-plugin.filters +++ b/etc/neutron/rootwrap.d/ryu-plugin.filters @@ -1,4 +1,4 @@ -# quantum-rootwrap command filters for nodes on which quantum is +# neutron-rootwrap command filters for nodes on which neutron is # expected to control network # # This file should be owned by (and only-writeable by) the root user @@ -12,10 +12,10 @@ # unclear whether both variants are necessary, but I'm transliterating # from the old mechanism -# quantum/plugins/ryu/agent/ryu_quantum_agent.py: +# neutron/plugins/ryu/agent/ryu_neutron_agent.py: # "ovs-vsctl", "--timeout=2", ... ovs-vsctl: CommandFilter, ovs-vsctl, root -# quantum/plugins/ryu/agent/ryu_quantum_agent.py: +# neutron/plugins/ryu/agent/ryu_neutron_agent.py: # "xe", "vif-param-get", ... xe: CommandFilter, xe, root diff --git a/etc/quantum b/etc/quantum new file mode 120000 index 0000000000..848bfe0411 --- /dev/null +++ b/etc/quantum @@ -0,0 +1 @@ +neutron \ No newline at end of file diff --git a/neutron/__init__.py b/neutron/__init__.py new file mode 100644 index 0000000000..b2c81bde7e --- /dev/null +++ b/neutron/__init__.py @@ -0,0 +1,21 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2011 OpenStack Foundation +# 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 gettext + + +gettext.install('neutron', unicode=1) diff --git a/quantum/agent/__init__.py b/neutron/agent/__init__.py similarity index 100% rename from quantum/agent/__init__.py rename to neutron/agent/__init__.py diff --git a/quantum/agent/common/__init__.py b/neutron/agent/common/__init__.py similarity index 100% rename from quantum/agent/common/__init__.py rename to neutron/agent/common/__init__.py diff --git a/quantum/agent/common/config.py b/neutron/agent/common/config.py similarity index 95% rename from quantum/agent/common/config.py rename to neutron/agent/common/config.py index 05a5f01bc9..273a01c769 100644 --- a/quantum/agent/common/config.py +++ b/neutron/agent/common/config.py @@ -19,8 +19,8 @@ import os from oslo.config import cfg -from quantum.common import config -from quantum.openstack.common import log as logging +from neutron.common import config +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -87,7 +87,7 @@ def get_root_helper(conf): def setup_conf(): bind_opts = [ cfg.StrOpt('state_path', - default='/var/lib/quantum', + default='/var/lib/neutron', help=_('Top-level directory for maintaining dhcp state')), ] diff --git a/quantum/agent/dhcp_agent.py b/neutron/agent/dhcp_agent.py similarity index 94% rename from quantum/agent/dhcp_agent.py rename to neutron/agent/dhcp_agent.py index 56372605b3..810322ff0a 100644 --- a/quantum/agent/dhcp_agent.py +++ b/neutron/agent/dhcp_agent.py @@ -23,26 +23,27 @@ import eventlet import netaddr from oslo.config import cfg -from quantum.agent.common import config -from quantum.agent.linux import dhcp -from quantum.agent.linux import external_process -from quantum.agent.linux import interface -from quantum.agent.linux import ip_lib -from quantum.agent import rpc as agent_rpc -from quantum.common import constants -from quantum.common import exceptions -from quantum.common import topics -from quantum.common import utils -from quantum import context -from quantum import manager -from quantum.openstack.common import importutils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall -from quantum.openstack.common.rpc import proxy -from quantum.openstack.common import service -from quantum.openstack.common import uuidutils -from quantum import service as quantum_service +from neutron.agent.common import config +from neutron.agent.linux import dhcp +from neutron.agent.linux import external_process +from neutron.agent.linux import interface +from neutron.agent.linux import ip_lib +from neutron.agent import rpc as agent_rpc +from neutron.common import constants +from neutron.common import exceptions +from neutron.common import legacy +from neutron.common import topics +from neutron.common import utils +from neutron import context +from neutron import manager +from neutron.openstack.common import importutils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall +from neutron.openstack.common.rpc import proxy +from neutron.openstack.common import service +from neutron.openstack.common import uuidutils +from neutron import service as neutron_service LOG = logging.getLogger(__name__) NS_PREFIX = 'qdhcp-' @@ -56,7 +57,7 @@ class DhcpAgent(manager.Manager): cfg.IntOpt('resync_interval', default=5, help=_("Interval to resync.")), cfg.StrOpt('dhcp_driver', - default='quantum.agent.linux.dhcp.Dnsmasq', + default='neutron.agent.linux.dhcp.Dnsmasq', help=_("The driver used to manage the DHCP server.")), cfg.BoolOpt('use_namespaces', default=True, help=_("Allow overlapping IP.")), @@ -144,7 +145,7 @@ class DhcpAgent(manager.Manager): LOG.exception(_('Unable to update lease')) def sync_state(self): - """Sync the local DHCP state with Quantum.""" + """Sync the local DHCP state with Neutron.""" LOG.info(_('Synchronizing state')) known_networks = set(self.cache.get_network_ids()) @@ -296,7 +297,7 @@ class DhcpAgent(manager.Manager): # The proxy might work for either a single network # or all the networks connected via a router # to the one passed as a parameter - quantum_lookup_param = '--network_id=%s' % network.id + neutron_lookup_param = '--network_id=%s' % network.id meta_cidr = netaddr.IPNetwork(METADATA_DEFAULT_IP) has_metadata_subnet = any(netaddr.IPNetwork(s.cidr) in meta_cidr for s in network.subnets) @@ -314,17 +315,17 @@ class DhcpAgent(manager.Manager): {'port_num': len(router_ports), 'port_id': router_ports[0].id, 'router_id': router_ports[0].device_id}) - quantum_lookup_param = ('--router_id=%s' % + neutron_lookup_param = ('--router_id=%s' % router_ports[0].device_id) def callback(pid_file): - proxy_cmd = ['quantum-ns-metadata-proxy', + proxy_cmd = ['neutron-ns-metadata-proxy', '--pid_file=%s' % pid_file, - quantum_lookup_param, + neutron_lookup_param, '--state_path=%s' % self.conf.state_path, '--metadata_port=%d' % METADATA_PORT] proxy_cmd.extend(config.get_log_args( - cfg.CONF, 'quantum-ns-metadata-proxy-%s.log' % network.id)) + cfg.CONF, 'neutron-ns-metadata-proxy-%s.log' % network.id)) return proxy_cmd pm = external_process.ProcessManager( @@ -506,8 +507,9 @@ class DeviceManager(object): if not conf.interface_driver: raise SystemExit(_('You must specify an interface driver')) try: - self.driver = importutils.import_object(conf.interface_driver, - conf) + self.driver = importutils.import_object( + conf.interface_driver, conf + ) except Exception: msg = _("Error importing interface driver " "'%s'") % conf.interface_driver @@ -673,7 +675,7 @@ class DhcpLeaseRelay(object): """UNIX domain socket server for processing lease updates. Network namespace isolation prevents the DHCP process from notifying - Quantum directly. This class works around the limitation by using the + Neutron directly. This class works around the limitation by using the domain socket to pass the information. This class handles message. receiving and then calls the callback method. """ @@ -735,7 +737,7 @@ class DhcpAgentWithStateReport(DhcpAgent): super(DhcpAgentWithStateReport, self).__init__(host=host) self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN) self.agent_state = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': host, 'topic': topics.DHCP_AGENT, 'configurations': { @@ -760,7 +762,7 @@ class DhcpAgentWithStateReport(DhcpAgent): self.use_call = False except AttributeError: # This means the server does not support report_state - LOG.warn(_("Quantum server does not support state report." + LOG.warn(_("Neutron server does not support state report." " State report for this agent will be disabled.")) self.heartbeat.stop() self.run() @@ -793,11 +795,12 @@ def register_options(): def main(): eventlet.monkey_patch() register_options() - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') config.setup_logging(cfg.CONF) - server = quantum_service.Service.create( - binary='quantum-dhcp-agent', + legacy.modernize_quantum_config(cfg.CONF) + server = neutron_service.Service.create( + binary='neutron-dhcp-agent', topic=topics.DHCP_AGENT, report_interval=cfg.CONF.AGENT.report_interval, - manager='quantum.agent.dhcp_agent.DhcpAgentWithStateReport') + manager='neutron.agent.dhcp_agent.DhcpAgentWithStateReport') service.launch(server).wait() diff --git a/quantum/agent/firewall.py b/neutron/agent/firewall.py similarity index 100% rename from quantum/agent/firewall.py rename to neutron/agent/firewall.py diff --git a/quantum/agent/l3_agent.py b/neutron/agent/l3_agent.py similarity index 95% rename from quantum/agent/l3_agent.py rename to neutron/agent/l3_agent.py index 94137045d1..7b504e90ac 100644 --- a/quantum/agent/l3_agent.py +++ b/neutron/agent/l3_agent.py @@ -22,26 +22,27 @@ from eventlet import semaphore import netaddr from oslo.config import cfg -from quantum.agent.common import config -from quantum.agent.linux import external_process -from quantum.agent.linux import interface -from quantum.agent.linux import ip_lib -from quantum.agent.linux import iptables_manager -from quantum.agent.linux import utils -from quantum.agent import rpc as agent_rpc -from quantum.common import constants as l3_constants -from quantum.common import topics -from quantum.common import utils as common_utils -from quantum import context -from quantum import manager -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall -from quantum.openstack.common import periodic_task -from quantum.openstack.common.rpc import common as rpc_common -from quantum.openstack.common.rpc import proxy -from quantum.openstack.common import service -from quantum import service as quantum_service +from neutron.agent.common import config +from neutron.agent.linux import external_process +from neutron.agent.linux import interface +from neutron.agent.linux import ip_lib +from neutron.agent.linux import iptables_manager +from neutron.agent.linux import utils +from neutron.agent import rpc as agent_rpc +from neutron.common import constants as l3_constants +from neutron.common import legacy +from neutron.common import topics +from neutron.common import utils as common_utils +from neutron import context +from neutron import manager +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall +from neutron.openstack.common import periodic_task +from neutron.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.rpc import proxy +from neutron.openstack.common import service +from neutron import service as neutron_service LOG = logging.getLogger(__name__) @@ -149,7 +150,7 @@ class L3NATAgent(manager.Manager): "interface.")), cfg.IntOpt('metadata_port', default=9697, - help=_("TCP Port used by Quantum metadata namespace " + help=_("TCP Port used by Neutron metadata namespace " "proxy.")), cfg.IntOpt('send_arp_for_ha', default=3, @@ -183,8 +184,10 @@ class L3NATAgent(manager.Manager): if not self.conf.interface_driver: raise SystemExit(_('An interface driver must be specified')) try: - self.driver = importutils.import_object(self.conf.interface_driver, - self.conf) + self.driver = importutils.import_object( + self.conf.interface_driver, + self.conf + ) except Exception: msg = _("Error importing interface driver " "'%s'") % self.conf.interface_driver @@ -246,7 +249,7 @@ class L3NATAgent(manager.Manager): if e.exc_type == 'TooManyExternalNetworks': msg = _( "The 'gateway_external_network_id' option must be " - "configured for this agent as Quantum has more than " + "configured for this agent as Neutron has more than " "one external network.") raise Exception(msg) else: @@ -284,13 +287,13 @@ class L3NATAgent(manager.Manager): def _spawn_metadata_proxy(self, router_info): def callback(pid_file): - proxy_cmd = ['quantum-ns-metadata-proxy', + proxy_cmd = ['neutron-ns-metadata-proxy', '--pid_file=%s' % pid_file, '--router_id=%s' % router_info.router_id, '--state_path=%s' % self.conf.state_path, '--metadata_port=%s' % self.conf.metadata_port] proxy_cmd.extend(config.get_log_args( - cfg.CONF, 'quantum-ns-metadata-proxy-%s.log' % + cfg.CONF, 'neutron-ns-metadata-proxy-%s.log' % router_info.router_id)) return proxy_cmd @@ -712,7 +715,7 @@ class L3NATAgentWithStateReport(L3NATAgent): super(L3NATAgentWithStateReport, self).__init__(host=host, conf=conf) self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN) self.agent_state = { - 'binary': 'quantum-l3-agent', + 'binary': 'neutron-l3-agent', 'host': host, 'topic': topics.L3_AGENT, 'configurations': { @@ -758,7 +761,7 @@ class L3NATAgentWithStateReport(L3NATAgent): self.use_call = False except AttributeError: # This means the server does not support report_state - LOG.warn(_("Quantum server does not support state report." + LOG.warn(_("Neutron server does not support state report." " State report for this agent will be disabled.")) self.heartbeat.stop() return @@ -779,11 +782,12 @@ def main(): config.register_root_helper(conf) conf.register_opts(interface.OPTS) conf.register_opts(external_process.OPTS) - conf(project='quantum') + conf(project='neutron') config.setup_logging(conf) - server = quantum_service.Service.create( - binary='quantum-l3-agent', + legacy.modernize_quantum_config(conf) + server = neutron_service.Service.create( + binary='neutron-l3-agent', topic=topics.L3_AGENT, report_interval=cfg.CONF.AGENT.report_interval, - manager='quantum.agent.l3_agent.L3NATAgentWithStateReport') + manager='neutron.agent.l3_agent.L3NATAgentWithStateReport') service.launch(server).wait() diff --git a/quantum/agent/linux/__init__.py b/neutron/agent/linux/__init__.py similarity index 100% rename from quantum/agent/linux/__init__.py rename to neutron/agent/linux/__init__.py diff --git a/quantum/agent/linux/daemon.py b/neutron/agent/linux/daemon.py similarity index 97% rename from quantum/agent/linux/daemon.py rename to neutron/agent/linux/daemon.py index 07fd0c4335..2825679a3a 100644 --- a/quantum/agent/linux/daemon.py +++ b/neutron/agent/linux/daemon.py @@ -21,8 +21,8 @@ import fcntl import os import sys -from quantum.agent.linux import utils -from quantum.openstack.common import log as logging +from neutron.agent.linux import utils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py similarity index 95% rename from quantum/agent/linux/dhcp.py rename to neutron/agent/linux/dhcp.py index fb1a68705f..2c603d4bdd 100644 --- a/quantum/agent/linux/dhcp.py +++ b/neutron/agent/linux/dhcp.py @@ -26,11 +26,11 @@ import sys import netaddr from oslo.config import cfg -from quantum.agent.linux import ip_lib -from quantum.agent.linux import utils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import uuidutils +from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import uuidutils LOG = logging.getLogger(__name__) @@ -209,7 +209,7 @@ class DhcpLocalProcess(DhcpBase): class Dnsmasq(DhcpLocalProcess): # The ports that need to be opened when security policies are active - # on the Quantum port used for DHCP. These are provided as a convenience + # on the Neutron port used for DHCP. These are provided as a convenience # for users of this class. PORTS = {IPV4: [(UDP, DNS_PORT), (TCP, DNS_PORT), (UDP, DHCPV4_PORT)], IPV6: [(UDP, DNS_PORT), (TCP, DNS_PORT), (UDP, DHCPV6_PORT)], @@ -217,8 +217,8 @@ class Dnsmasq(DhcpLocalProcess): _TAG_PREFIX = 'tag%d' - QUANTUM_NETWORK_ID_KEY = 'QUANTUM_NETWORK_ID' - QUANTUM_RELAY_SOCKET_PATH_KEY = 'QUANTUM_RELAY_SOCKET_PATH' + NEUTRON_NETWORK_ID_KEY = 'NEUTRON_NETWORK_ID' + NEUTRON_RELAY_SOCKET_PATH_KEY = 'NEUTRON_RELAY_SOCKET_PATH' MINIMUM_VERSION = 2.59 @classmethod @@ -259,8 +259,8 @@ class Dnsmasq(DhcpLocalProcess): def spawn_process(self): """Spawns a Dnsmasq process for the network.""" env = { - self.QUANTUM_NETWORK_ID_KEY: self.network.id, - self.QUANTUM_RELAY_SOCKET_PATH_KEY: + self.NEUTRON_NETWORK_ID_KEY: self.network.id, + self.NEUTRON_RELAY_SOCKET_PATH_KEY: self.conf.dhcp_lease_relay_socket } @@ -426,7 +426,7 @@ class Dnsmasq(DhcpLocalProcess): def _lease_relay_script_path(self): return os.path.join(os.path.dirname(sys.argv[0]), - 'quantum-dhcp-agent-dnsmasq-lease-update') + 'neutron-dhcp-agent-dnsmasq-lease-update') def _format_option(self, index, option_name, *args): if self.version >= self.MINIMUM_VERSION: @@ -438,8 +438,8 @@ class Dnsmasq(DhcpLocalProcess): @classmethod def lease_update(cls): - network_id = os.environ.get(cls.QUANTUM_NETWORK_ID_KEY) - dhcp_relay_socket = os.environ.get(cls.QUANTUM_RELAY_SOCKET_PATH_KEY) + network_id = os.environ.get(cls.NEUTRON_NETWORK_ID_KEY) + dhcp_relay_socket = os.environ.get(cls.NEUTRON_RELAY_SOCKET_PATH_KEY) action = sys.argv[1] if action not in ('add', 'del', 'old'): diff --git a/quantum/agent/linux/external_process.py b/neutron/agent/linux/external_process.py similarity index 94% rename from quantum/agent/linux/external_process.py rename to neutron/agent/linux/external_process.py index 9914a31ca1..1748c6c4ed 100644 --- a/quantum/agent/linux/external_process.py +++ b/neutron/agent/linux/external_process.py @@ -20,9 +20,9 @@ import os from oslo.config import cfg -from quantum.agent.linux import ip_lib -from quantum.agent.linux import utils -from quantum.openstack.common import log as logging +from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -36,7 +36,7 @@ cfg.CONF.register_opts(OPTS) class ProcessManager(object): - """An external process manager for Quantum spawned processes. + """An external process manager for Neutron spawned processes. Note: The manager expects uuid to be in cmdline. """ diff --git a/quantum/agent/linux/interface.py b/neutron/agent/linux/interface.py similarity index 96% rename from quantum/agent/linux/interface.py rename to neutron/agent/linux/interface.py index 3f8c901c2f..42a1f82d15 100644 --- a/quantum/agent/linux/interface.py +++ b/neutron/agent/linux/interface.py @@ -20,14 +20,14 @@ import abc import netaddr from oslo.config import cfg -from quantum.agent.common import config -from quantum.agent.linux import ip_lib -from quantum.agent.linux import ovs_lib -from quantum.agent.linux import utils -from quantum.common import exceptions -from quantum.extensions.flavor import (FLAVOR_NETWORK) -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging +from neutron.agent.common import config +from neutron.agent.linux import ip_lib +from neutron.agent.linux import ovs_lib +from neutron.agent.linux import utils +from neutron.common import exceptions +from neutron.extensions.flavor import (FLAVOR_NETWORK) +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -329,8 +329,8 @@ class BridgeInterfaceDriver(LinuxInterfaceDriver): class MetaInterfaceDriver(LinuxInterfaceDriver): def __init__(self, conf): super(MetaInterfaceDriver, self).__init__(conf) - from quantumclient.v2_0 import client - self.quantum = client.Client( + from neutronclient.v2_0 import client + self.neutron = client.Client( username=self.conf.admin_user, password=self.conf.admin_password, tenant_name=self.conf.admin_tenant_name, @@ -346,7 +346,7 @@ class MetaInterfaceDriver(LinuxInterfaceDriver): self.flavor_driver_map[flavor] = self._load_driver(driver_name) def _get_flavor_by_network_id(self, network_id): - network = self.quantum.show_network(network_id) + network = self.neutron.show_network(network_id) return network['network'][FLAVOR_NETWORK] def _get_driver_by_network_id(self, network_id): diff --git a/quantum/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py similarity index 99% rename from quantum/agent/linux/ip_lib.py rename to neutron/agent/linux/ip_lib.py index 9de7df9a7f..8590aa20f9 100644 --- a/quantum/agent/linux/ip_lib.py +++ b/neutron/agent/linux/ip_lib.py @@ -17,8 +17,8 @@ import netaddr from oslo.config import cfg -from quantum.agent.linux import utils -from quantum.common import exceptions +from neutron.agent.linux import utils +from neutron.common import exceptions OPTS = [ diff --git a/quantum/agent/linux/iptables_firewall.py b/neutron/agent/linux/iptables_firewall.py similarity index 98% rename from quantum/agent/linux/iptables_firewall.py rename to neutron/agent/linux/iptables_firewall.py index 6077bd2825..7773ace631 100644 --- a/quantum/agent/linux/iptables_firewall.py +++ b/neutron/agent/linux/iptables_firewall.py @@ -18,10 +18,10 @@ import netaddr from oslo.config import cfg -from quantum.agent import firewall -from quantum.agent.linux import iptables_manager -from quantum.common import constants -from quantum.openstack.common import log as logging +from neutron.agent import firewall +from neutron.agent.linux import iptables_manager +from neutron.common import constants +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/agent/linux/iptables_manager.py b/neutron/agent/linux/iptables_manager.py similarity index 93% rename from quantum/agent/linux/iptables_manager.py rename to neutron/agent/linux/iptables_manager.py index 4ab6e23fca..64245dc1fe 100644 --- a/quantum/agent/linux/iptables_manager.py +++ b/neutron/agent/linux/iptables_manager.py @@ -24,9 +24,9 @@ import inspect import os -from quantum.agent.linux import utils as linux_utils -from quantum.common import utils -from quantum.openstack.common import log as logging +from neutron.agent.linux import utils as linux_utils +from neutron.common import utils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) # NOTE(vish): Iptables supports chain names of up to 28 characters, and we @@ -207,7 +207,7 @@ class IptablesManager(object): A number of chains are set up to begin with. - First, quantum-filter-top. It's added at the top of FORWARD and OUTPUT. Its + First, neutron-filter-top. It's added at the top of FORWARD and OUTPUT. Its name is not wrapped, so it's shared between the various nova workers. It's intended for rules that need to live at the top of the FORWARD and OUTPUT chains. It's in both the ipv4 and ipv6 set of tables. @@ -215,7 +215,7 @@ class IptablesManager(object): For ipv4 and ipv6, the built-in INPUT, OUTPUT, and FORWARD filter chains are wrapped, meaning that the "real" INPUT chain has a rule that jumps to the wrapped INPUT chain, etc. Additionally, there's a wrapped chain named - "local" which is jumped to from quantum-filter-top. + "local" which is jumped to from neutron-filter-top. For ipv4, the built-in PREROUTING, OUTPUT, and POSTROUTING nat chains are wrapped in the same was as the built-in filter chains. Additionally, @@ -238,18 +238,18 @@ class IptablesManager(object): self.ipv4 = {'filter': IptablesTable()} self.ipv6 = {'filter': IptablesTable()} - # Add a quantum-filter-top chain. It's intended to be shared + # Add a neutron-filter-top chain. It's intended to be shared # among the various nova components. It sits at the very top # of FORWARD and OUTPUT. for tables in [self.ipv4, self.ipv6]: - tables['filter'].add_chain('quantum-filter-top', wrap=False) - tables['filter'].add_rule('FORWARD', '-j quantum-filter-top', + tables['filter'].add_chain('neutron-filter-top', wrap=False) + tables['filter'].add_rule('FORWARD', '-j neutron-filter-top', wrap=False, top=True) - tables['filter'].add_rule('OUTPUT', '-j quantum-filter-top', + tables['filter'].add_rule('OUTPUT', '-j neutron-filter-top', wrap=False, top=True) tables['filter'].add_chain('local') - tables['filter'].add_rule('quantum-filter-top', '-j $local', + tables['filter'].add_rule('neutron-filter-top', '-j $local', wrap=False) # Wrap the built-in chains @@ -274,19 +274,19 @@ class IptablesManager(object): (chain), wrap=False) if not state_less: - # Add a quantum-postrouting-bottom chain. It's intended to be + # Add a neutron-postrouting-bottom chain. It's intended to be # shared among the various nova components. We set it as the last # chain of POSTROUTING chain. - self.ipv4['nat'].add_chain('quantum-postrouting-bottom', + self.ipv4['nat'].add_chain('neutron-postrouting-bottom', wrap=False) self.ipv4['nat'].add_rule('POSTROUTING', - '-j quantum-postrouting-bottom', + '-j neutron-postrouting-bottom', wrap=False) - # We add a snat chain to the shared quantum-postrouting-bottom + # We add a snat chain to the shared neutron-postrouting-bottom # chain so that it's applied last. self.ipv4['nat'].add_chain('snat') - self.ipv4['nat'].add_rule('quantum-postrouting-bottom', + self.ipv4['nat'].add_rule('neutron-postrouting-bottom', '-j $snat', wrap=False) # And then we add a float-snat chain and jump to first thing in diff --git a/quantum/agent/linux/ovs_lib.py b/neutron/agent/linux/ovs_lib.py similarity index 98% rename from quantum/agent/linux/ovs_lib.py rename to neutron/agent/linux/ovs_lib.py index 66441e1924..491dd1969e 100644 --- a/quantum/agent/linux/ovs_lib.py +++ b/neutron/agent/linux/ovs_lib.py @@ -20,11 +20,11 @@ import re -from quantum.agent.linux import ip_lib -from quantum.agent.linux import utils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging -from quantum.plugins.openvswitch.common import constants +from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging +from neutron.plugins.openvswitch.common import constants LOG = logging.getLogger(__name__) diff --git a/quantum/agent/linux/utils.py b/neutron/agent/linux/utils.py similarity index 97% rename from quantum/agent/linux/utils.py rename to neutron/agent/linux/utils.py index 319272f8cd..fc9f4c9769 100644 --- a/quantum/agent/linux/utils.py +++ b/neutron/agent/linux/utils.py @@ -26,8 +26,8 @@ import tempfile from eventlet.green import subprocess -from quantum.common import utils -from quantum.openstack.common import log as logging +from neutron.common import utils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/agent/metadata/__init__.py b/neutron/agent/metadata/__init__.py similarity index 100% rename from quantum/agent/metadata/__init__.py rename to neutron/agent/metadata/__init__.py diff --git a/quantum/agent/metadata/agent.py b/neutron/agent/metadata/agent.py similarity index 94% rename from quantum/agent/metadata/agent.py rename to neutron/agent/metadata/agent.py index 1c1fed4739..9f32d15508 100644 --- a/quantum/agent/metadata/agent.py +++ b/neutron/agent/metadata/agent.py @@ -24,14 +24,14 @@ import urlparse import eventlet import httplib2 +from neutronclient.v2_0 import client from oslo.config import cfg -from quantumclient.v2_0 import client import webob -from quantum.common import config -from quantum.common import utils -from quantum.openstack.common import log as logging -from quantum import wsgi +from neutron.common import config +from neutron.common import utils +from neutron.openstack.common import log as logging +from neutron import wsgi LOG = logging.getLogger(__name__) @@ -72,7 +72,7 @@ class MetadataProxyHandler(object): self.conf = conf self.auth_info = {} - def _get_quantum_client(self): + def _get_neutron_client(self): qclient = client.Client( username=self.conf.admin_user, password=self.conf.admin_password, @@ -104,11 +104,11 @@ class MetadataProxyHandler(object): return webob.exc.HTTPInternalServerError(explanation=unicode(msg)) def _get_instance_id(self, req): - qclient = self._get_quantum_client() + qclient = self._get_neutron_client() remote_address = req.headers.get('X-Forwarded-For') - network_id = req.headers.get('X-Quantum-Network-ID') - router_id = req.headers.get('X-Quantum-Router-ID') + network_id = req.headers.get('X-Neutron-Network-ID') + router_id = req.headers.get('X-Neutron-Router-ID') if network_id: networks = [network_id] @@ -223,7 +223,7 @@ class UnixDomainMetadataProxy(object): os.makedirs(dirname, 0o755) def run(self): - server = UnixDomainWSGIServer('quantum-metadata-agent') + server = UnixDomainWSGIServer('neutron-metadata-agent') server.start(MetadataProxyHandler(self.conf), self.conf.metadata_proxy_socket) server.wait() @@ -233,7 +233,7 @@ def main(): eventlet.monkey_patch() cfg.CONF.register_opts(UnixDomainMetadataProxy.OPTS) cfg.CONF.register_opts(MetadataProxyHandler.OPTS) - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') config.setup_logging(cfg.CONF) utils.log_opt_values(LOG) proxy = UnixDomainMetadataProxy(cfg.CONF) diff --git a/quantum/agent/metadata/namespace_proxy.py b/neutron/agent/metadata/namespace_proxy.py similarity index 92% rename from quantum/agent/metadata/namespace_proxy.py rename to neutron/agent/metadata/namespace_proxy.py index 4ab19f1c99..bca06b400a 100644 --- a/quantum/agent/metadata/namespace_proxy.py +++ b/neutron/agent/metadata/namespace_proxy.py @@ -25,11 +25,11 @@ import httplib2 from oslo.config import cfg import webob -from quantum.agent.linux import daemon -from quantum.common import config -from quantum.common import utils -from quantum.openstack.common import log as logging -from quantum import wsgi +from neutron.agent.linux import daemon +from neutron.common import config +from neutron.common import utils +from neutron.openstack.common import log as logging +from neutron import wsgi proxy_socket = cfg.StrOpt('metadata_proxy_socket', default='$state_path/metadata_proxy', @@ -92,9 +92,9 @@ class NetworkMetadataProxyHandler(object): } if self.router_id: - headers['X-Quantum-Router-ID'] = self.router_id + headers['X-Neutron-Router-ID'] = self.router_id else: - headers['X-Quantum-Network-ID'] = self.network_id + headers['X-Neutron-Network-ID'] = self.network_id url = urlparse.urlunsplit(( 'http', @@ -141,7 +141,7 @@ class ProxyDaemon(daemon.Daemon): handler = NetworkMetadataProxyHandler( self.network_id, self.router_id) - proxy = wsgi.Server('quantum-network-metadata-proxy') + proxy = wsgi.Server('neutron-network-metadata-proxy') proxy.start(handler, self.port) proxy.wait() @@ -161,7 +161,7 @@ def main(): cfg.CONF.register_cli_opts(opts) # Don't get the default configuration file - cfg.CONF(project='quantum', default_config_files=[]) + cfg.CONF(project='neutron', default_config_files=[]) config.setup_logging(cfg.CONF) utils.log_opt_values(LOG) proxy = ProxyDaemon(cfg.CONF.pid_file, diff --git a/quantum/agent/netns_cleanup_util.py b/neutron/agent/netns_cleanup_util.py similarity index 91% rename from quantum/agent/netns_cleanup_util.py rename to neutron/agent/netns_cleanup_util.py index 81c81b1c07..78815f5fee 100644 --- a/quantum/agent/netns_cleanup_util.py +++ b/neutron/agent/netns_cleanup_util.py @@ -20,16 +20,16 @@ import re import eventlet from oslo.config import cfg -from quantum.agent.common import config as agent_config -from quantum.agent import dhcp_agent -from quantum.agent import l3_agent -from quantum.agent.linux import dhcp -from quantum.agent.linux import ip_lib -from quantum.agent.linux import ovs_lib -from quantum.api.v2 import attributes -from quantum.common import config -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging +from neutron.agent.common import config as agent_config +from neutron.agent import dhcp_agent +from neutron.agent import l3_agent +from neutron.agent.linux import dhcp +from neutron.agent.linux import ip_lib +from neutron.agent.linux import ovs_lib +from neutron.api.v2 import attributes +from neutron.common import config +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -64,7 +64,7 @@ def setup_conf(): opts = [ cfg.StrOpt('dhcp_driver', - default='quantum.agent.linux.dhcp.Dnsmasq', + default='neutron.agent.linux.dhcp.Dnsmasq', help=_("The driver used to manage the DHCP server.")), ] @@ -158,7 +158,7 @@ def main(): will re-confirm the namespace is empty. The utility is designed to clean-up after the forced or unexpected - termination of Quantum agents. + termination of Neutron agents. The --force flag should only be used as part of the cleanup of a devstack installation as it will blindly purge namespaces and their devices. This diff --git a/quantum/agent/ovs_cleanup_util.py b/neutron/agent/ovs_cleanup_util.py similarity index 75% rename from quantum/agent/ovs_cleanup_util.py rename to neutron/agent/ovs_cleanup_util.py index 74544430cc..51bf1d4599 100644 --- a/quantum/agent/ovs_cleanup_util.py +++ b/neutron/agent/ovs_cleanup_util.py @@ -17,13 +17,13 @@ from oslo.config import cfg -from quantum.agent.common import config as agent_config -from quantum.agent import l3_agent -from quantum.agent.linux import interface -from quantum.agent.linux import ip_lib -from quantum.agent.linux import ovs_lib -from quantum.common import config -from quantum.openstack.common import log as logging +from neutron.agent.common import config as agent_config +from neutron.agent import l3_agent +from neutron.agent.linux import interface +from neutron.agent.linux import ip_lib +from neutron.agent.linux import ovs_lib +from neutron.common import config +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -40,7 +40,7 @@ def setup_conf(): default=False, help=_('True to delete all ports on all the OpenvSwitch ' 'bridges. False to delete ports created by ' - 'Quantum on integration and external network ' + 'Neutron on integration and external network ' 'bridges.')) ] @@ -52,8 +52,8 @@ def setup_conf(): return conf -def collect_quantum_ports(bridges, root_helper): - """Collect ports created by Quantum from OVS.""" +def collect_neutron_ports(bridges, root_helper): + """Collect ports created by Neutron from OVS.""" ports = [] for bridge in bridges: ovs = ovs_lib.OVSBridge(bridge, root_helper) @@ -61,8 +61,8 @@ def collect_quantum_ports(bridges, root_helper): return ports -def delete_quantum_ports(ports, root_helper): - """Delete non-internal ports created by Quantum +def delete_neutron_ports(ports, root_helper): + """Delete non-internal ports created by Neutron Non-internal OVS ports need to be removed manually. """ @@ -76,7 +76,7 @@ def delete_quantum_ports(ports, root_helper): def main(): """Main method for cleaning up OVS bridges. - The utility cleans up the integration bridges used by Quantum. + The utility cleans up the integration bridges used by Neutron. """ conf = setup_conf() @@ -93,10 +93,10 @@ def main(): else: bridges = available_configuration_bridges - # Collect existing ports created by Quantum on configuration bridges. + # Collect existing ports created by Neutron on configuration bridges. # After deleting ports from OVS bridges, we cannot determine which - # ports were created by Quantum, so port information is collected now. - ports = collect_quantum_ports(available_configuration_bridges, + # ports were created by Neutron, so port information is collected now. + ports = collect_neutron_ports(available_configuration_bridges, conf.AGENT.root_helper) for bridge in bridges: @@ -104,7 +104,7 @@ def main(): ovs = ovs_lib.OVSBridge(bridge, conf.AGENT.root_helper) ovs.delete_ports(all_ports=conf.ovs_all_ports) - # Remove remaining ports created by Quantum (usually veth pair) - delete_quantum_ports(ports, conf.AGENT.root_helper) + # Remove remaining ports created by Neutron (usually veth pair) + delete_neutron_ports(ports, conf.AGENT.root_helper) LOG.info(_("OVS cleanup completed successfully")) diff --git a/quantum/agent/rpc.py b/neutron/agent/rpc.py similarity index 93% rename from quantum/agent/rpc.py rename to neutron/agent/rpc.py index adc596facf..89e1a084db 100644 --- a/quantum/agent/rpc.py +++ b/neutron/agent/rpc.py @@ -15,12 +15,12 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.common import topics +from neutron.common import topics -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import proxy -from quantum.openstack.common import timeutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import proxy +from neutron.openstack.common import timeutils LOG = logging.getLogger(__name__) diff --git a/quantum/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py similarity index 96% rename from quantum/agent/securitygroups_rpc.py rename to neutron/agent/securitygroups_rpc.py index 6ff36da36a..01a3a2ab26 100644 --- a/quantum/agent/securitygroups_rpc.py +++ b/neutron/agent/securitygroups_rpc.py @@ -18,9 +18,9 @@ from oslo.config import cfg -from quantum.common import topics -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging +from neutron.common import topics +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) SG_RPC_VERSION = "1.1" @@ -28,14 +28,14 @@ SG_RPC_VERSION = "1.1" security_group_opts = [ cfg.StrOpt( 'firewall_driver', - default='quantum.agent.firewall.NoopFirewallDriver') + default='neutron.agent.firewall.NoopFirewallDriver') ] cfg.CONF.register_opts(security_group_opts, 'SECURITYGROUP') def is_firewall_enabled(): return (cfg.CONF.SECURITYGROUP.firewall_driver != - 'quantum.agent.firewall.NoopFirewallDriver') + 'neutron.agent.firewall.NoopFirewallDriver') def disable_security_group_extension_if_noop_driver( diff --git a/quantum/openstack/__init__.py b/neutron/api/__init__.py similarity index 100% rename from quantum/openstack/__init__.py rename to neutron/api/__init__.py diff --git a/quantum/api/api_common.py b/neutron/api/api_common.py similarity index 97% rename from quantum/api/api_common.py rename to neutron/api/api_common.py index f7ce456285..5f6e5151ea 100644 --- a/quantum/api/api_common.py +++ b/neutron/api/api_common.py @@ -20,9 +20,9 @@ import urllib from oslo.config import cfg from webob import exc -from quantum.common import constants -from quantum.common import exceptions -from quantum.openstack.common import log as logging +from neutron.common import constants +from neutron.common import exceptions +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -292,14 +292,14 @@ class NoSortingHelper(SortingHelper): pass -class QuantumController(object): - """Base controller class for Quantum API.""" +class NeutronController(object): + """Base controller class for Neutron API.""" # _resource_name will be redefined in sub concrete controller _resource_name = None def __init__(self, plugin): self._plugin = plugin - super(QuantumController, self).__init__() + super(NeutronController, self).__init__() def _prepare_request_body(self, body, params): """Verifies required parameters are in request body. diff --git a/quantum/api/extensions.py b/neutron/api/extensions.py similarity index 97% rename from quantum/api/extensions.py rename to neutron/api/extensions.py index 2eb6b22f57..2f315baeac 100644 --- a/quantum/api/extensions.py +++ b/neutron/api/extensions.py @@ -26,15 +26,15 @@ import routes import webob.dec import webob.exc -from quantum.api.v2 import attributes -from quantum.common import exceptions -import quantum.extensions -from quantum.manager import QuantumManager -from quantum.openstack.common import log as logging -from quantum import wsgi +from neutron.api.v2 import attributes +from neutron.common import exceptions +import neutron.extensions +from neutron.manager import NeutronManager +from neutron.openstack.common import log as logging +from neutron import wsgi -LOG = logging.getLogger('quantum.api.extensions') +LOG = logging.getLogger('neutron.api.extensions') class PluginInterface(object): @@ -611,15 +611,15 @@ class PluginAwareExtensionManager(ExtensionManager): def get_instance(cls): if cls._instance is None: cls._instance = cls(get_extensions_path(), - QuantumManager.get_service_plugins()) + NeutronManager.get_service_plugins()) return cls._instance class RequestExtension(object): - """Extend requests and responses of core Quantum OpenStack API controllers. + """Extend requests and responses of core Neutron OpenStack API controllers. Provide a way to add data to responses and handle custom request data - that is sent to core Quantum OpenStack API controllers. + that is sent to core Neutron OpenStack API controllers. """ def __init__(self, method, url_route, handler): @@ -630,7 +630,7 @@ class RequestExtension(object): class ActionExtension(object): - """Add custom actions to core Quantum OpenStack API controllers.""" + """Add custom actions to core Neutron OpenStack API controllers.""" def __init__(self, collection, action_name, handler): self.collection = collection @@ -639,7 +639,7 @@ class ActionExtension(object): class ResourceExtension(object): - """Add top level resources to the OpenStack API in Quantum.""" + """Add top level resources to the OpenStack API in Neutron.""" def __init__(self, collection, controller, parent=None, path_prefix="", collection_actions={}, member_actions={}, attr_map={}): @@ -653,9 +653,9 @@ class ResourceExtension(object): # Returns the extention paths from a config entry and the __path__ -# of quantum.extensions +# of neutron.extensions def get_extensions_path(): - paths = ':'.join(quantum.extensions.__path__) + paths = ':'.join(neutron.extensions.__path__) if cfg.CONF.api_extensions_path: paths = ':'.join([cfg.CONF.api_extensions_path, paths]) diff --git a/quantum/api/rpc/__init__.py b/neutron/api/rpc/__init__.py similarity index 100% rename from quantum/api/rpc/__init__.py rename to neutron/api/rpc/__init__.py diff --git a/quantum/api/rpc/agentnotifiers/__init__.py b/neutron/api/rpc/agentnotifiers/__init__.py similarity index 100% rename from quantum/api/rpc/agentnotifiers/__init__.py rename to neutron/api/rpc/agentnotifiers/__init__.py diff --git a/quantum/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py b/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py similarity index 94% rename from quantum/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py rename to neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py index 959e2b1bfd..6c7a531f40 100644 --- a/quantum/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py +++ b/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py @@ -13,12 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.common import constants -from quantum.common import topics -from quantum.common import utils -from quantum import manager -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import proxy +from neutron.common import constants +from neutron.common import topics +from neutron.common import utils +from neutron import manager +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import proxy LOG = logging.getLogger(__name__) @@ -44,7 +44,7 @@ class DhcpAgentNotifyAPI(proxy.RpcProxy): topic=topic, default_version=self.BASE_RPC_API_VERSION) def _get_dhcp_agents(self, context, network_id): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() dhcp_agents = plugin.get_dhcp_agents_hosting_networks( context, [network_id], active=True) return [(dhcp_agent.host, dhcp_agent.topic) for @@ -59,7 +59,7 @@ class DhcpAgentNotifyAPI(proxy.RpcProxy): def _notification(self, context, method, payload, network_id): """Notify all the agents that are hosting the network.""" - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() if (method != 'network_delete_end' and utils.is_extension_supported( plugin, constants.AGENT_SCHEDULER_EXT_ALIAS)): if method == 'port_create_end': diff --git a/quantum/api/rpc/agentnotifiers/l3_rpc_agent_api.py b/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py similarity index 93% rename from quantum/api/rpc/agentnotifiers/l3_rpc_agent_api.py rename to neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py index 53fb093b06..557cffeea5 100644 --- a/quantum/api/rpc/agentnotifiers/l3_rpc_agent_api.py +++ b/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py @@ -13,12 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.common import constants -from quantum.common import topics -from quantum.common import utils -from quantum import manager -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import proxy +from neutron.common import constants +from neutron.common import topics +from neutron.common import utils +from neutron import manager +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import proxy LOG = logging.getLogger(__name__) @@ -46,7 +46,7 @@ class L3AgentNotifyAPI(proxy.RpcProxy): operation, data): """Notify changed routers to hosting l3 agents.""" adminContext = context.is_admin and context or context.elevated() - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() for router in routers: l3_agents = plugin.get_l3_agents_hosting_routers( adminContext, [router['id']], @@ -65,7 +65,7 @@ class L3AgentNotifyAPI(proxy.RpcProxy): def _notification(self, context, method, routers, operation, data): """Notify all the agents that are hosting the routers.""" - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() if utils.is_extension_supported( plugin, constants.AGENT_SCHEDULER_EXT_ALIAS): adminContext = (context.is_admin and diff --git a/quantum/api/v2/__init__.py b/neutron/api/v2/__init__.py similarity index 100% rename from quantum/api/v2/__init__.py rename to neutron/api/v2/__init__.py diff --git a/quantum/api/v2/attributes.py b/neutron/api/v2/attributes.py similarity index 99% rename from quantum/api/v2/attributes.py rename to neutron/api/v2/attributes.py index 50ee03ce4d..3b988699a5 100644 --- a/quantum/api/v2/attributes.py +++ b/neutron/api/v2/attributes.py @@ -18,10 +18,10 @@ import netaddr import re -from quantum.common import constants -from quantum.common import exceptions as q_exc -from quantum.openstack.common import log as logging -from quantum.openstack.common import uuidutils +from neutron.common import constants +from neutron.common import exceptions as q_exc +from neutron.openstack.common import log as logging +from neutron.openstack.common import uuidutils LOG = logging.getLogger(__name__) diff --git a/quantum/api/v2/base.py b/neutron/api/v2/base.py similarity index 98% rename from quantum/api/v2/base.py rename to neutron/api/v2/base.py index c8bbf429e9..0749d148b1 100644 --- a/quantum/api/v2/base.py +++ b/neutron/api/v2/base.py @@ -20,15 +20,15 @@ import webob.exc from oslo.config import cfg -from quantum.api import api_common -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.v2 import attributes -from quantum.api.v2 import resource as wsgi_resource -from quantum.common import exceptions -from quantum.openstack.common import log as logging -from quantum.openstack.common.notifier import api as notifier_api -from quantum import policy -from quantum import quota +from neutron.api import api_common +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.v2 import attributes +from neutron.api.v2 import resource as wsgi_resource +from neutron.common import exceptions +from neutron.openstack.common import log as logging +from neutron.openstack.common.notifier import api as notifier_api +from neutron import policy +from neutron import quota LOG = logging.getLogger(__name__) diff --git a/quantum/api/v2/resource.py b/neutron/api/v2/resource.py similarity index 92% rename from quantum/api/v2/resource.py rename to neutron/api/v2/resource.py index bf9bcb132c..744a7d940d 100644 --- a/quantum/api/v2/resource.py +++ b/neutron/api/v2/resource.py @@ -21,10 +21,10 @@ import netaddr import webob.dec import webob.exc -from quantum.api.v2 import attributes -from quantum.common import exceptions -from quantum.openstack.common import log as logging -from quantum import wsgi +from neutron.api.v2 import attributes +from neutron.common import exceptions +from neutron.openstack.common import log as logging +from neutron import wsgi LOG = logging.getLogger(__name__) @@ -80,10 +80,10 @@ def Resource(controller, faults=None, deserializers=None, serializers=None): method = getattr(controller, action) result = method(request=request, **args) - except (exceptions.QuantumException, + except (exceptions.NeutronException, netaddr.AddrFormatError) as e: LOG.exception(_('%s failed'), action) - body = serializer.serialize({'QuantumError': e}) + body = serializer.serialize({'NeutronError': e}) kwargs = {'body': body, 'content_type': content_type} for fault in faults: if isinstance(e, fault): @@ -91,7 +91,7 @@ def Resource(controller, faults=None, deserializers=None, serializers=None): raise webob.exc.HTTPInternalServerError(**kwargs) except webob.exc.HTTPException as e: LOG.exception(_('%s failed'), action) - e.body = serializer.serialize({'QuantumError': e}) + e.body = serializer.serialize({'NeutronError': e}) e.content_type = content_type raise except NotImplementedError as e: @@ -111,7 +111,7 @@ def Resource(controller, faults=None, deserializers=None, serializers=None): # Do not expose details of 500 error to clients. msg = _('Request Failed: internal server error while ' 'processing your request.') - body = serializer.serialize({'QuantumError': msg}) + body = serializer.serialize({'NeutronError': msg}) kwargs = {'body': body, 'content_type': content_type} raise webob.exc.HTTPInternalServerError(**kwargs) diff --git a/quantum/api/v2/router.py b/neutron/api/v2/router.py similarity index 94% rename from quantum/api/v2/router.py rename to neutron/api/v2/router.py index 5590b3419a..9f943d8f98 100644 --- a/quantum/api/v2/router.py +++ b/neutron/api/v2/router.py @@ -21,12 +21,12 @@ import webob import webob.dec import webob.exc -from quantum.api import extensions -from quantum.api.v2 import attributes -from quantum.api.v2 import base -from quantum import manager -from quantum.openstack.common import log as logging -from quantum import wsgi +from neutron.api import extensions +from neutron.api.v2 import attributes +from neutron.api.v2 import base +from neutron import manager +from neutron.openstack.common import log as logging +from neutron import wsgi LOG = logging.getLogger(__name__) @@ -73,7 +73,7 @@ class APIRouter(wsgi.Router): def __init__(self, **local_config): mapper = routes_mapper.Mapper() - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() ext_mgr = extensions.PluginAwareExtensionManager.get_instance() ext_mgr.extend_resources("2.0", attributes.RESOURCE_ATTRIBUTE_MAP) diff --git a/quantum/api/versions.py b/neutron/api/versions.py similarity index 90% rename from quantum/api/versions.py rename to neutron/api/versions.py index 9287d04a54..f99f0b8f4e 100644 --- a/quantum/api/versions.py +++ b/neutron/api/versions.py @@ -17,9 +17,9 @@ import webob.dec -from quantum.api.views import versions as versions_view -from quantum.openstack.common import log as logging -from quantum import wsgi +from neutron.api.views import versions as versions_view +from neutron.openstack.common import log as logging +from neutron import wsgi LOG = logging.getLogger(__name__) @@ -33,7 +33,7 @@ class Versions(object): @webob.dec.wsgify(RequestClass=wsgi.Request) def __call__(self, req): - """Respond to a request for all Quantum API versions.""" + """Respond to a request for all Neutron API versions.""" version_objs = [ { "id": "v2.0", diff --git a/quantum/api/views/__init__.py b/neutron/api/views/__init__.py similarity index 100% rename from quantum/api/views/__init__.py rename to neutron/api/views/__init__.py diff --git a/quantum/api/views/versions.py b/neutron/api/views/versions.py similarity index 100% rename from quantum/api/views/versions.py rename to neutron/api/views/versions.py diff --git a/neutron/auth.py b/neutron/auth.py new file mode 100644 index 0000000000..b5d9dcc150 --- /dev/null +++ b/neutron/auth.py @@ -0,0 +1,63 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2012 OpenStack Foundation +# +# 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. + +from oslo.config import cfg +import webob.dec +import webob.exc + +from neutron import context +from neutron.openstack.common import log as logging +from neutron import wsgi + +LOG = logging.getLogger(__name__) + + +class NeutronKeystoneContext(wsgi.Middleware): + """Make a request context from keystone headers.""" + + @webob.dec.wsgify + def __call__(self, req): + # Determine the user ID + user_id = req.headers.get('X_USER_ID', req.headers.get('X_USER')) + if not user_id: + LOG.debug(_("Neither X_USER_ID nor X_USER found in request")) + return webob.exc.HTTPUnauthorized() + + # Determine the tenant + tenant_id = req.headers.get('X_TENANT_ID', req.headers.get('X_TENANT')) + + # Suck out the roles + roles = [r.strip() for r in req.headers.get('X_ROLE', '').split(',')] + + # Create a context with the authentication data + ctx = context.Context(user_id, tenant_id, roles=roles) + + # Inject the context... + req.environ['neutron.context'] = ctx + + return self.application + + +def pipeline_factory(loader, global_conf, **local_conf): + """Create a paste pipeline based on the 'auth_strategy' config option.""" + pipeline = local_conf[cfg.CONF.auth_strategy] + pipeline = pipeline.split() + filters = [loader.get_filter(n) for n in pipeline[:-1]] + app = loader.get_app(pipeline[-1]) + filters.reverse() + for filter in filters: + app = filter(app) + return app diff --git a/quantum/common/__init__.py b/neutron/common/__init__.py similarity index 100% rename from quantum/common/__init__.py rename to neutron/common/__init__.py diff --git a/quantum/common/config.py b/neutron/common/config.py similarity index 83% rename from quantum/common/config.py rename to neutron/common/config.py index 3ce9058323..52ced13f73 100644 --- a/quantum/common/config.py +++ b/neutron/common/config.py @@ -16,7 +16,7 @@ # under the License. """ -Routines for configuring Quantum +Routines for configuring Neutron """ import os @@ -24,12 +24,13 @@ import os from oslo.config import cfg from paste import deploy -from quantum.api.v2 import attributes -from quantum.common import utils -from quantum.openstack.common.db.sqlalchemy import session as db_session -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.version import version_info as quantum_version +from neutron.api.v2 import attributes +from neutron.common import legacy +from neutron.common import utils +from neutron.openstack.common.db.sqlalchemy import session as db_session +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.version import version_info as neutron_version LOG = logging.getLogger(__name__) @@ -48,13 +49,13 @@ core_opts = [ cfg.StrOpt('auth_strategy', default='keystone', help=_("The type of authentication to use")), cfg.StrOpt('core_plugin', - help=_("The core plugin Quantum will use")), + help=_("The core plugin Neutron will use")), cfg.ListOpt('service_plugins', default=[], - help=_("The service plugins Quantum will use")), + help=_("The service plugins Neutron will use")), cfg.StrOpt('base_mac', default="fa:16:3e:00:00:00", - help=_("The base MAC address Quantum will use for VIFs")), + help=_("The base MAC address Neutron will use for VIFs")), cfg.IntOpt('mac_generation_retries', default=16, - help=_("How many times Quantum will retry MAC generation")), + help=_("How many times Neutron will retry MAC generation")), cfg.BoolOpt('allow_bulk', default=True, help=_("Allow the usage of the bulk API")), cfg.BoolOpt('allow_pagination', default=False, @@ -78,15 +79,15 @@ core_opts = [ help=_("Allow sending resource operation" " notification to DHCP agent")), cfg.BoolOpt('allow_overlapping_ips', default=False, - help=_("Allow overlapping IP support in Quantum")), + help=_("Allow overlapping IP support in Neutron")), cfg.StrOpt('host', default=utils.get_hostname(), - help=_("The hostname Quantum is running on")), + help=_("The hostname Neutron is running on")), cfg.BoolOpt('force_gateway_on_subnet', default=False, help=_("Ensure that configured gateway is on subnet")), ] core_cli_opts = [ - cfg.StrOpt('state_path', default='/var/lib/quantum'), + cfg.StrOpt('state_path', default='/var/lib/neutron'), ] # Register the configuration options @@ -94,7 +95,7 @@ cfg.CONF.register_opts(core_opts) cfg.CONF.register_cli_opts(core_cli_opts) # Ensure that the control exchange is set correctly -rpc.set_defaults(control_exchange='quantum') +rpc.set_defaults(control_exchange='neutron') _SQL_CONNECTION_DEFAULT = 'sqlite://' # Update the default QueuePool parameters. These can be tweaked by the # configuration variables - max_pool_size, max_overflow and pool_timeout @@ -104,8 +105,10 @@ db_session.set_defaults(sql_connection=_SQL_CONNECTION_DEFAULT, def parse(args): - cfg.CONF(args=args, project='quantum', - version='%%prog %s' % quantum_version.release_string()) + cfg.CONF(args=args, project='neutron', + version='%%prog %s' % neutron_version.release_string()) + + legacy.modernize_quantum_config(cfg.CONF) # Validate that the base_mac is of the correct format msg = attributes._validate_regex(cfg.CONF.base_mac, @@ -120,7 +123,7 @@ def setup_logging(conf): :param conf: a cfg.ConfOpts object """ - product_name = "quantum" + product_name = "neutron" logging.setup(product_name) LOG.info(_("Logging enabled!")) diff --git a/quantum/common/constants.py b/neutron/common/constants.py similarity index 100% rename from quantum/common/constants.py rename to neutron/common/constants.py diff --git a/quantum/common/exceptions.py b/neutron/common/exceptions.py similarity index 89% rename from quantum/common/exceptions.py rename to neutron/common/exceptions.py index 3ce6944de3..4195009d3e 100644 --- a/quantum/common/exceptions.py +++ b/neutron/common/exceptions.py @@ -16,16 +16,16 @@ # under the License. """ -Quantum base exception handling. +Neutron base exception handling. """ -from quantum.openstack.common.exception import Error -from quantum.openstack.common.exception import InvalidContentType # noqa -from quantum.openstack.common.exception import OpenstackException +from neutron.openstack.common.exception import Error +from neutron.openstack.common.exception import InvalidContentType # noqa +from neutron.openstack.common.exception import OpenstackException -class QuantumException(OpenstackException): - """Base Quantum Exception. +class NeutronException(OpenstackException): + """Base Neutron Exception. To correctly use this class, inherit from it and define a 'message' property. That message will get printf'd @@ -34,23 +34,23 @@ class QuantumException(OpenstackException): message = _("An unknown exception occurred.") -class BadRequest(QuantumException): +class BadRequest(NeutronException): message = _('Bad %(resource)s request: %(msg)s') -class NotFound(QuantumException): +class NotFound(NeutronException): pass -class Conflict(QuantumException): +class Conflict(NeutronException): pass -class NotAuthorized(QuantumException): +class NotAuthorized(NeutronException): message = _("Not authorized.") -class ServiceUnavailable(QuantumException): +class ServiceUnavailable(NeutronException): message = _("The service is unailable") @@ -83,11 +83,11 @@ class PolicyRuleNotFound(NotFound): message = _("Requested rule:%(rule)s cannot be found") -class PolicyInitError(QuantumException): +class PolicyInitError(NeutronException): message = _("Failed to init policy %(policy)s because %(reason)s") -class PolicyCheckError(QuantumException): +class PolicyCheckError(NeutronException): message = _("Failed to check policy %(policy)s because %(reason)s") @@ -95,7 +95,7 @@ class StateInvalid(BadRequest): message = _("Unsupported port state: %(port_state)s") -class InUse(QuantumException): +class InUse(NeutronException): message = _("The resource is inuse") @@ -215,15 +215,15 @@ class IpAddressGenerationFailure(Conflict): message = _("No more IP addresses available on network %(net_id)s.") -class BridgeDoesNotExist(QuantumException): +class BridgeDoesNotExist(NeutronException): message = _("Bridge %(bridge)s does not exist.") -class PreexistingDeviceFailure(QuantumException): +class PreexistingDeviceFailure(NeutronException): message = _("Creation failed. %(dev_name)s already exists.") -class SudoRequired(QuantumException): +class SudoRequired(NeutronException): message = _("Sudo priviledge is required to run this command.") @@ -258,11 +258,11 @@ class ExternalIpAddressExhausted(BadRequest): "network %(net_id)s.") -class TooManyExternalNetworks(QuantumException): +class TooManyExternalNetworks(NeutronException): message = _("More than one external network exists") -class InvalidConfigurationOption(QuantumException): +class InvalidConfigurationOption(NeutronException): message = _("An invalid value was provided for %(opt_name)s: " "%(opt_value)s") @@ -272,7 +272,7 @@ class GatewayConflictWithAllocationPools(InUse): "allocation pool %(pool)s") -class NetworkVlanRangeError(QuantumException): +class NetworkVlanRangeError(NeutronException): message = _("Invalid network VLAN range: '%(vlan_range)s' - '%(error)s'") def __init__(self, **kwargs): diff --git a/neutron/common/legacy.py b/neutron/common/legacy.py new file mode 100644 index 0000000000..e4fa1971b9 --- /dev/null +++ b/neutron/common/legacy.py @@ -0,0 +1,82 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Copyright 2013 New Dream Network, LLC (DreamHost) +# 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 Mark McClain (DreamHost) + +from neutron.openstack.common import log as logging + +LOG = logging.getLogger(__name__) + + +def scrub_class_path(cls_path): + """Scrub from Quantum from old class_path references.""" + + if isinstance(cls_path, basestring): + if cls_path.startswith('quantum'): + new_path = cls_path.replace('quantum', 'neutron') + new_path = new_path.replace('Quantum', 'Neutron') + LOG.warn( + _("Old class module path in use. Please change '%(old)s' " + "to '%(new)s'."), + {'old': cls_path, 'new': new_path} + ) + cls_path = new_path + return cls_path + + +def override_config(config, config_keys=None): + """Attempt to override config_key with Neutron compatible values.""" + + for key in config_keys: + group = None + if not isinstance(key, basestring): + try: + group, key = key + old_value = getattr(getattr(config, group), key, None) + except AttributeError: + LOG.error(_('Skipping unknown group key: %s'), key) + continue + else: + old_value = getattr(config, key, None) + if not old_value: + continue + elif isinstance(old_value, list): + new_value = [scrub_class_path(v) for v in old_value] + else: + new_value = scrub_class_path(old_value) + + if new_value != old_value: + config.set_override(key, new_value, group=group) + + +def modernize_quantum_config(config): + """Updates keys from old Quantum configurations for Neutron.""" + config_keys = [ + 'core_plugin', + 'device_driver', + 'dhcp_driver', + 'driver_fqn', + 'interface_driver', + 'network_scheduler_driver', + 'router_scheduler_driver', + 'rpc_backend', + 'service_plugins', + ('QUOTAS', 'quota_driver'), + ('SECURITYGROUP', 'firewall_driver'), + ] + + override_config(config, config_keys) diff --git a/quantum/common/rpc.py b/neutron/common/rpc.py similarity index 83% rename from quantum/common/rpc.py rename to neutron/common/rpc.py index 0c19d4424e..c2b5aae7f9 100644 --- a/quantum/common/rpc.py +++ b/neutron/common/rpc.py @@ -15,9 +15,9 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum import context -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import dispatcher +from neutron import context +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import dispatcher LOG = logging.getLogger(__name__) @@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__) class PluginRpcDispatcher(dispatcher.RpcDispatcher): """This class is used to convert RPC common context into - Quantum Context. + Neutron Context. """ def __init__(self, callbacks): @@ -39,6 +39,6 @@ class PluginRpcDispatcher(dispatcher.RpcDispatcher): tenant_id = rpc_ctxt_dict.pop('tenant_id', None) if not tenant_id: tenant_id = rpc_ctxt_dict.pop('project_id', None) - quantum_ctxt = context.Context(user_id, tenant_id, **rpc_ctxt_dict) + neutron_ctxt = context.Context(user_id, tenant_id, **rpc_ctxt_dict) return super(PluginRpcDispatcher, self).dispatch( - quantum_ctxt, version, method, namespace, **kwargs) + neutron_ctxt, version, method, namespace, **kwargs) diff --git a/quantum/common/test_lib.py b/neutron/common/test_lib.py similarity index 97% rename from quantum/common/test_lib.py rename to neutron/common/test_lib.py index bca15b1405..9d77e689a4 100644 --- a/quantum/common/test_lib.py +++ b/neutron/common/test_lib.py @@ -43,7 +43,7 @@ import unittest from nose import core from nose import result -from quantum.common import constants +from neutron.common import constants class _AnsiColorizer(object): @@ -155,7 +155,7 @@ class _NullColorizer(object): self.stream.write(text) -class QuantumTestResult(result.TextTestResult): +class NeutronTestResult(result.TextTestResult): def __init__(self, *args, **kw): result.TextTestResult.__init__(self, *args, **kw) self._last_case = None @@ -247,9 +247,9 @@ class QuantumTestResult(result.TextTestResult): self.stream.flush() -class QuantumTestRunner(core.TextTestRunner): +class NeutronTestRunner(core.TextTestRunner): def _makeResult(self): - return QuantumTestResult(self.stream, + return NeutronTestResult(self.stream, self.descriptions, self.verbosity, self.config) @@ -264,7 +264,7 @@ def run_tests(c=None): if not c: return True - runner = QuantumTestRunner(stream=c.stream, + runner = NeutronTestRunner(stream=c.stream, verbosity=c.verbosity, config=c) return not core.run(config=c, testRunner=runner) @@ -272,7 +272,7 @@ def run_tests(c=None): # describes parameters used by different unit/functional tests # a plugin-specific testing mechanism should import this dictionary # and override the values in it if needed (e.g., run_tests.py in -# quantum/plugins/openvswitch/ ) +# neutron/plugins/openvswitch/ ) test_config = { "plugin_name": "", "default_net_op_status": constants.NET_STATUS_ACTIVE, diff --git a/quantum/common/topics.py b/neutron/common/topics.py similarity index 100% rename from quantum/common/topics.py rename to neutron/common/topics.py diff --git a/quantum/common/utils.py b/neutron/common/utils.py similarity index 90% rename from quantum/common/utils.py rename to neutron/common/utils.py index afeae56cc4..62a416d815 100644 --- a/quantum/common/utils.py +++ b/neutron/common/utils.py @@ -29,15 +29,15 @@ import socket from eventlet.green import subprocess from oslo.config import cfg -from quantum.common import constants as q_const -from quantum.openstack.common import lockutils -from quantum.openstack.common import log as logging +from neutron.common import constants as q_const +from neutron.openstack.common import lockutils +from neutron.openstack.common import log as logging TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" LOG = logging.getLogger(__name__) -synchronized = lockutils.synchronized_with_prefix('quantum-') +synchronized = lockutils.synchronized_with_prefix('neutron-') def read_cached_file(filename, cache_info, reload_func=None): @@ -78,13 +78,17 @@ def find_config_file(options, config_file): root = os.path.join(dir_to_common, '..', '..', '..', '..') # Handle standard directory search for the config file config_file_dirs = [fix_path(os.path.join(os.getcwd(), 'etc')), - fix_path(os.path.join('~', '.quantum-venv', 'etc', - 'quantum')), + fix_path(os.path.join('~', '.neutron-venv', 'etc', + 'neutron')), fix_path('~'), os.path.join(cfg.CONF.state_path, 'etc'), - os.path.join(cfg.CONF.state_path, 'etc', 'quantum'), + os.path.join(cfg.CONF.state_path, 'etc', 'neutron'), fix_path(os.path.join('~', '.local', - 'etc', 'quantum')), + 'etc', 'neutron')), + '/usr/etc/neutron', + '/usr/local/etc/neutron', + '/etc/neutron/', + # TODO(markmcclain) remove in Icehouse '/usr/etc/quantum', '/usr/local/etc/quantum', '/etc/quantum/', @@ -92,7 +96,7 @@ def find_config_file(options, config_file): if 'plugin' in options: config_file_dirs = [ - os.path.join(x, 'quantum', 'plugins', options['plugin']) + os.path.join(x, 'neutron', 'plugins', options['plugin']) for x in config_file_dirs ] diff --git a/quantum/context.py b/neutron/context.py similarity index 96% rename from quantum/context.py rename to neutron/context.py index fa6166dd9a..9a7bf777ab 100644 --- a/quantum/context.py +++ b/neutron/context.py @@ -21,10 +21,10 @@ import copy from datetime import datetime -from quantum.db import api as db_api -from quantum.openstack.common import context as common_context -from quantum.openstack.common import log as logging -from quantum import policy +from neutron.db import api as db_api +from neutron.openstack.common import context as common_context +from neutron.openstack.common import log as logging +from neutron import policy LOG = logging.getLogger(__name__) diff --git a/quantum/db/__init__.py b/neutron/db/__init__.py similarity index 100% rename from quantum/db/__init__.py rename to neutron/db/__init__.py diff --git a/quantum/db/agents_db.py b/neutron/db/agents_db.py similarity index 94% rename from quantum/db/agents_db.py rename to neutron/db/agents_db.py index 10da4de2e4..b4a8b21657 100644 --- a/quantum/db/agents_db.py +++ b/neutron/db/agents_db.py @@ -19,13 +19,13 @@ from oslo.config import cfg import sqlalchemy as sa from sqlalchemy.orm import exc -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.extensions import agent as ext_agent -from quantum import manager -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import timeutils +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.extensions import agent as ext_agent +from neutron import manager +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import timeutils LOG = logging.getLogger(__name__) cfg.CONF.register_opt( @@ -34,7 +34,7 @@ cfg.CONF.register_opt( class Agent(model_base.BASEV2, models_v2.HasId): - """Represents agents running in quantum deployments.""" + """Represents agents running in neutron deployments.""" # L3 agent, DHCP agent, OVS agent, LinuxBridge agent_type = sa.Column(sa.String(255), nullable=False) @@ -170,5 +170,5 @@ class AgentExtRpcCallback(object): LOG.debug(_("Message with invalid timestamp received")) return agent_state = kwargs['agent_state']['agent_state'] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() plugin.create_or_update_agent(context, agent_state) diff --git a/quantum/db/agentschedulers_db.py b/neutron/db/agentschedulers_db.py similarity index 97% rename from quantum/db/agentschedulers_db.py rename to neutron/db/agentschedulers_db.py index 994e9710b7..f20e4c9563 100644 --- a/quantum/db/agentschedulers_db.py +++ b/neutron/db/agentschedulers_db.py @@ -20,19 +20,19 @@ from sqlalchemy import orm from sqlalchemy.orm import exc from sqlalchemy.orm import joinedload -from quantum.common import constants -from quantum.db import agents_db -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.extensions import agentscheduler -from quantum.openstack.common import log as logging +from neutron.common import constants +from neutron.db import agents_db +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.extensions import agentscheduler +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) class NetworkDhcpAgentBinding(model_base.BASEV2): - """Represents binding between quantum networks and DHCP agents.""" + """Represents binding between neutron networks and DHCP agents.""" network_id = sa.Column(sa.String(36), sa.ForeignKey("networks.id", ondelete='CASCADE'), @@ -45,7 +45,7 @@ class NetworkDhcpAgentBinding(model_base.BASEV2): class RouterL3AgentBinding(model_base.BASEV2, models_v2.HasId): - """Represents binding between quantum routers and L3 agents.""" + """Represents binding between neutron routers and L3 agents.""" router_id = sa.Column(sa.String(36), sa.ForeignKey("routers.id", ondelete='CASCADE')) diff --git a/quantum/db/api.py b/neutron/db/api.py similarity index 93% rename from quantum/db/api.py rename to neutron/db/api.py index c04926104e..4f813dd735 100644 --- a/quantum/db/api.py +++ b/neutron/db/api.py @@ -19,9 +19,9 @@ import sqlalchemy as sql -from quantum.db import model_base -from quantum.openstack.common.db.sqlalchemy import session -from quantum.openstack.common import log as logging +from neutron.db import model_base +from neutron.openstack.common.db.sqlalchemy import session +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/db/db_base_plugin_v2.py b/neutron/db/db_base_plugin_v2.py similarity index 97% rename from quantum/db/db_base_plugin_v2.py rename to neutron/db/db_base_plugin_v2.py index 27d44f59ba..7378c951f5 100644 --- a/quantum/db/db_base_plugin_v2.py +++ b/neutron/db/db_base_plugin_v2.py @@ -23,17 +23,17 @@ from oslo.config import cfg from sqlalchemy import orm from sqlalchemy.orm import exc -from quantum.api.v2 import attributes -from quantum.common import constants -from quantum.common import exceptions as q_exc -from quantum.db import api as db -from quantum.db import models_v2 -from quantum.db import sqlalchemyutils -from quantum.openstack.common import excutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import timeutils -from quantum.openstack.common import uuidutils -from quantum import quantum_plugin_base_v2 +from neutron.api.v2 import attributes +from neutron.common import constants +from neutron.common import exceptions as q_exc +from neutron.db import api as db +from neutron.db import models_v2 +from neutron.db import sqlalchemyutils +from neutron import neutron_plugin_base_v2 +from neutron.openstack.common import excutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import timeutils +from neutron.openstack.common import uuidutils LOG = logging.getLogger(__name__) @@ -175,9 +175,9 @@ class CommonDbMixin(object): return self._get_collection_query(context, model, filters).count() -class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, +class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2, CommonDbMixin): - """V2 Quantum plugin interface implementation using SQLAlchemy models. + """V2 Neutron plugin interface implementation using SQLAlchemy models. Whenever a non-read call happens the plugin will call an event handler class method (e.g., network_created()). The result is that this class @@ -269,7 +269,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, if base_mac[3] != '00': mac[3] = int(base_mac[3], 16) mac_address = ':'.join(map(lambda x: "%02x" % x, mac)) - if QuantumDbPluginV2._check_unique_mac(context, network_id, + if NeutronDbPluginV2._check_unique_mac(context, network_id, mac_address): LOG.debug(_("Generated mac for network %(network_id)s " "is %(mac_address)s"), @@ -308,7 +308,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, return if allocated.expiration < timeutils.utcnow(): # immediately delete expired allocations - QuantumDbPluginV2._recycle_ip( + NeutronDbPluginV2._recycle_ip( context, network_id, subnet_id, ip_address) else: LOG.debug(_("Hold allocated IP %(ip_address)s " @@ -333,7 +333,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, models_v2.IPAllocation.expiration <= timeutils.utcnow()) for expired in expired_qry: - QuantumDbPluginV2._recycle_ip(context, + NeutronDbPluginV2._recycle_ip(context, network_id, expired['subnet_id'], expired['ip_address']) @@ -423,7 +423,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, context.session.add(ip_range) LOG.debug(_("Recycle: created new %(first_ip)s-%(last_ip)s"), {'first_ip': ip_address, 'last_ip': ip_address}) - QuantumDbPluginV2._delete_ip_allocation(context, network_id, subnet_id, + NeutronDbPluginV2._delete_ip_allocation(context, network_id, subnet_id, ip_address) @staticmethod @@ -603,7 +603,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, filter = {'network_id': [network_id]} subnets = self.get_subnets(context, filters=filter) for subnet in subnets: - if QuantumDbPluginV2._check_subnet_ip(subnet['cidr'], + if NeutronDbPluginV2._check_subnet_ip(subnet['cidr'], fixed['ip_address']): found = True subnet_id = subnet['id'] @@ -625,7 +625,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, if 'ip_address' in fixed: # Ensure that the IP's are unique - if not QuantumDbPluginV2._check_unique_ip(context, network_id, + if not NeutronDbPluginV2._check_unique_ip(context, network_id, subnet_id, fixed['ip_address']): raise q_exc.IpAddressInUse(net_id=network_id, @@ -633,7 +633,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, # Ensure that the IP is valid on the subnet if (not found and - not QuantumDbPluginV2._check_subnet_ip( + not NeutronDbPluginV2._check_subnet_ip( subnet['cidr'], fixed['ip_address'])): msg = _('IP address %s is not a valid IP for the defined ' 'subnet') % fixed['ip_address'] @@ -654,7 +654,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, for fixed in fixed_ips: if 'ip_address' in fixed: # Remove the IP address from the allocation pool - QuantumDbPluginV2._allocate_specific_ip( + NeutronDbPluginV2._allocate_specific_ip( context, fixed['subnet_id'], fixed['ip_address']) ips.append({'ip_address': fixed['ip_address'], 'subnet_id': fixed['subnet_id']}) @@ -693,7 +693,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, to_add = self._test_fixed_ips_for_port(context, network_id, new_ips) for ip in original_ips: LOG.debug(_("Port update. Hold %s"), ip) - QuantumDbPluginV2._hold_ip(context, + NeutronDbPluginV2._hold_ip(context, network_id, ip['subnet_id'], port_id, @@ -735,7 +735,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, version_subnets = [v4, v6] for subnets in version_subnets: if subnets: - result = QuantumDbPluginV2._generate_ip(context, subnets) + result = NeutronDbPluginV2._generate_ip(context, subnets) ips.append({'ip_address': result['ip_address'], 'subnet_id': result['subnet_id']}) return ips @@ -1087,7 +1087,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, if attributes.is_attr_set(s.get('gateway_ip')): self._validate_ip_version(ip_ver, s['gateway_ip'], 'gateway_ip') if (cfg.CONF.force_gateway_on_subnet and - not QuantumDbPluginV2._check_subnet_ip(s['cidr'], + not NeutronDbPluginV2._check_subnet_ip(s['cidr'], s['gateway_ip'])): error_message = _("Gateway is not valid on subnet") raise q_exc.InvalidInput(error_message=error_message) @@ -1330,11 +1330,11 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, # Ensure that a MAC address is defined and it is unique on the # network if mac_address is attributes.ATTR_NOT_SPECIFIED: - mac_address = QuantumDbPluginV2._generate_mac(context, + mac_address = NeutronDbPluginV2._generate_mac(context, network_id) else: # Ensure that the mac on the network is unique - if not QuantumDbPluginV2._check_unique_mac(context, + if not NeutronDbPluginV2._check_unique_mac(context, network_id, mac_address): raise q_exc.MacAddressInUse(net_id=network_id, @@ -1428,10 +1428,10 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, for a in allocated: subnet = self._get_subnet(context, a['subnet_id']) # Check if IP was allocated from allocation pool - if QuantumDbPluginV2._check_ip_in_allocation_pool( + if NeutronDbPluginV2._check_ip_in_allocation_pool( context, a['subnet_id'], subnet['gateway_ip'], a['ip_address']): - QuantumDbPluginV2._hold_ip(context, + NeutronDbPluginV2._hold_ip(context, a['network_id'], a['subnet_id'], id, @@ -1439,7 +1439,7 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2, else: # IPs out of allocation pool will not be recycled, but # we do need to delete the allocation from the DB - QuantumDbPluginV2._delete_ip_allocation( + NeutronDbPluginV2._delete_ip_allocation( context, a['network_id'], a['subnet_id'], a['ip_address']) msg_dict = {'address': a['ip_address'], diff --git a/quantum/db/dhcp_rpc_base.py b/neutron/db/dhcp_rpc_base.py similarity index 93% rename from quantum/db/dhcp_rpc_base.py rename to neutron/db/dhcp_rpc_base.py index 1eca64a6f7..353f09f310 100644 --- a/quantum/db/dhcp_rpc_base.py +++ b/neutron/db/dhcp_rpc_base.py @@ -16,11 +16,11 @@ from oslo.config import cfg from sqlalchemy.orm import exc -from quantum.api.v2 import attributes -from quantum.common import constants -from quantum.common import utils -from quantum import manager -from quantum.openstack.common import log as logging +from neutron.api.v2 import attributes +from neutron.common import constants +from neutron.common import utils +from neutron import manager +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -33,7 +33,7 @@ class DhcpRpcCallbackMixin(object): """Retrieve and return a list of the active network ids.""" host = kwargs.get('host') LOG.debug(_('Network list requested from %s'), host) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() if utils.is_extension_supported( plugin, constants.AGENT_SCHEDULER_EXT_ALIAS): if cfg.CONF.network_auto_schedule: @@ -52,7 +52,7 @@ class DhcpRpcCallbackMixin(object): LOG.debug(_('Network %(network_id)s requested from ' '%(host)s'), {'network_id': network_id, 'host': host}) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() network = plugin.get_network(context, network_id) filters = dict(network_id=[network_id]) @@ -78,7 +78,7 @@ class DhcpRpcCallbackMixin(object): '%(host)s'), {'device_id': device_id, 'network_id': network_id, 'host': host}) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() retval = None filters = dict(network_id=[network_id]) @@ -144,7 +144,7 @@ class DhcpRpcCallbackMixin(object): LOG.debug(_('DHCP port deletion for %(network_id)s request from ' '%(host)s'), {'network_id': network_id, 'host': host}) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() filters = dict(network_id=[network_id], device_id=[device_id]) ports = plugin.get_ports(context, filters=filters) @@ -161,7 +161,7 @@ class DhcpRpcCallbackMixin(object): LOG.debug(_('DHCP port remove fixed_ip for %(subnet_id)s request ' 'from %(host)s'), {'subnet_id': subnet_id, 'host': host}) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() filters = dict(network_id=[network_id], device_id=[device_id]) ports = plugin.get_ports(context, filters=filters) @@ -187,7 +187,7 @@ class DhcpRpcCallbackMixin(object): {'ip_address': ip_address, 'network_id': network_id, 'host': host}) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() plugin.update_fixed_ip_lease_expiration(context, network_id, ip_address, lease_remaining) diff --git a/quantum/db/extraroute_db.py b/neutron/db/extraroute_db.py similarity index 95% rename from quantum/db/extraroute_db.py rename to neutron/db/extraroute_db.py index b8dfcd8786..987e87b3b3 100644 --- a/quantum/db/extraroute_db.py +++ b/neutron/db/extraroute_db.py @@ -20,14 +20,14 @@ from oslo.config import cfg import sqlalchemy as sa from sqlalchemy import orm -from quantum.common import utils -from quantum.db import db_base_plugin_v2 -from quantum.db import l3_db -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.extensions import extraroute -from quantum.extensions import l3 -from quantum.openstack.common import log as logging +from neutron.common import utils +from neutron.db import db_base_plugin_v2 +from neutron.db import l3_db +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.extensions import extraroute +from neutron.extensions import l3 +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -62,7 +62,7 @@ class ExtraRoute_db_mixin(l3_db.L3_NAT_db_mixin): router_db['route_list'] )) - db_base_plugin_v2.QuantumDbPluginV2.register_dict_extend_funcs( + db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs( l3.ROUTERS, [_extend_router_dict_extraroute]) def update_router(self, context, id, router): diff --git a/quantum/db/l3_db.py b/neutron/db/l3_db.py similarity index 98% rename from quantum/db/l3_db.py rename to neutron/db/l3_db.py index dca17b8931..50db1eadd3 100644 --- a/quantum/db/l3_db.py +++ b/neutron/db/l3_db.py @@ -23,17 +23,17 @@ from sqlalchemy import orm from sqlalchemy.orm import exc from sqlalchemy.sql import expression as expr -from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api -from quantum.api.v2 import attributes -from quantum.common import constants as l3_constants -from quantum.common import exceptions as q_exc -from quantum.db import db_base_plugin_v2 -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.extensions import l3 -from quantum.openstack.common import log as logging -from quantum.openstack.common.notifier import api as notifier_api -from quantum.openstack.common import uuidutils +from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api +from neutron.api.v2 import attributes +from neutron.common import constants as l3_constants +from neutron.common import exceptions as q_exc +from neutron.db import db_base_plugin_v2 +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.extensions import l3 +from neutron.openstack.common import log as logging +from neutron.openstack.common.notifier import api as notifier_api +from neutron.openstack.common import uuidutils LOG = logging.getLogger(__name__) @@ -50,7 +50,7 @@ API_TO_DB_COLUMN_MAP = {'port_id': 'fixed_port_id'} class Router(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents a v2 quantum router.""" + """Represents a v2 neutron router.""" name = sa.Column(sa.String(255)) status = sa.Column(sa.String(16)) @@ -117,7 +117,7 @@ class L3_NAT_db_mixin(l3.RouterPluginBase): # TODO(salvatore-orlando): Perform this operation without explicitly # referring to db_base_plugin_v2, as plugins that do not extend from it # might exist in the future - db_base_plugin_v2.QuantumDbPluginV2.register_model_query_hook( + db_base_plugin_v2.NeutronDbPluginV2.register_model_query_hook( models_v2.Network, "external_net", _network_model_hook, @@ -799,7 +799,7 @@ class L3_NAT_db_mixin(l3.RouterPluginBase): return network_res # Register dict extend functions for networks - db_base_plugin_v2.QuantumDbPluginV2.register_dict_extend_funcs( + db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs( attributes.NETWORKS, [_extend_network_dict_l3]) def _process_l3_create(self, context, net_data, req_data): diff --git a/quantum/db/l3_gwmode_db.py b/neutron/db/l3_gwmode_db.py similarity index 95% rename from quantum/db/l3_gwmode_db.py rename to neutron/db/l3_gwmode_db.py index d91bd3d663..74c0cf36ec 100644 --- a/quantum/db/l3_gwmode_db.py +++ b/neutron/db/l3_gwmode_db.py @@ -19,9 +19,9 @@ import sqlalchemy as sa -from quantum.db import l3_db -from quantum.extensions import l3 -from quantum.openstack.common import log as logging +from neutron.db import l3_db +from neutron.extensions import l3 +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/db/l3_rpc_base.py b/neutron/db/l3_rpc_base.py similarity index 82% rename from quantum/db/l3_rpc_base.py rename to neutron/db/l3_rpc_base.py index c4db054423..193681990a 100644 --- a/quantum/db/l3_rpc_base.py +++ b/neutron/db/l3_rpc_base.py @@ -15,12 +15,12 @@ from oslo.config import cfg -from quantum.common import constants -from quantum.common import utils -from quantum import context as quantum_context -from quantum import manager -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging +from neutron.common import constants +from neutron.common import utils +from neutron import context as neutron_context +from neutron import manager +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -39,8 +39,8 @@ class L3RpcCallbackMixin(object): """ router_id = kwargs.get('router_id') host = kwargs.get('host') - context = quantum_context.get_admin_context() - plugin = manager.QuantumManager.get_plugin() + context = neutron_context.get_admin_context() + plugin = manager.NeutronManager.get_plugin() if utils.is_extension_supported( plugin, constants.AGENT_SCHEDULER_EXT_ALIAS): if cfg.CONF.router_auto_schedule: @@ -59,8 +59,8 @@ class L3RpcCallbackMixin(object): l3 agent expects only on external network when it performs this query. """ - context = quantum_context.get_admin_context() - plugin = manager.QuantumManager.get_plugin() + context = neutron_context.get_admin_context() + plugin = manager.NeutronManager.get_plugin() net_id = plugin.get_external_network_id(context) LOG.debug(_("External network ID returned to l3 agent: %s"), net_id) diff --git a/quantum/db/loadbalancer/__init__.py b/neutron/db/loadbalancer/__init__.py similarity index 100% rename from quantum/db/loadbalancer/__init__.py rename to neutron/db/loadbalancer/__init__.py diff --git a/quantum/db/loadbalancer/loadbalancer_db.py b/neutron/db/loadbalancer/loadbalancer_db.py similarity index 96% rename from quantum/db/loadbalancer/loadbalancer_db.py rename to neutron/db/loadbalancer/loadbalancer_db.py index 8821bf4d92..b207e3f8a1 100644 --- a/quantum/db/loadbalancer/loadbalancer_db.py +++ b/neutron/db/loadbalancer/loadbalancer_db.py @@ -20,18 +20,18 @@ from sqlalchemy import orm from sqlalchemy.orm import exc from sqlalchemy.orm import validates -from quantum.api.v2 import attributes -from quantum.common import exceptions as q_exc -from quantum.db import db_base_plugin_v2 as base_db -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.extensions import loadbalancer -from quantum.extensions.loadbalancer import LoadBalancerPluginBase -from quantum import manager -from quantum.openstack.common.db import exception -from quantum.openstack.common import log as logging -from quantum.openstack.common import uuidutils -from quantum.plugins.common import constants +from neutron.api.v2 import attributes +from neutron.common import exceptions as q_exc +from neutron.db import db_base_plugin_v2 as base_db +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.extensions import loadbalancer +from neutron.extensions.loadbalancer import LoadBalancerPluginBase +from neutron import manager +from neutron.openstack.common.db import exception +from neutron.openstack.common import log as logging +from neutron.openstack.common import uuidutils +from neutron.plugins.common import constants LOG = logging.getLogger(__name__) @@ -72,7 +72,7 @@ class PoolStatistics(model_base.BASEV2): class Vip(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents a v2 quantum loadbalancer vip.""" + """Represents a v2 neutron loadbalancer vip.""" name = sa.Column(sa.String(255)) description = sa.Column(sa.String(255)) @@ -92,7 +92,7 @@ class Vip(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): class Member(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents a v2 quantum loadbalancer member.""" + """Represents a v2 neutron loadbalancer member.""" pool_id = sa.Column(sa.String(36), sa.ForeignKey("pools.id"), nullable=False) @@ -104,7 +104,7 @@ class Member(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): class Pool(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents a v2 quantum loadbalancer pool.""" + """Represents a v2 neutron loadbalancer pool.""" vip_id = sa.Column(sa.String(36), sa.ForeignKey("vips.id")) name = sa.Column(sa.String(255)) @@ -131,7 +131,7 @@ class Pool(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): class HealthMonitor(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents a v2 quantum loadbalancer healthmonitor.""" + """Represents a v2 neutron loadbalancer healthmonitor.""" type = sa.Column(sa.Enum("PING", "TCP", "HTTP", "HTTPS", name="healthmontiors_type"), @@ -167,13 +167,13 @@ class LoadBalancerPluginDb(LoadBalancerPluginBase, base_db.CommonDbMixin): """Wraps loadbalancer with SQLAlchemy models. - A class that wraps the implementation of the Quantum loadbalancer + A class that wraps the implementation of the Neutron loadbalancer plugin database access interface using SQLAlchemy models. """ @property def _core_plugin(self): - return manager.QuantumManager.get_plugin() + return manager.NeutronManager.get_plugin() def update_status(self, context, model, id, status): with context.session.begin(subtransactions=True): @@ -424,7 +424,7 @@ class LoadBalancerPluginDb(LoadBalancerPluginBase, pool.update({"vip_id": None}) context.session.delete(vip) - if vip.port: # this is a Quantum port + if vip.port: # this is a Neutron port self._core_plugin.delete_port(context, vip.port.id) def get_vip(self, context, id, fields=None): diff --git a/quantum/db/migration/README b/neutron/db/migration/README similarity index 78% rename from quantum/db/migration/README rename to neutron/db/migration/README index e29081adda..60c9d0c814 100644 --- a/quantum/db/migration/README +++ b/neutron/db/migration/README @@ -17,56 +17,56 @@ # @author Mark McClain (DreamHost) The migrations in the alembic/versions contain the changes needed to migrate -from older Quantum releases to newer versions. A migration occurs by executing +from older Neutron releases to newer versions. A migration occurs by executing a script that details the changes needed to upgrade/downgrade the database. The migration scripts are ordered so that multiple scripts can run sequentially to -update the database. The scripts are executed by Quantum's migration wrapper -which uses the Alembic library to manage the migration. Quantum supports +update the database. The scripts are executed by Neutron's migration wrapper +which uses the Alembic library to manage the migration. Neutron supports migration from Folsom or later. If you are a deployer or developer and want to migrate from Folsom to Grizzly or later you must first add version tracking to the database: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini stamp folsom You can then upgrade to the latest database version via: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini upgrade head To check the current database version: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini current To create a script to run the migration offline: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini upgrade head --sql To run the offline migration between specific migration versions: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini upgrade \ : --sql Upgrade the database incrementally: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini upgrade --delta <# of revs> Downgrade the database by a certain number of revisions: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini downgrade --delta <# of revs> DEVELOPERS: -A database migration script is required when you submit a change to Quantum +A database migration script is required when you submit a change to Neutron that alters the database model definition. The migration script is a special python file that includes code to update/downgrade the database to match the changes in the model definition. Alembic will execute these scripts in order to -provide a linear migration path between revision. The quantum-db-manage command +provide a linear migration path between revision. The neutron-db-manage command can be used to generate migration template for you to complete. The operations in the template are those supported by the Alembic migration library. -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini revision \ -m "description of revision" \ --autogenerate @@ -79,16 +79,16 @@ In rare circumstances, you may want to start with an empty migration template and manually author the changes necessary for an upgrade/downgrade. You can create a blank file via: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini revision \ -m "description of revision" The migration timeline should remain linear so that there is a clear path when upgrading/downgrading. To verify that the timeline does branch, you can run this command: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini check_migration If the migration path does branch, you can find the branch point via: -$ quantum-db-manage --config-file /path/to/quantum.conf \ +$ neutron-db-manage --config-file /path/to/neutron.conf \ --config-file /path/to/plugin/config.ini history diff --git a/quantum/db/migration/__init__.py b/neutron/db/migration/__init__.py similarity index 100% rename from quantum/db/migration/__init__.py rename to neutron/db/migration/__init__.py diff --git a/quantum/db/migration/alembic.ini b/neutron/db/migration/alembic.ini similarity index 93% rename from quantum/db/migration/alembic.ini rename to neutron/db/migration/alembic.ini index 3b390b7893..83098afbd8 100644 --- a/quantum/db/migration/alembic.ini +++ b/neutron/db/migration/alembic.ini @@ -11,7 +11,7 @@ script_location = %(here)s/alembic # the 'revision' command, regardless of autogenerate # revision_environment = false -# default to an empty string because the Quantum migration cli will +# default to an empty string because the Neutron migration cli will # extract the correct value and set it programatically before alemic is fully # invoked. sqlalchemy.url = diff --git a/quantum/db/migration/alembic_migrations/__init__.py b/neutron/db/migration/alembic_migrations/__init__.py similarity index 100% rename from quantum/db/migration/alembic_migrations/__init__.py rename to neutron/db/migration/alembic_migrations/__init__.py diff --git a/quantum/db/migration/alembic_migrations/common_ext_ops.py b/neutron/db/migration/alembic_migrations/common_ext_ops.py similarity index 100% rename from quantum/db/migration/alembic_migrations/common_ext_ops.py rename to neutron/db/migration/alembic_migrations/common_ext_ops.py diff --git a/quantum/db/migration/alembic_migrations/env.py b/neutron/db/migration/alembic_migrations/env.py similarity index 80% rename from quantum/db/migration/alembic_migrations/env.py rename to neutron/db/migration/alembic_migrations/env.py index f4ef29a409..300f05a075 100644 --- a/quantum/db/migration/alembic_migrations/env.py +++ b/neutron/db/migration/alembic_migrations/env.py @@ -21,22 +21,24 @@ from logging.config import fileConfig from alembic import context from sqlalchemy import create_engine, pool -from quantum.db import model_base -from quantum.openstack.common import importutils +from neutron.db import model_base +from neutron.openstack.common import importutils -DATABASE_QUOTA_DRIVER = 'quantum.extensions._quotav2_driver.DbQuotaDriver' +DATABASE_QUOTA_DRIVER = 'neutron.extensions._quotav2_driver.DbQuotaDriver' # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config -quantum_config = config.quantum_config +neutron_config = config.neutron_config # Interpret the config file for Python logging. # This line sets up loggers basically. fileConfig(config.config_file_name) -plugin_klass = importutils.import_class(quantum_config.core_plugin) +plugin_class_path = neutron_config.core_plugin + +plugin_klass = importutils.import_class(plugin_class_path) # set the target for 'autogenerate' support target_metadata = model_base.BASEV2.metadata @@ -54,10 +56,10 @@ def run_migrations_offline(): script output. """ - context.configure(url=quantum_config.database.connection) + context.configure(url=neutron_config.database.connection) with context.begin_transaction(): - context.run_migrations(active_plugin=quantum_config.core_plugin, + context.run_migrations(active_plugin=plugin_class_path, options=build_options()) @@ -69,7 +71,7 @@ def run_migrations_online(): """ engine = create_engine( - quantum_config.database.connection, + neutron_config.database.connection, poolclass=pool.NullPool) connection = engine.connect() @@ -80,7 +82,7 @@ def run_migrations_online(): try: with context.begin_transaction(): - context.run_migrations(active_plugin=quantum_config.core_plugin, + context.run_migrations(active_plugin=plugin_class_path, options=build_options()) finally: connection.close() @@ -91,7 +93,7 @@ def build_options(): def is_db_quota_enabled(): - return quantum_config.QUOTAS.quota_driver == DATABASE_QUOTA_DRIVER + return neutron_config.QUOTAS.quota_driver == DATABASE_QUOTA_DRIVER if context.is_offline_mode(): diff --git a/quantum/db/migration/alembic_migrations/script.py.mako b/neutron/db/migration/alembic_migrations/script.py.mako similarity index 94% rename from quantum/db/migration/alembic_migrations/script.py.mako rename to neutron/db/migration/alembic_migrations/script.py.mako index 630aa5090d..b730f72e43 100644 --- a/quantum/db/migration/alembic_migrations/script.py.mako +++ b/neutron/db/migration/alembic_migrations/script.py.mako @@ -30,14 +30,14 @@ down_revision = ${repr(down_revision)} # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - '${config.quantum_config.core_plugin}' + '${config.neutron_config.core_plugin}' ] from alembic import op import sqlalchemy as sa ${imports if imports else ""} -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/1149d7de0cfa_port_security.py b/neutron/db/migration/alembic_migrations/versions/1149d7de0cfa_port_security.py similarity index 97% rename from quantum/db/migration/alembic_migrations/versions/1149d7de0cfa_port_security.py rename to neutron/db/migration/alembic_migrations/versions/1149d7de0cfa_port_security.py index 13b8ae1f23..575c12cff9 100644 --- a/quantum/db/migration/alembic_migrations/versions/1149d7de0cfa_port_security.py +++ b/neutron/db/migration/alembic_migrations/versions/1149d7de0cfa_port_security.py @@ -30,13 +30,13 @@ down_revision = '1b693c095aa3' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2' + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py b/neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py similarity index 79% rename from quantum/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py rename to neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py index b421e62c0b..20d08ae14a 100644 --- a/quantum/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py +++ b/neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py @@ -30,19 +30,19 @@ down_revision = '32b517556ec9' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.hyperv.hyperv_quantum_plugin.HyperVQuantumPlugin', - 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2', - 'quantum.plugins.metaplugin.meta_quantum_plugin.MetaPluginV2', - 'quantum.plugins.nec.nec_plugin.NECPluginV2', - 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2', - 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2' + 'neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin', + 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2', + 'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2', + 'neutron.plugins.nec.nec_plugin.NECPluginV2', + 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', + 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py b/neutron/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py similarity index 96% rename from quantum/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py rename to neutron/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py index 698a50dc6f..9c5cdc9282 100644 --- a/quantum/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py +++ b/neutron/db/migration/alembic_migrations/versions/1341ed32cc1e_nvp_netbinding_update.py @@ -30,14 +30,14 @@ down_revision = '4692d074d587' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2' + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py b/neutron/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py similarity index 91% rename from quantum/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py rename to neutron/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py index 0cda7b9c83..560861c289 100644 --- a/quantum/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py +++ b/neutron/db/migration/alembic_migrations/versions/176a85fc7d79_add_portbindings_db.py @@ -30,14 +30,14 @@ down_revision = 'grizzly' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2', - 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2', + 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', + 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2', ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/1b693c095aa3_quota_ext_db_grizzly.py b/neutron/db/migration/alembic_migrations/versions/1b693c095aa3_quota_ext_db_grizzly.py similarity index 95% rename from quantum/db/migration/alembic_migrations/versions/1b693c095aa3_quota_ext_db_grizzly.py rename to neutron/db/migration/alembic_migrations/versions/1b693c095aa3_quota_ext_db_grizzly.py index 209b546d73..eb33b0c861 100644 --- a/quantum/db/migration/alembic_migrations/versions/1b693c095aa3_quota_ext_db_grizzly.py +++ b/neutron/db/migration/alembic_migrations/versions/1b693c095aa3_quota_ext_db_grizzly.py @@ -30,13 +30,13 @@ down_revision = '2a6d0b51f4bb' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nec.nec_plugin.NECPluginV2' + 'neutron.plugins.nec.nec_plugin.NECPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/1c33fa3cd1a1_extra_route_config.py b/neutron/db/migration/alembic_migrations/versions/1c33fa3cd1a1_extra_route_config.py similarity index 85% rename from quantum/db/migration/alembic_migrations/versions/1c33fa3cd1a1_extra_route_config.py rename to neutron/db/migration/alembic_migrations/versions/1c33fa3cd1a1_extra_route_config.py index 07fb63c968..f607fac35b 100644 --- a/quantum/db/migration/alembic_migrations/versions/1c33fa3cd1a1_extra_route_config.py +++ b/neutron/db/migration/alembic_migrations/versions/1c33fa3cd1a1_extra_route_config.py @@ -30,17 +30,17 @@ down_revision = '45680af419f9' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2', - 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2', - 'quantum.plugins.nec.nec_plugin.NECPluginV2', - 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2', - 'quantum.plugins.metaplugin.meta_quantum_plugin.MetaPluginV2' + 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', + 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2', + 'neutron.plugins.nec.nec_plugin.NECPluginV2', + 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2', + 'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py b/neutron/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py similarity index 95% rename from quantum/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py rename to neutron/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py index 6a450f55c5..d38bae31af 100644 --- a/quantum/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py +++ b/neutron/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py @@ -30,13 +30,13 @@ down_revision = '3cb5d900c5de' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2' + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py b/neutron/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py similarity index 97% rename from quantum/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py rename to neutron/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py index f432c46410..bceac0ed7a 100644 --- a/quantum/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py +++ b/neutron/db/migration/alembic_migrations/versions/2a6d0b51f4bb_cisco_plugin_cleanup.py @@ -30,13 +30,13 @@ down_revision = '1d76643bcec4' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.cisco.network_plugin.PluginV2' + 'neutron.plugins.cisco.network_plugin.PluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/2c4af419145b_l3_support.py b/neutron/db/migration/alembic_migrations/versions/2c4af419145b_l3_support.py similarity index 79% rename from quantum/db/migration/alembic_migrations/versions/2c4af419145b_l3_support.py rename to neutron/db/migration/alembic_migrations/versions/2c4af419145b_l3_support.py index 8f5862e98e..63a46112ec 100644 --- a/quantum/db/migration/alembic_migrations/versions/2c4af419145b_l3_support.py +++ b/neutron/db/migration/alembic_migrations/versions/2c4af419145b_l3_support.py @@ -30,14 +30,14 @@ down_revision = 'folsom' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.bigswitch.plugin.QuantumRestProxyV2', - 'quantum.plugins.hyperv.hyperv_quantum_plugin.HyperVQuantumPlugin', - 'quantum.plugins.midonet.plugin.MidonetPluginV2', - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2' + 'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2', + 'neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin', + 'neutron.plugins.midonet.plugin.MidonetPluginV2', + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' ] -from quantum.db import migration -from quantum.db.migration.alembic_migrations import common_ext_ops +from neutron.db import migration +from neutron.db.migration.alembic_migrations import common_ext_ops def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py b/neutron/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py similarity index 93% rename from quantum/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py rename to neutron/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py index 608412c45f..04f7012046 100644 --- a/quantum/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py +++ b/neutron/db/migration/alembic_migrations/versions/32b517556ec9_remove_tunnelip_mode.py @@ -30,14 +30,14 @@ down_revision = '176a85fc7d79' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2' + 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/363468ac592c_nvp_network_gw.py b/neutron/db/migration/alembic_migrations/versions/363468ac592c_nvp_network_gw.py similarity index 97% rename from quantum/db/migration/alembic_migrations/versions/363468ac592c_nvp_network_gw.py rename to neutron/db/migration/alembic_migrations/versions/363468ac592c_nvp_network_gw.py index f369c1ab80..e011342ba4 100644 --- a/quantum/db/migration/alembic_migrations/versions/363468ac592c_nvp_network_gw.py +++ b/neutron/db/migration/alembic_migrations/versions/363468ac592c_nvp_network_gw.py @@ -30,14 +30,14 @@ down_revision = '1c33fa3cd1a1' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nicira.QuantumPluginV2.NvpPluginV2' + 'neutron.plugins.nicira.NeutronPluginV2.NvpPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py b/neutron/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py similarity index 80% rename from quantum/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py rename to neutron/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py index 3ca898077a..c07fc48249 100644 --- a/quantum/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py +++ b/neutron/db/migration/alembic_migrations/versions/38335592a0dc_nvp_portmap.py @@ -30,13 +30,13 @@ down_revision = '49332180ca96' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2' + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): @@ -44,16 +44,16 @@ def upgrade(active_plugin=None, options=None): return op.create_table( - 'quantum_nvp_port_mapping', - sa.Column('quantum_id', sa.String(length=36), nullable=False), + 'neutron_nvp_port_mapping', + sa.Column('neutron_id', sa.String(length=36), nullable=False), sa.Column('nvp_id', sa.String(length=36), nullable=True), - sa.ForeignKeyConstraint(['quantum_id'], ['ports.id'], + sa.ForeignKeyConstraint(['neutron_id'], ['ports.id'], ondelete='CASCADE'), - sa.PrimaryKeyConstraint('quantum_id')) + sa.PrimaryKeyConstraint('neutron_id')) def downgrade(active_plugin=None, options=None): if not migration.should_run(active_plugin, migration_for_plugins): return - op.drop_table('quantum_nvp_port_mapping') + op.drop_table('neutron_nvp_port_mapping') diff --git a/quantum/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py b/neutron/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py similarity index 96% rename from quantum/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py rename to neutron/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py index d8109183b4..f1f0dd9da6 100644 --- a/quantum/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py +++ b/neutron/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py @@ -30,14 +30,14 @@ down_revision = '511471cc46b' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nec.nec_plugin.NECPluginV2' + 'neutron.plugins.nec.nec_plugin.NECPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py b/neutron/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py similarity index 95% rename from quantum/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py rename to neutron/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py index 744761d0b0..b478828822 100644 --- a/quantum/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py +++ b/neutron/db/migration/alembic_migrations/versions/3cabb850f4a5_table_to_track_port_.py @@ -30,14 +30,14 @@ down_revision = '5918cbddab04' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.bigswitch.plugin.QuantumRestProxyV2' + 'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/3cb5d900c5de_security_groups.py b/neutron/db/migration/alembic_migrations/versions/3cb5d900c5de_security_groups.py similarity index 91% rename from quantum/db/migration/alembic_migrations/versions/3cb5d900c5de_security_groups.py rename to neutron/db/migration/alembic_migrations/versions/3cb5d900c5de_security_groups.py index 7a9266ca88..a5a65e1a73 100644 --- a/quantum/db/migration/alembic_migrations/versions/3cb5d900c5de_security_groups.py +++ b/neutron/db/migration/alembic_migrations/versions/3cb5d900c5de_security_groups.py @@ -30,17 +30,17 @@ down_revision = '48b6f43f7471' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2', - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2', - 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2', - 'quantum.plugins.nec.nec_plugin.NECPluginV2', - 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2', + 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2', + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2', + 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', + 'neutron.plugins.nec.nec_plugin.NECPluginV2', + 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2', ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py b/neutron/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py similarity index 94% rename from quantum/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py rename to neutron/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py index 705a5f3e2f..aa55701239 100644 --- a/quantum/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py +++ b/neutron/db/migration/alembic_migrations/versions/3cbf70257c28_nvp_mac_learning.py @@ -30,14 +30,14 @@ down_revision = '5ac71e65402c' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2' + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/45680af419f9_nvp_qos.py b/neutron/db/migration/alembic_migrations/versions/45680af419f9_nvp_qos.py similarity index 97% rename from quantum/db/migration/alembic_migrations/versions/45680af419f9_nvp_qos.py rename to neutron/db/migration/alembic_migrations/versions/45680af419f9_nvp_qos.py index f18f989963..b30ec94f5f 100644 --- a/quantum/db/migration/alembic_migrations/versions/45680af419f9_nvp_qos.py +++ b/neutron/db/migration/alembic_migrations/versions/45680af419f9_nvp_qos.py @@ -30,14 +30,14 @@ down_revision = '54c2c487e913' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2' + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py b/neutron/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py similarity index 88% rename from quantum/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py rename to neutron/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py index 0685872a40..c90aec2ae4 100644 --- a/quantum/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py +++ b/neutron/db/migration/alembic_migrations/versions/4692d074d587_agent_scheduler.py @@ -30,18 +30,18 @@ down_revision = '3b54bf9e29f7' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2', - 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2', - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2', - 'quantum.plugins.nec.nec_plugin.NECPluginV2', - 'quantum.plugins.brocade.QuantumPlugin.BrocadePluginV2', + 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', + 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2', + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2', + 'neutron.plugins.nec.nec_plugin.NECPluginV2', + 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2', ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/48b6f43f7471_service_type.py b/neutron/db/migration/alembic_migrations/versions/48b6f43f7471_service_type.py similarity index 98% rename from quantum/db/migration/alembic_migrations/versions/48b6f43f7471_service_type.py rename to neutron/db/migration/alembic_migrations/versions/48b6f43f7471_service_type.py index ccd363c0dd..4c46a3554f 100644 --- a/quantum/db/migration/alembic_migrations/versions/48b6f43f7471_service_type.py +++ b/neutron/db/migration/alembic_migrations/versions/48b6f43f7471_service_type.py @@ -36,7 +36,7 @@ migration_for_plugins = [ from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py b/neutron/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py similarity index 94% rename from quantum/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py rename to neutron/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py index 318ff2f3fa..9c0df3491d 100644 --- a/quantum/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py +++ b/neutron/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py @@ -30,13 +30,13 @@ down_revision = '1149d7de0cfa' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2' + 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py b/neutron/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py similarity index 87% rename from quantum/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py rename to neutron/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py index 1968690601..fa75e21fc2 100644 --- a/quantum/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py +++ b/neutron/db/migration/alembic_migrations/versions/511471cc46b_agent_ext_model_supp.py @@ -30,18 +30,18 @@ down_revision = '363468ac592c' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2', - 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2', - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2', - 'quantum.plugins.nec.nec_plugin.NECPluginV2', - 'quantum.plugins.brocade.QuantumPlugin.BrocadePluginV2', + 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', + 'neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2', + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2', + 'neutron.plugins.nec.nec_plugin.NECPluginV2', + 'neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2', ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/54c2c487e913_lbaas.py b/neutron/db/migration/alembic_migrations/versions/54c2c487e913_lbaas.py similarity index 99% rename from quantum/db/migration/alembic_migrations/versions/54c2c487e913_lbaas.py rename to neutron/db/migration/alembic_migrations/versions/54c2c487e913_lbaas.py index 7e18e2d286..d9fff767e6 100644 --- a/quantum/db/migration/alembic_migrations/versions/54c2c487e913_lbaas.py +++ b/neutron/db/migration/alembic_migrations/versions/54c2c487e913_lbaas.py @@ -35,7 +35,7 @@ migration_for_plugins = [] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/5918cbddab04_add_tables_for_route.py b/neutron/db/migration/alembic_migrations/versions/5918cbddab04_add_tables_for_route.py similarity index 96% rename from quantum/db/migration/alembic_migrations/versions/5918cbddab04_add_tables_for_route.py rename to neutron/db/migration/alembic_migrations/versions/5918cbddab04_add_tables_for_route.py index b35e1b5485..e6a325354c 100644 --- a/quantum/db/migration/alembic_migrations/versions/5918cbddab04_add_tables_for_route.py +++ b/neutron/db/migration/alembic_migrations/versions/5918cbddab04_add_tables_for_route.py @@ -30,14 +30,14 @@ down_revision = '3cbf70257c28' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.bigswitch.plugin.QuantumRestProxyV2' + 'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py b/neutron/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py similarity index 95% rename from quantum/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py rename to neutron/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py index c0668367c2..cedc215f5c 100644 --- a/quantum/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py +++ b/neutron/db/migration/alembic_migrations/versions/5a875d0e5c_ryu.py @@ -35,13 +35,13 @@ down_revision = '2c4af419145b' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2' + 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/quantum/db/migration/alembic_migrations/versions/5ac71e65402c_ml2_initial.py b/neutron/db/migration/alembic_migrations/versions/5ac71e65402c_ml2_initial.py similarity index 97% rename from quantum/db/migration/alembic_migrations/versions/5ac71e65402c_ml2_initial.py rename to neutron/db/migration/alembic_migrations/versions/5ac71e65402c_ml2_initial.py index f0547a0e39..d3e97d6424 100644 --- a/quantum/db/migration/alembic_migrations/versions/5ac71e65402c_ml2_initial.py +++ b/neutron/db/migration/alembic_migrations/versions/5ac71e65402c_ml2_initial.py @@ -30,14 +30,14 @@ down_revision = '128e042a2b68' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ - 'quantum.plugins.ml2.plugin.Ml2Plugin' + 'neutron.plugins.ml2.plugin.Ml2Plugin' ] from alembic import op import sqlalchemy as sa -from quantum.db import migration +from neutron.db import migration def upgrade(active_plugin=None, options=None): diff --git a/neutron/db/migration/alembic_migrations/versions/README b/neutron/db/migration/alembic_migrations/versions/README new file mode 100644 index 0000000000..1067a3876b --- /dev/null +++ b/neutron/db/migration/alembic_migrations/versions/README @@ -0,0 +1,5 @@ +This directory contains the migration scripts for the Neutron project. Please +see the README in neutron/db/migration on how to use and generate new +migrations. + + diff --git a/quantum/db/migration/alembic_migrations/versions/b7a8863760e_rm_cisco_vlan_bindin.py b/neutron/db/migration/alembic_migrations/versions/b7a8863760e_rm_cisco_vlan_bindin.py similarity index 100% rename from quantum/db/migration/alembic_migrations/versions/b7a8863760e_rm_cisco_vlan_bindin.py rename to neutron/db/migration/alembic_migrations/versions/b7a8863760e_rm_cisco_vlan_bindin.py diff --git a/quantum/db/migration/alembic_migrations/versions/folsom_initial.py b/neutron/db/migration/alembic_migrations/versions/folsom_initial.py similarity index 96% rename from quantum/db/migration/alembic_migrations/versions/folsom_initial.py rename to neutron/db/migration/alembic_migrations/versions/folsom_initial.py index c95d7b4434..cd452066e4 100644 --- a/quantum/db/migration/alembic_migrations/versions/folsom_initial.py +++ b/neutron/db/migration/alembic_migrations/versions/folsom_initial.py @@ -25,15 +25,15 @@ Create Date: 2012-12-03 09:14:50.579765 """ PLUGINS = { - 'bigswitch': 'quantum.plugins.bigswitch.plugin.QuantumRestProxyV2', - 'cisco': 'quantum.plugins.cisco.network_plugin.PluginV2', - 'lbr': 'quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2', - 'meta': 'quantum.plugins.metaplugin.meta_quantum_plugin.MetaPluginV2', - 'ml2': 'quantum.plugins.ml2.ml2_plugin.Ml2Plugin', - 'nec': 'quantum.plugins.nec.nec_plugin.NECPluginV2', - 'nvp': 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2', - 'ovs': 'quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2', - 'ryu': 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2', + 'bigswitch': 'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2', + 'cisco': 'neutron.plugins.cisco.network_plugin.PluginV2', + 'lbr': 'neutron.plugins.linuxbridge.lb_neutronplugin.LinuxBridgePluginV2', + 'meta': 'neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2', + 'ml2': 'neutron.plugins.ml2.ml2_plugin.Ml2Plugin', + 'nec': 'neutron.plugins.nec.nec_plugin.NECPluginV2', + 'nvp': 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2', + 'ovs': 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2', + 'ryu': 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2', } L3_CAPABLE = [ @@ -60,7 +60,7 @@ down_revision = None from alembic import op import sqlalchemy as sa -from quantum.db.migration.alembic_migrations import common_ext_ops +from neutron.db.migration.alembic_migrations import common_ext_ops # NOTE: This is a special migration that creates a Folsom compatible database. diff --git a/quantum/db/migration/alembic_migrations/versions/grizzly_release.py b/neutron/db/migration/alembic_migrations/versions/grizzly_release.py similarity index 100% rename from quantum/db/migration/alembic_migrations/versions/grizzly_release.py rename to neutron/db/migration/alembic_migrations/versions/grizzly_release.py diff --git a/quantum/db/migration/cli.py b/neutron/db/migration/cli.py similarity index 92% rename from quantum/db/migration/cli.py rename to neutron/db/migration/cli.py index 21af8422b0..7219038ae0 100644 --- a/quantum/db/migration/cli.py +++ b/neutron/db/migration/cli.py @@ -23,17 +23,19 @@ from alembic import config as alembic_config from alembic import util as alembic_util from oslo.config import cfg +from neutron.common import legacy + _core_opts = [ cfg.StrOpt('core_plugin', default='', - help=_('Quantum plugin provider module')), + help=_('Neutron plugin provider module')), ] _quota_opts = [ cfg.StrOpt('quota_driver', default='', - help=_('Quantum quota driver class')), + help=_('Neutron quota driver class')), ] _db_opts = [ @@ -128,9 +130,10 @@ def main(): os.path.join(os.path.dirname(__file__), 'alembic.ini') ) config.set_main_option('script_location', - 'quantum.db.migration:alembic_migrations') - # attach the Quantum conf to the Alembic conf - config.quantum_config = CONF + 'neutron.db.migration:alembic_migrations') + # attach the Neutron conf to the Alembic conf + config.neutron_config = CONF CONF() + legacy.modernize_quantum_config(CONF) CONF.command.func(config, CONF.command.name) diff --git a/quantum/db/model_base.py b/neutron/db/model_base.py similarity index 93% rename from quantum/db/model_base.py rename to neutron/db/model_base.py index 8fe0962090..3caa4ff612 100644 --- a/quantum/db/model_base.py +++ b/neutron/db/model_base.py @@ -17,8 +17,8 @@ from sqlalchemy.ext import declarative from sqlalchemy import orm -class QuantumBase(object): - """Base class for Quantum Models.""" +class NeutronBase(object): + """Base class for Neutron Models.""" __table_args__ = {'mysql_engine': 'InnoDB'} @@ -64,7 +64,7 @@ class QuantumBase(object): id(self), ', '.join(items)) -class QuantumBaseV2(QuantumBase): +class NeutronBaseV2(NeutronBase): @declarative.declared_attr def __tablename__(cls): @@ -72,4 +72,4 @@ class QuantumBaseV2(QuantumBase): return cls.__name__.lower() + 's' -BASEV2 = declarative.declarative_base(cls=QuantumBaseV2) +BASEV2 = declarative.declarative_base(cls=NeutronBaseV2) diff --git a/quantum/db/models_v2.py b/neutron/db/models_v2.py similarity index 93% rename from quantum/db/models_v2.py rename to neutron/db/models_v2.py index f7e1aa1f46..2db0e63986 100644 --- a/quantum/db/models_v2.py +++ b/neutron/db/models_v2.py @@ -18,8 +18,8 @@ import sqlalchemy as sa from sqlalchemy import orm -from quantum.db import model_base -from quantum.openstack.common import uuidutils +from neutron.db import model_base +from neutron.openstack.common import uuidutils class HasTenant(object): @@ -38,7 +38,7 @@ class HasId(object): class IPAvailabilityRange(model_base.BASEV2): - """Internal representation of available IPs for Quantum subnets. + """Internal representation of available IPs for Neutron subnets. Allocation - first entry from the range will be allocated. If the first entry is equal to the last entry then this row @@ -62,7 +62,7 @@ class IPAvailabilityRange(model_base.BASEV2): class IPAllocationPool(model_base.BASEV2, HasId): - """Representation of an allocation pool in a Quantum subnet.""" + """Representation of an allocation pool in a Neutron subnet.""" subnet_id = sa.Column(sa.String(36), sa.ForeignKey('subnets.id', ondelete="CASCADE"), @@ -79,7 +79,7 @@ class IPAllocationPool(model_base.BASEV2, HasId): class IPAllocation(model_base.BASEV2): - """Internal representation of allocated IP addresses in a Quantum subnet. + """Internal representation of allocated IP addresses in a Neutron subnet. """ port_id = sa.Column(sa.String(36), sa.ForeignKey('ports.id', @@ -111,7 +111,7 @@ class SubnetRoute(model_base.BASEV2, Route): class Port(model_base.BASEV2, HasId, HasTenant): - """Represents a port on a quantum v2 network.""" + """Represents a port on a Neutron v2 network.""" name = sa.Column(sa.String(255)) network_id = sa.Column(sa.String(36), sa.ForeignKey("networks.id"), @@ -135,7 +135,7 @@ class DNSNameServer(model_base.BASEV2): class Subnet(model_base.BASEV2, HasId, HasTenant): - """Represents a quantum subnet. + """Represents a neutron subnet. When a subnet is created the first and last entries will be created. These are used for the IP allocation. @@ -161,7 +161,7 @@ class Subnet(model_base.BASEV2, HasId, HasTenant): class Network(model_base.BASEV2, HasId, HasTenant): - """Represents a v2 quantum network.""" + """Represents a v2 neutron network.""" name = sa.Column(sa.String(255)) ports = orm.relationship(Port, backref='networks') diff --git a/quantum/db/portbindings_db.py b/neutron/db/portbindings_db.py similarity index 90% rename from quantum/db/portbindings_db.py rename to neutron/db/portbindings_db.py index 7bf01bdc3a..4a2c5302bf 100644 --- a/quantum/db/portbindings_db.py +++ b/neutron/db/portbindings_db.py @@ -19,12 +19,12 @@ import sqlalchemy as sa from sqlalchemy import orm -from quantum.api.v2 import attributes -from quantum.db import db_base_plugin_v2 -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.extensions import portbindings -from quantum.openstack.common import log as logging +from neutron.api.v2 import attributes +from neutron.db import db_base_plugin_v2 +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.extensions import portbindings +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -61,7 +61,7 @@ class PortBindingMixin(object): query = query.filter(PortBindingPort.host.in_(values)) return query - db_base_plugin_v2.QuantumDbPluginV2.register_model_query_hook( + db_base_plugin_v2.NeutronDbPluginV2.register_model_query_hook( models_v2.Port, "portbindings_port", _port_model_hook, @@ -107,5 +107,5 @@ def _extend_port_dict_binding(plugin, port_res, port_db): plugin, port_res, host) # Register dict extend functions for ports -db_base_plugin_v2.QuantumDbPluginV2.register_dict_extend_funcs( +db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs( attributes.PORTS, [_extend_port_dict_binding]) diff --git a/quantum/db/portsecurity_db.py b/neutron/db/portsecurity_db.py similarity index 97% rename from quantum/db/portsecurity_db.py rename to neutron/db/portsecurity_db.py index bddb0564b6..0b16167505 100644 --- a/quantum/db/portsecurity_db.py +++ b/neutron/db/portsecurity_db.py @@ -19,9 +19,9 @@ import sqlalchemy as sa from sqlalchemy.orm import exc -from quantum.db import model_base -from quantum.extensions import portsecurity as psec -from quantum.openstack.common import log as logging +from neutron.db import model_base +from neutron.extensions import portsecurity as psec +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/db/quota_db.py b/neutron/db/quota_db.py similarity index 98% rename from quantum/db/quota_db.py rename to neutron/db/quota_db.py index eef09f2941..c74dac2be7 100644 --- a/quantum/db/quota_db.py +++ b/neutron/db/quota_db.py @@ -17,9 +17,9 @@ import sqlalchemy as sa -from quantum.common import exceptions -from quantum.db import model_base -from quantum.db import models_v2 +from neutron.common import exceptions +from neutron.db import model_base +from neutron.db import models_v2 class Quota(model_base.BASEV2, models_v2.HasId): diff --git a/quantum/db/routedserviceinsertion_db.py b/neutron/db/routedserviceinsertion_db.py similarity index 94% rename from quantum/db/routedserviceinsertion_db.py rename to neutron/db/routedserviceinsertion_db.py index d1ff575f30..e8c7af1447 100644 --- a/quantum/db/routedserviceinsertion_db.py +++ b/neutron/db/routedserviceinsertion_db.py @@ -19,9 +19,9 @@ import sqlalchemy as sa from sqlalchemy import event -from quantum.common import exceptions as qexception -from quantum.db import model_base -from quantum.extensions import routedserviceinsertion as rsi +from neutron.common import exceptions as qexception +from neutron.db import model_base +from neutron.extensions import routedserviceinsertion as rsi class ServiceRouterBinding(model_base.BASEV2): @@ -34,7 +34,7 @@ class ServiceRouterBinding(model_base.BASEV2): nullable=False) -class AttributeException(qexception.QuantumException): +class AttributeException(qexception.NeutronException): message = _("Resource type '%(resource_type)s' is longer " "than %(maxlen)d characters") diff --git a/quantum/db/routerservicetype_db.py b/neutron/db/routerservicetype_db.py similarity index 96% rename from quantum/db/routerservicetype_db.py rename to neutron/db/routerservicetype_db.py index a7eb41ad65..3866ca2664 100644 --- a/quantum/db/routerservicetype_db.py +++ b/neutron/db/routerservicetype_db.py @@ -18,8 +18,8 @@ import sqlalchemy as sa -from quantum.db import model_base -from quantum.extensions import routerservicetype as rst +from neutron.db import model_base +from neutron.extensions import routerservicetype as rst class RouterServiceTypeBinding(model_base.BASEV2): diff --git a/quantum/db/securitygroups_db.py b/neutron/db/securitygroups_db.py similarity index 97% rename from quantum/db/securitygroups_db.py rename to neutron/db/securitygroups_db.py index fb01c9af03..4201d42a38 100644 --- a/quantum/db/securitygroups_db.py +++ b/neutron/db/securitygroups_db.py @@ -21,23 +21,23 @@ from sqlalchemy import orm from sqlalchemy.orm import exc from sqlalchemy.orm import scoped_session -from quantum.api.v2 import attributes as attr -from quantum.db import db_base_plugin_v2 -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import uuidutils +from neutron.api.v2 import attributes as attr +from neutron.db import db_base_plugin_v2 +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import uuidutils class SecurityGroup(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents a v2 quantum security group.""" + """Represents a v2 neutron security group.""" name = sa.Column(sa.String(255)) description = sa.Column(sa.String(255)) class SecurityGroupPortBinding(model_base.BASEV2): - """Represents binding between quantum ports and security profiles.""" + """Represents binding between neutron ports and security profiles.""" port_id = sa.Column(sa.String(36), sa.ForeignKey("ports.id", @@ -57,7 +57,7 @@ class SecurityGroupPortBinding(model_base.BASEV2): class SecurityGroupRule(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): - """Represents a v2 quantum security group rule.""" + """Represents a v2 neutron security group rule.""" security_group_id = sa.Column(sa.String(36), sa.ForeignKey("securitygroups.id", @@ -419,7 +419,7 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase): return port_res # Register dict extend functions for ports - db_base_plugin_v2.QuantumDbPluginV2.register_dict_extend_funcs( + db_base_plugin_v2.NeutronDbPluginV2.register_dict_extend_funcs( attr.PORTS, [_extend_port_dict_security_group]) def _process_port_create_security_group(self, context, port, diff --git a/quantum/db/securitygroups_rpc_base.py b/neutron/db/securitygroups_rpc_base.py similarity index 97% rename from quantum/db/securitygroups_rpc_base.py rename to neutron/db/securitygroups_rpc_base.py index 3d9afe992a..5fb2174077 100644 --- a/quantum/db/securitygroups_rpc_base.py +++ b/neutron/db/securitygroups_rpc_base.py @@ -17,12 +17,12 @@ import netaddr -from quantum.common import constants as q_const -from quantum.common import utils -from quantum.db import models_v2 -from quantum.db import securitygroups_db as sg_db -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import log as logging +from neutron.common import constants as q_const +from neutron.common import utils +from neutron.db import models_v2 +from neutron.db import securitygroups_db as sg_db +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/db/servicetype_db.py b/neutron/db/servicetype_db.py similarity index 96% rename from quantum/db/servicetype_db.py rename to neutron/db/servicetype_db.py index db9417eb8a..c903cc819a 100644 --- a/quantum/db/servicetype_db.py +++ b/neutron/db/servicetype_db.py @@ -23,12 +23,12 @@ from sqlalchemy import orm from sqlalchemy.orm import exc as orm_exc from sqlalchemy.sql import expression as expr -from quantum.common import exceptions as q_exc -from quantum import context -from quantum.db import api as db -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.openstack.common import log as logging +from neutron.common import exceptions as q_exc +from neutron import context +from neutron.db import api as db +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -69,7 +69,7 @@ def parse_service_definition_opt(): opt_value=svc_def_opt) -class NoDefaultServiceDefinition(q_exc.QuantumException): +class NoDefaultServiceDefinition(q_exc.NeutronException): message = _("No default service definition in configuration file. " "Please add service definitions using the service_definition " "variable in the [default_servicetype] section") @@ -115,7 +115,7 @@ class ServiceType(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): class ServiceTypeManager(object): - """Manage service type objects in Quantum database.""" + """Manage service type objects in Neutron database.""" _instance = None @@ -147,7 +147,7 @@ class ServiceTypeManager(object): def_svc_type_db['id'], def_service_type, svc_type_db=def_svc_type_db) - LOG.debug(_("Default service type record updated in Quantum database. " + LOG.debug(_("Default service type record updated in Neutron database. " "identifier is '%s'"), def_svc_type_db['id']) def _initialize_db(self): diff --git a/quantum/db/sqlalchemyutils.py b/neutron/db/sqlalchemyutils.py similarity index 97% rename from quantum/db/sqlalchemyutils.py rename to neutron/db/sqlalchemyutils.py index fffc6ceb58..c9a41c6225 100644 --- a/quantum/db/sqlalchemyutils.py +++ b/neutron/db/sqlalchemyutils.py @@ -18,8 +18,8 @@ import sqlalchemy from sqlalchemy.orm.properties import RelationshipProperty -from quantum.common import exceptions as q_exc -from quantum.openstack.common import log as logging +from neutron.common import exceptions as q_exc +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/debug/README b/neutron/debug/README similarity index 73% rename from quantum/debug/README rename to neutron/debug/README index 00d05fd157..181cb4fab2 100644 --- a/quantum/debug/README +++ b/neutron/debug/README @@ -1,14 +1,14 @@ -Debug Helper Script for Quantum +Debug Helper Script for Neutron - Configure -export QUANTUM_TEST_CONFIG_FILE=/etc/quantum/debug.ini +export NEUTRON_TEST_CONFIG_FILE=/etc/neutron/debug.ini or -export QUANTUM_TEST_CONFIG_FILE=/etc/quantum/l3_agent.ini +export NEUTRON_TEST_CONFIG_FILE=/etc/neutron/l3_agent.ini you can also specify config file by --config-file option - Usage -quantum-debug commands +neutron-debug commands probe-create Create probe port - create port and interface, then plug it in. @@ -16,8 +16,8 @@ probe-create The port id is probe id. We can have multiple probe probes in a network, in order to check connectivity between ports. - quantum-debug probe-exec probe_id_1 'nc -l 192.168.100.3 22' - quantum-debug probe-exec probe_id_2 'nc -vz 192.168.100.4 22' + neutron-debug probe-exec probe_id_1 'nc -l 192.168.100.3 22' + neutron-debug probe-exec probe_id_2 'nc -vz 192.168.100.4 22' Note: You should use a user and a tenant who has permission to modify network and subnet if you want to probe. For example, you need to be admin user if you @@ -34,5 +34,5 @@ ping-all --id --timeout 1 (optional) ping-all is all-in-one command to ping all fixed ip's in all network or a specified network. In the command probe is automatically created if needed. -quantum-debug extends the shell of quantumclient, so you can use all the commands of quantum +neutron-debug extends the shell of neutronclient, so you can use all the commands of neutron diff --git a/quantum/debug/__init__.py b/neutron/debug/__init__.py similarity index 100% rename from quantum/debug/__init__.py rename to neutron/debug/__init__.py diff --git a/quantum/debug/commands.py b/neutron/debug/commands.py similarity index 94% rename from quantum/debug/commands.py rename to neutron/debug/commands.py index 82a4bf9c22..d2da9e8971 100644 --- a/quantum/debug/commands.py +++ b/neutron/debug/commands.py @@ -16,14 +16,14 @@ # under the License. from cliff import lister -from quantumclient.common import utils -from quantumclient.quantum.v2_0.port import _format_fixed_ips -from quantumclient.quantum.v2_0 import QuantumCommand +from neutronclient.common import utils +from neutronclient.neutron.v2_0 import NeutronCommand +from neutronclient.neutron.v2_0.port import _format_fixed_ips -from quantum.openstack.common import log as logging +from neutron.openstack.common import log as logging -class ProbeCommand(QuantumCommand): +class ProbeCommand(NeutronCommand): log = logging.getLogger(__name__ + '.ProbeCommand') def get_debug_agent(self): @@ -77,7 +77,7 @@ class DeleteProbe(ProbeCommand): self.app.stdout.write(_('Probe %s deleted') % parsed_args.id + '\n') -class ListProbe(QuantumCommand, lister.Lister): +class ListProbe(NeutronCommand, lister.Lister): """List probes.""" log = logging.getLogger(__name__ + '.ListProbe') diff --git a/quantum/debug/debug_agent.py b/neutron/debug/debug_agent.py similarity index 96% rename from quantum/debug/debug_agent.py rename to neutron/debug/debug_agent.py index ba32f71944..96706fdb7d 100644 --- a/quantum/debug/debug_agent.py +++ b/neutron/debug/debug_agent.py @@ -21,11 +21,11 @@ import socket import netaddr from oslo.config import cfg -from quantum.agent.common import config -from quantum.agent.dhcp_agent import DictModel -from quantum.agent.linux import ip_lib -from quantum.agent.linux import utils -from quantum.openstack.common import log as logging +from neutron.agent.common import config +from neutron.agent.dhcp_agent import DictModel +from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -35,7 +35,7 @@ DEVICE_OWNER_NETWORK_PROBE = 'network:probe' DEVICE_OWNER_COMPUTE_PROBE = 'compute:probe' -class QuantumDebugAgent(): +class NeutronDebugAgent(): OPTS = [ # Needed for drivers diff --git a/quantum/debug/shell.py b/neutron/debug/shell.py similarity index 59% rename from quantum/debug/shell.py rename to neutron/debug/shell.py index ed7f09fa06..3b97fb3eb9 100644 --- a/quantum/debug/shell.py +++ b/neutron/debug/shell.py @@ -19,63 +19,68 @@ import sys from oslo.config import cfg -from quantum.agent.common import config -from quantum.agent.linux import interface -from quantum.debug.debug_agent import QuantumDebugAgent -from quantum.openstack.common import importutils -from quantumclient.common import exceptions as exc -from quantumclient.common import utils -from quantumclient.shell import env, QuantumShell, QUANTUM_API_VERSION +from neutron.agent.common import config +from neutron.agent.linux import interface +from neutron.common import legacy +from neutron.debug.debug_agent import NeutronDebugAgent +from neutron.openstack.common import importutils +from neutronclient.common import exceptions as exc +from neutronclient.common import utils +from neutronclient.shell import env, NeutronShell, NEUTRON_API_VERSION COMMAND_V2 = { 'probe-create': utils.import_class( - 'quantum.debug.commands.CreateProbe'), + 'neutron.debug.commands.CreateProbe'), 'probe-delete': utils.import_class( - 'quantum.debug.commands.DeleteProbe'), + 'neutron.debug.commands.DeleteProbe'), 'probe-list': utils.import_class( - 'quantum.debug.commands.ListProbe'), + 'neutron.debug.commands.ListProbe'), 'probe-clear': utils.import_class( - 'quantum.debug.commands.ClearProbe'), + 'neutron.debug.commands.ClearProbe'), 'probe-exec': utils.import_class( - 'quantum.debug.commands.ExecProbe'), + 'neutron.debug.commands.ExecProbe'), 'ping-all': utils.import_class( - 'quantum.debug.commands.PingAll'), + 'neutron.debug.commands.PingAll'), #TODO(nati) ping, netcat , nmap, bench } COMMANDS = {'2.0': COMMAND_V2} -class QuantumDebugShell(QuantumShell): +class NeutronDebugShell(NeutronShell): def __init__(self, api_version): - super(QuantumDebugShell, self).__init__(api_version) + super(NeutronDebugShell, self).__init__(api_version) for k, v in COMMANDS[api_version].items(): self.command_manager.add_command(k, v) def build_option_parser(self, description, version): - parser = super(QuantumDebugShell, self).build_option_parser( + parser = super(NeutronDebugShell, self).build_option_parser( description, version) + default = ( + env('NEUTRON_TEST_CONFIG_FILE') or env('QUANTUM_TEST_CONFIG_FILE') + ) parser.add_argument( '--config-file', - default=env('QUANTUM_TEST_CONFIG_FILE'), + default=default, help=_('Config file for interface driver ' '(You may also use l3_agent.ini)')) return parser def initialize_app(self, argv): - super(QuantumDebugShell, self).initialize_app(argv) + super(NeutronDebugShell, self).initialize_app(argv) if not self.options.config_file: raise exc.CommandError( _("You must provide a config file for bridge -" - " either --config-file or env[QUANTUM_TEST_CONFIG_FILE]")) - client = self.client_manager.quantum + " either --config-file or env[NEUTRON_TEST_CONFIG_FILE]")) + client = self.client_manager.neutron cfg.CONF.register_opts(interface.OPTS) - cfg.CONF.register_opts(QuantumDebugAgent.OPTS) + cfg.CONF.register_opts(NeutronDebugAgent.OPTS) config.register_root_helper(cfg.CONF) cfg.CONF(['--config-file', self.options.config_file]) config.setup_logging(cfg.CONF) + legacy.modernize_quantum_config(cfg.CONF) driver = importutils.import_object(cfg.CONF.interface_driver, cfg.CONF) - self.debug_agent = QuantumDebugAgent(cfg.CONF, client, driver) + self.debug_agent = NeutronDebugAgent(cfg.CONF, client, driver) def main(argv=None): - return QuantumDebugShell(QUANTUM_API_VERSION).run(argv or sys.argv[1:]) + return NeutronDebugShell(NEUTRON_API_VERSION).run(argv or sys.argv[1:]) diff --git a/quantum/extensions/__init__.py b/neutron/extensions/__init__.py similarity index 100% rename from quantum/extensions/__init__.py rename to neutron/extensions/__init__.py diff --git a/quantum/extensions/agent.py b/neutron/extensions/agent.py similarity index 95% rename from quantum/extensions/agent.py rename to neutron/extensions/agent.py index 5bb93f94fe..35c843ad61 100644 --- a/quantum/extensions/agent.py +++ b/neutron/extensions/agent.py @@ -15,11 +15,11 @@ from abc import abstractmethod -from quantum.api import extensions -from quantum.api.v2 import attributes as attr -from quantum.api.v2 import base -from quantum.common import exceptions -from quantum import manager +from neutron.api import extensions +from neutron.api.v2 import attributes as attr +from neutron.api.v2 import base +from neutron.common import exceptions +from neutron import manager # Attribute Map @@ -99,7 +99,7 @@ class Agent(object): """Returns Ext Resources.""" my_plurals = [(key, key[:-1]) for key in RESOURCE_ATTRIBUTE_MAP.keys()] attr.PLURALS.update(dict(my_plurals)) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() params = RESOURCE_ATTRIBUTE_MAP.get(RESOURCE_NAME + 's') controller = base.create_resource(RESOURCE_NAME + 's', RESOURCE_NAME, diff --git a/quantum/extensions/agentscheduler.py b/neutron/extensions/agentscheduler.py similarity index 90% rename from quantum/extensions/agentscheduler.py rename to neutron/extensions/agentscheduler.py index 49c29b6558..f30156cc86 100644 --- a/quantum/extensions/agentscheduler.py +++ b/neutron/extensions/agentscheduler.py @@ -17,15 +17,15 @@ from abc import abstractmethod -from quantum.api import extensions -from quantum.api.v2 import base -from quantum.api.v2 import resource -from quantum.common import constants -from quantum.common import exceptions -from quantum.extensions import agent -from quantum import manager -from quantum import policy -from quantum import wsgi +from neutron.api import extensions +from neutron.api.v2 import base +from neutron.api.v2 import resource +from neutron.common import constants +from neutron.common import exceptions +from neutron.extensions import agent +from neutron import manager +from neutron import policy +from neutron import wsgi DHCP_NET = 'dhcp-network' DHCP_NETS = DHCP_NET + 's' @@ -39,7 +39,7 @@ L3_AGENTS = L3_AGENT + 's' class NetworkSchedulerController(wsgi.Controller): def index(self, request, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "get_%s" % DHCP_NETS, {}) @@ -47,7 +47,7 @@ class NetworkSchedulerController(wsgi.Controller): request.context, kwargs['agent_id']) def create(self, request, body, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "create_%s" % DHCP_NET, {}) @@ -55,7 +55,7 @@ class NetworkSchedulerController(wsgi.Controller): request.context, kwargs['agent_id'], body['network_id']) def delete(self, request, id, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "delete_%s" % DHCP_NET, {}) @@ -65,7 +65,7 @@ class NetworkSchedulerController(wsgi.Controller): class RouterSchedulerController(wsgi.Controller): def index(self, request, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "get_%s" % L3_ROUTERS, {}) @@ -73,7 +73,7 @@ class RouterSchedulerController(wsgi.Controller): request.context, kwargs['agent_id']) def create(self, request, body, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "create_%s" % L3_ROUTER, {}) @@ -83,7 +83,7 @@ class RouterSchedulerController(wsgi.Controller): body['router_id']) def delete(self, request, id, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "delete_%s" % L3_ROUTER, {}) @@ -93,7 +93,7 @@ class RouterSchedulerController(wsgi.Controller): class DhcpAgentsHostingNetworkController(wsgi.Controller): def index(self, request, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "get_%s" % DHCP_AGENTS, {}) @@ -103,7 +103,7 @@ class DhcpAgentsHostingNetworkController(wsgi.Controller): class L3AgentsHostingRouterController(wsgi.Controller): def index(self, request, **kwargs): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() policy.enforce(request.context, "get_%s" % L3_AGENTS, {}) diff --git a/quantum/extensions/extraroute.py b/neutron/extensions/extraroute.py similarity index 91% rename from quantum/extensions/extraroute.py rename to neutron/extensions/extraroute.py index 64588c9e60..fda040fd2b 100644 --- a/quantum/extensions/extraroute.py +++ b/neutron/extensions/extraroute.py @@ -16,8 +16,8 @@ # under the License. -from quantum.api.v2 import attributes as attr -from quantum.common import exceptions as qexception +from neutron.api.v2 import attributes as attr +from neutron.common import exceptions as qexception # Extra Routes Exceptions @@ -49,7 +49,7 @@ class Extraroute(): @classmethod def get_name(cls): - return "Quantum Extra Route" + return "Neutron Extra Route" @classmethod def get_alias(cls): @@ -61,7 +61,7 @@ class Extraroute(): @classmethod def get_namespace(cls): - return "http://docs.openstack.org/ext/quantum/extraroutes/api/v1.0" + return "http://docs.openstack.org/ext/neutron/extraroutes/api/v1.0" @classmethod def get_updated(cls): diff --git a/quantum/extensions/flavor.py b/neutron/extensions/flavor.py similarity index 93% rename from quantum/extensions/flavor.py rename to neutron/extensions/flavor.py index ca4666ae61..7d3d5e9efc 100644 --- a/quantum/extensions/flavor.py +++ b/neutron/extensions/flavor.py @@ -15,9 +15,9 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.api import extensions -from quantum.api.v2 import attributes -from quantum.openstack.common import log as logging +from neutron.api import extensions +from neutron.api.v2 import attributes +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/extensions/l3.py b/neutron/extensions/l3.py similarity index 95% rename from quantum/extensions/l3.py rename to neutron/extensions/l3.py index 2fc27c68bf..62e1aee6ca 100644 --- a/quantum/extensions/l3.py +++ b/neutron/extensions/l3.py @@ -22,12 +22,12 @@ from abc import abstractmethod from oslo.config import cfg -from quantum.api import extensions -from quantum.api.v2 import attributes as attr -from quantum.api.v2 import base -from quantum.common import exceptions as qexception -from quantum import manager -from quantum import quota +from neutron.api import extensions +from neutron.api.v2 import attributes as attr +from neutron.api.v2 import base +from neutron.common import exceptions as qexception +from neutron import manager +from neutron import quota # L3 Exceptions @@ -167,7 +167,7 @@ class L3(extensions.ExtensionDescriptor): @classmethod def get_name(cls): - return "Quantum L3 Router" + return "Neutron L3 Router" @classmethod def get_alias(cls): @@ -176,12 +176,12 @@ class L3(extensions.ExtensionDescriptor): @classmethod def get_description(cls): return ("Router abstraction for basic L3 forwarding" - " between L2 Quantum networks and access to external" + " between L2 Neutron networks and access to external" " networks via a NAT gateway.") @classmethod def get_namespace(cls): - return "http://docs.openstack.org/ext/quantum/router/api/v1.0" + return "http://docs.openstack.org/ext/neutron/router/api/v1.0" @classmethod def get_updated(cls): @@ -193,7 +193,7 @@ class L3(extensions.ExtensionDescriptor): my_plurals = [(key, key[:-1]) for key in RESOURCE_ATTRIBUTE_MAP.keys()] attr.PLURALS.update(dict(my_plurals)) exts = [] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() for resource_name in ['router', 'floatingip']: collection_name = resource_name + "s" params = RESOURCE_ATTRIBUTE_MAP.get(collection_name, dict()) diff --git a/quantum/extensions/l3_ext_gw_mode.py b/neutron/extensions/l3_ext_gw_mode.py similarity index 89% rename from quantum/extensions/l3_ext_gw_mode.py rename to neutron/extensions/l3_ext_gw_mode.py index 5c43110604..18e7acc98f 100644 --- a/quantum/extensions/l3_ext_gw_mode.py +++ b/neutron/extensions/l3_ext_gw_mode.py @@ -18,9 +18,9 @@ # @author: Salvatore Orlando, Nicira, Inc # -from quantum.api import extensions -from quantum.common import exceptions as qexception -from quantum.extensions import l3 +from neutron.api import extensions +from neutron.common import exceptions as qexception +from neutron.extensions import l3 class RouterDNatDisabled(qexception.BadRequest): @@ -45,7 +45,7 @@ class L3_ext_gw_mode(extensions.ExtensionDescriptor): @classmethod def get_name(cls): - return "Quantum L3 Configurable external gateway mode" + return "Neutron L3 Configurable external gateway mode" @classmethod def get_alias(cls): @@ -58,7 +58,7 @@ class L3_ext_gw_mode(extensions.ExtensionDescriptor): @classmethod def get_namespace(cls): - return "http://docs.openstack.org/ext/quantum/ext-gw-mode/api/v1.0" + return "http://docs.openstack.org/ext/neutron/ext-gw-mode/api/v1.0" @classmethod def get_updated(cls): diff --git a/quantum/extensions/loadbalancer.py b/neutron/extensions/loadbalancer.py similarity index 97% rename from quantum/extensions/loadbalancer.py rename to neutron/extensions/loadbalancer.py index 7a844523b9..7a6da2619d 100644 --- a/quantum/extensions/loadbalancer.py +++ b/neutron/extensions/loadbalancer.py @@ -19,13 +19,13 @@ import abc from oslo.config import cfg -from quantum.api import extensions -from quantum.api.v2 import attributes as attr -from quantum.api.v2 import base -from quantum.common import exceptions as qexception -from quantum import manager -from quantum.plugins.common import constants -from quantum.services.service_base import ServicePluginBase +from neutron.api import extensions +from neutron.api.v2 import attributes as attr +from neutron.api.v2 import base +from neutron.common import exceptions as qexception +from neutron import manager +from neutron.plugins.common import constants +from neutron.services.service_base import ServicePluginBase # Loadbalancer Exceptions @@ -33,7 +33,7 @@ class VipNotFound(qexception.NotFound): message = _("Vip %(vip_id)s could not be found") -class VipExists(qexception.QuantumException): +class VipExists(qexception.NeutronException): message = _("Another Vip already exists for pool %(pool_id)s") @@ -49,7 +49,7 @@ class HealthMonitorNotFound(qexception.NotFound): message = _("Health_monitor %(monitor_id)s could not be found") -class StateInvalid(qexception.QuantumException): +class StateInvalid(qexception.NeutronException): message = _("Invalid state %(state)s of Loadbalancer resource %(id)s") @@ -276,7 +276,7 @@ class Loadbalancer(extensions.ExtensionDescriptor): @classmethod def get_namespace(cls): - return "http://wiki.openstack.org/Quantum/LBaaS/API_1.0" + return "http://wiki.openstack.org/neutron/LBaaS/API_1.0" @classmethod def get_updated(cls): @@ -287,7 +287,7 @@ class Loadbalancer(extensions.ExtensionDescriptor): my_plurals = [(key, key[:-1]) for key in RESOURCE_ATTRIBUTE_MAP.keys()] attr.PLURALS.update(dict(my_plurals)) resources = [] - plugin = manager.QuantumManager.get_service_plugins()[ + plugin = manager.NeutronManager.get_service_plugins()[ constants.LOADBALANCER] for collection_name in RESOURCE_ATTRIBUTE_MAP: # Special handling needed for resources with 'y' ending diff --git a/quantum/extensions/portbindings.py b/neutron/extensions/portbindings.py similarity index 93% rename from quantum/extensions/portbindings.py rename to neutron/extensions/portbindings.py index 087dea866d..fa442d6002 100644 --- a/quantum/extensions/portbindings.py +++ b/neutron/extensions/portbindings.py @@ -15,8 +15,8 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.api import extensions -from quantum.api.v2 import attributes +from neutron.api import extensions +from neutron.api.v2 import attributes # The service will return the vif type for the specific port. @@ -29,8 +29,8 @@ HOST_ID = 'binding:host_id' # the plugin. PROFILE = 'binding:profile' # The capabilities will be a dictionary that enables pass information about -# functionalies quantum provides. The following value should be provided. -# - port_filter : Boolean value indicating Quantum provides port filtering +# functionalies neutron provides. The following value should be provided. +# - port_filter : Boolean value indicating Neutron provides port filtering # features such as security group and anti MAC/IP spoofing CAPABILITIES = 'binding:capabilities' CAP_PORT_FILTER = 'port_filter' @@ -75,7 +75,7 @@ EXTENDED_ATTRIBUTES_2_0 = { class Portbindings(extensions.ExtensionDescriptor): """Extension class supporting port bindings. - This class is used by quantum's extension framework to make + This class is used by neutron's extension framework to make metadata about the port bindings available to external applications. With admin rights one will be able to update and read the values. diff --git a/quantum/extensions/portsecurity.py b/neutron/extensions/portsecurity.py similarity index 96% rename from quantum/extensions/portsecurity.py rename to neutron/extensions/portsecurity.py index c23113fc28..fb3a2b555a 100644 --- a/quantum/extensions/portsecurity.py +++ b/neutron/extensions/portsecurity.py @@ -17,8 +17,8 @@ # @author: Aaron Rosen, Nicira, Inc -from quantum.api.v2 import attributes -from quantum.common import exceptions as qexception +from neutron.api.v2 import attributes +from neutron.common import exceptions as qexception class PortSecurityPortHasSecurityGroup(qexception.InUse): diff --git a/quantum/extensions/providernet.py b/neutron/extensions/providernet.py similarity index 94% rename from quantum/extensions/providernet.py rename to neutron/extensions/providernet.py index ed837ba49c..dab7fa7b87 100644 --- a/quantum/extensions/providernet.py +++ b/neutron/extensions/providernet.py @@ -15,9 +15,9 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.api import extensions -from quantum.api.v2 import attributes -from quantum.common import exceptions as q_exc +from neutron.api import extensions +from neutron.api.v2 import attributes +from neutron.common import exceptions as q_exc NETWORK_TYPE = 'provider:network_type' @@ -60,7 +60,7 @@ def _raise_if_updates_provider_attributes(attrs): class Providernet(extensions.ExtensionDescriptor): """Extension class supporting provider networks. - This class is used by quantum's extension framework to make + This class is used by neutron's extension framework to make metadata about the provider network extension available to clients. No new resources are defined by this extension. Instead, the existing network resource's request and response messages are diff --git a/quantum/extensions/quotasv2.py b/neutron/extensions/quotasv2.py similarity index 89% rename from quantum/extensions/quotasv2.py rename to neutron/extensions/quotasv2.py index 8fd75af316..ba27c42ddf 100644 --- a/quantum/extensions/quotasv2.py +++ b/neutron/extensions/quotasv2.py @@ -20,21 +20,21 @@ import sys from oslo.config import cfg import webob -from quantum.api import extensions -from quantum.api.v2.attributes import convert_to_int -from quantum.api.v2 import base -from quantum.api.v2 import resource -from quantum.common import exceptions as q_exc -from quantum.manager import QuantumManager -from quantum.openstack.common import importutils -from quantum import quota -from quantum import wsgi +from neutron.api import extensions +from neutron.api.v2.attributes import convert_to_int +from neutron.api.v2 import base +from neutron.api.v2 import resource +from neutron.common import exceptions as q_exc +from neutron.manager import NeutronManager +from neutron.openstack.common import importutils +from neutron import quota +from neutron import wsgi RESOURCE_NAME = 'quota' RESOURCE_COLLECTION = RESOURCE_NAME + "s" QUOTAS = quota.QUOTAS -DB_QUOTA_DRIVER = 'quantum.db.quota_db.DbQuotaDriver' +DB_QUOTA_DRIVER = 'neutron.db.quota_db.DbQuotaDriver' EXTENDED_ATTRIBUTES_2_0 = { RESOURCE_COLLECTION: {} } @@ -45,7 +45,9 @@ class QuotaSetsController(wsgi.Controller): def __init__(self, plugin): self._resource_name = RESOURCE_NAME self._plugin = plugin - self._driver = importutils.import_class(cfg.CONF.QUOTAS.quota_driver) + self._driver = importutils.import_class( + cfg.CONF.QUOTAS.quota_driver + ) self._update_extended_attributes = True def _update_attributes(self): @@ -137,7 +139,7 @@ class Quotasv2(extensions.ExtensionDescriptor): def get_resources(cls): """Returns Ext Resources.""" controller = resource.Resource( - QuotaSetsController(QuantumManager.get_plugin()), + QuotaSetsController(NeutronManager.get_plugin()), faults=base.FAULT_MAP) return [extensions.ResourceExtension( Quotasv2.get_alias(), diff --git a/quantum/extensions/routedserviceinsertion.py b/neutron/extensions/routedserviceinsertion.py similarity index 100% rename from quantum/extensions/routedserviceinsertion.py rename to neutron/extensions/routedserviceinsertion.py diff --git a/quantum/extensions/routerservicetype.py b/neutron/extensions/routerservicetype.py similarity index 100% rename from quantum/extensions/routerservicetype.py rename to neutron/extensions/routerservicetype.py diff --git a/quantum/extensions/securitygroup.py b/neutron/extensions/securitygroup.py similarity index 97% rename from quantum/extensions/securitygroup.py rename to neutron/extensions/securitygroup.py index f3ec56f318..9fd4c95788 100644 --- a/quantum/extensions/securitygroup.py +++ b/neutron/extensions/securitygroup.py @@ -20,13 +20,13 @@ from abc import abstractmethod from oslo.config import cfg -from quantum.api import extensions -from quantum.api.v2 import attributes as attr -from quantum.api.v2 import base -from quantum.common import exceptions as qexception -from quantum import manager -from quantum.openstack.common import uuidutils -from quantum import quota +from neutron.api import extensions +from neutron.api.v2 import attributes as attr +from neutron.api.v2 import base +from neutron.common import exceptions as qexception +from neutron import manager +from neutron.openstack.common import uuidutils +from neutron import quota # Security group Exceptions @@ -258,7 +258,7 @@ class Securitygroup(extensions.ExtensionDescriptor): my_plurals = [(key, key[:-1]) for key in RESOURCE_ATTRIBUTE_MAP.keys()] attr.PLURALS.update(dict(my_plurals)) exts = [] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() for resource_name in ['security_group', 'security_group_rule']: collection_name = resource_name.replace('_', '-') + "s" params = RESOURCE_ATTRIBUTE_MAP.get(resource_name + "s", dict()) diff --git a/quantum/extensions/servicetype.py b/neutron/extensions/servicetype.py similarity index 94% rename from quantum/extensions/servicetype.py rename to neutron/extensions/servicetype.py index df80f0daed..4126e39e5d 100644 --- a/quantum/extensions/servicetype.py +++ b/neutron/extensions/servicetype.py @@ -18,14 +18,14 @@ # @author: Salvatore Orlando, VMware # -from quantum.api import extensions -from quantum.api.v2 import attributes -from quantum.api.v2 import base -from quantum import context -from quantum.db import servicetype_db -from quantum import manager -from quantum.openstack.common import log as logging -from quantum.plugins.common import constants +from neutron.api import extensions +from neutron.api.v2 import attributes +from neutron.api.v2 import base +from neutron import context +from neutron.db import servicetype_db +from neutron import manager +from neutron.openstack.common import log as logging +from neutron.plugins.common import constants LOG = logging.getLogger(__name__) @@ -119,7 +119,7 @@ def _validate_service_defs(data, valid_values=None): return msg # TODO(salvatore-orlando): This code will need to change when # multiple plugins for each adv service will be supported - svc_plugin = manager.QuantumManager.get_service_plugins().get( + svc_plugin = manager.NeutronManager.get_service_plugins().get( svc_name) if not svc_plugin: msg = _("No plugin for service '%s'") % svc_name @@ -168,7 +168,7 @@ class Servicetype(extensions.ExtensionDescriptor): @classmethod def get_name(cls): - return _("Quantum Service Type Management") + return _("Neutron Service Type Management") @classmethod def get_alias(cls): @@ -177,11 +177,11 @@ class Servicetype(extensions.ExtensionDescriptor): @classmethod def get_description(cls): return _("API for retrieving and managing service types for " - "Quantum advanced services") + "Neutron advanced services") @classmethod def get_namespace(cls): - return "http://docs.openstack.org/ext/quantum/service-type/api/v1.0" + return "http://docs.openstack.org/ext/neutron/service-type/api/v1.0" @classmethod def get_updated(cls): diff --git a/quantum/hooks.py b/neutron/hooks.py similarity index 100% rename from quantum/hooks.py rename to neutron/hooks.py diff --git a/quantum/locale/bg_BG/LC_MESSAGES/quantum.po b/neutron/locale/bg_BG/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/bg_BG/LC_MESSAGES/quantum.po rename to neutron/locale/bg_BG/LC_MESSAGES/neutron.po diff --git a/quantum/locale/cs/LC_MESSAGES/quantum.po b/neutron/locale/cs/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/cs/LC_MESSAGES/quantum.po rename to neutron/locale/cs/LC_MESSAGES/neutron.po diff --git a/quantum/locale/da/LC_MESSAGES/quantum.po b/neutron/locale/da/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/da/LC_MESSAGES/quantum.po rename to neutron/locale/da/LC_MESSAGES/neutron.po diff --git a/quantum/locale/de/LC_MESSAGES/quantum.po b/neutron/locale/de/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/de/LC_MESSAGES/quantum.po rename to neutron/locale/de/LC_MESSAGES/neutron.po diff --git a/quantum/locale/es/LC_MESSAGES/quantum.po b/neutron/locale/es/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/es/LC_MESSAGES/quantum.po rename to neutron/locale/es/LC_MESSAGES/neutron.po diff --git a/quantum/locale/fi_FI/LC_MESSAGES/quantum.po b/neutron/locale/fi_FI/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/fi_FI/LC_MESSAGES/quantum.po rename to neutron/locale/fi_FI/LC_MESSAGES/neutron.po diff --git a/quantum/locale/fr/LC_MESSAGES/quantum.po b/neutron/locale/fr/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/fr/LC_MESSAGES/quantum.po rename to neutron/locale/fr/LC_MESSAGES/neutron.po diff --git a/quantum/locale/it/LC_MESSAGES/quantum.po b/neutron/locale/it/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/it/LC_MESSAGES/quantum.po rename to neutron/locale/it/LC_MESSAGES/neutron.po diff --git a/quantum/locale/ja/LC_MESSAGES/quantum.po b/neutron/locale/ja/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/ja/LC_MESSAGES/quantum.po rename to neutron/locale/ja/LC_MESSAGES/neutron.po diff --git a/quantum/locale/ka_GE/LC_MESSAGES/quantum.po b/neutron/locale/ka_GE/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/ka_GE/LC_MESSAGES/quantum.po rename to neutron/locale/ka_GE/LC_MESSAGES/neutron.po diff --git a/quantum/locale/ko_KR/LC_MESSAGES/quantum.po b/neutron/locale/ko_KR/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/ko_KR/LC_MESSAGES/quantum.po rename to neutron/locale/ko_KR/LC_MESSAGES/neutron.po diff --git a/quantum/locale/quantum.pot b/neutron/locale/neutron.pot similarity index 100% rename from quantum/locale/quantum.pot rename to neutron/locale/neutron.pot diff --git a/quantum/locale/pl_PL/LC_MESSAGES/quantum.po b/neutron/locale/pl_PL/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/pl_PL/LC_MESSAGES/quantum.po rename to neutron/locale/pl_PL/LC_MESSAGES/neutron.po diff --git a/quantum/locale/pt_BR/LC_MESSAGES/quantum.po b/neutron/locale/pt_BR/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/pt_BR/LC_MESSAGES/quantum.po rename to neutron/locale/pt_BR/LC_MESSAGES/neutron.po diff --git a/quantum/locale/ro/LC_MESSAGES/quantum.po b/neutron/locale/ro/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/ro/LC_MESSAGES/quantum.po rename to neutron/locale/ro/LC_MESSAGES/neutron.po diff --git a/quantum/locale/ru/LC_MESSAGES/quantum.po b/neutron/locale/ru/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/ru/LC_MESSAGES/quantum.po rename to neutron/locale/ru/LC_MESSAGES/neutron.po diff --git a/quantum/locale/sl_SI/LC_MESSAGES/quantum.po b/neutron/locale/sl_SI/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/sl_SI/LC_MESSAGES/quantum.po rename to neutron/locale/sl_SI/LC_MESSAGES/neutron.po diff --git a/quantum/locale/vi_VN/LC_MESSAGES/quantum.po b/neutron/locale/vi_VN/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/vi_VN/LC_MESSAGES/quantum.po rename to neutron/locale/vi_VN/LC_MESSAGES/neutron.po diff --git a/quantum/locale/zh_CN/LC_MESSAGES/quantum.po b/neutron/locale/zh_CN/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/zh_CN/LC_MESSAGES/quantum.po rename to neutron/locale/zh_CN/LC_MESSAGES/neutron.po diff --git a/quantum/locale/zh_TW/LC_MESSAGES/quantum.po b/neutron/locale/zh_TW/LC_MESSAGES/neutron.po similarity index 100% rename from quantum/locale/zh_TW/LC_MESSAGES/quantum.po rename to neutron/locale/zh_TW/LC_MESSAGES/neutron.po diff --git a/quantum/manager.py b/neutron/manager.py similarity index 90% rename from quantum/manager.py rename to neutron/manager.py index eb8b2caece..73e1d2ab05 100644 --- a/quantum/manager.py +++ b/neutron/manager.py @@ -18,11 +18,11 @@ from oslo.config import cfg -from quantum.common import utils -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import periodic_task -from quantum.plugins.common import constants +from neutron.common import utils +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import periodic_task +from neutron.plugins.common import constants LOG = logging.getLogger(__name__) @@ -78,17 +78,17 @@ def validate_pre_plugin_load(): message. If all is OK then it will return None. """ if cfg.CONF.core_plugin is None: - msg = _('Quantum core_plugin not configured!') + msg = _('Neutron core_plugin not configured!') return msg -class QuantumManager(object): - """Quantum's Manager class. +class NeutronManager(object): + """Neutron's Manager class. - Quantum's Manager class is responsible for parsing a config file and + Neutron's Manager class is responsible for parsing a config file and instantiating the correct plugin that concretely implement - quantum_plugin_base class. - The caller should make sure that QuantumManager is a singleton. + neutron_plugin_base class. + The caller should make sure that NeutronManager is a singleton. """ _instance = None @@ -114,9 +114,7 @@ class QuantumManager(object): plugin_klass = importutils.import_class(plugin_provider) except ImportError: LOG.exception(_("Error loading plugin")) - raise Exception(_("Plugin not found. You can install a " - "plugin with: pip install \n" - "Example: pip install quantum-sample-plugin")) + raise Exception(_("Plugin not found. ")) self.plugin = plugin_klass() msg = validate_post_plugin_load() diff --git a/quantum/quantum_plugin_base_v2.py b/neutron/neutron_plugin_base_v2.py similarity index 82% rename from quantum/quantum_plugin_base_v2.py rename to neutron/neutron_plugin_base_v2.py index 43d21f1c64..9367c29f50 100644 --- a/quantum/quantum_plugin_base_v2.py +++ b/neutron/neutron_plugin_base_v2.py @@ -15,18 +15,18 @@ # @author: Dan Wendlandt, Nicira, Inc. """ -v2 Quantum Plug-in API specification. +v2 Neutron Plug-in API specification. -:class:`QuantumPluginBaseV2` provides the definition of minimum set of -methods that needs to be implemented by a v2 Quantum Plug-in. +:class:`NeutronPluginBaseV2` provides the definition of minimum set of +methods that needs to be implemented by a v2 Neutron Plug-in. """ from abc import ABCMeta, abstractmethod -from quantum.common import exceptions +from neutron.common import exceptions -class QuantumPluginBaseV2(object): +class NeutronPluginBaseV2(object): __metaclass__ = ABCMeta @@ -37,10 +37,10 @@ class QuantumPluginBaseV2(object): Create a subnet, which represents a range of IP addresses that can be allocated to devices - :param context: quantum api request context + :param context: neutron api request context :param subnet: dictionary describing the subnet, with keys as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object - in :file:`quantum/api/v2/attributes.py`. All keys will + in :file:`neutron/api/v2/attributes.py`. All keys will be populated. """ pass @@ -49,13 +49,13 @@ class QuantumPluginBaseV2(object): def update_subnet(self, context, id, subnet): """Update values of a subnet. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the subnet to update. :param subnet: dictionary with keys indicating fields to update. valid keys are those that have a value of True for 'allow_put' as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. + :file:`neutron/api/v2/attributes.py`. """ pass @@ -63,12 +63,12 @@ class QuantumPluginBaseV2(object): def get_subnet(self, context, id, fields=None): """Retrieve a subnet. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the subnet to fetch. :param fields: a list of strings that are valid keys in a subnet dictionary as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Only these fields + :file:`neutron/api/v2/attributes.py`. Only these fields will be returned. """ pass @@ -82,10 +82,10 @@ class QuantumPluginBaseV2(object): the identity of the user making the request (as indicated by the context) as well as any filters. - :param context: quantum api request context + :param context: neutron api request context :param filters: a dictionary with keys that are valid keys for a subnet as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` - object in :file:`quantum/api/v2/attributes.py`. + object in :file:`neutron/api/v2/attributes.py`. Values in this dictiontary are an iterable containing values that will be used for an exact match comparison for that value. Each result returned by this @@ -94,7 +94,7 @@ class QuantumPluginBaseV2(object): :param fields: a list of strings that are valid keys in a subnet dictionary as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Only these fields + :file:`neutron/api/v2/attributes.py`. Only these fields will be returned. """ pass @@ -106,11 +106,11 @@ class QuantumPluginBaseV2(object): the user making the request (as indicated by the context) as well as any filters. - :param context: quantum api request context + :param context: neutron api request context :param filters: a dictionary with keys that are valid keys for a network as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Values in this + :file:`neutron/api/v2/attributes.py`. Values in this dictiontary are an iterable containing values that will be used for an exact match comparison for that value. Each result returned by this function will @@ -125,7 +125,7 @@ class QuantumPluginBaseV2(object): def delete_subnet(self, context, id): """Delete a subnet. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the subnet to delete. """ pass @@ -137,10 +137,10 @@ class QuantumPluginBaseV2(object): Create a network, which represents an L2 network segment which can have a set of subnets and ports associated with it. - :param context: quantum api request context + :param context: neutron api request context :param network: dictionary describing the network, with keys as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object - in :file:`quantum/api/v2/attributes.py`. All keys will + in :file:`neutron/api/v2/attributes.py`. All keys will be populated. """ @@ -150,13 +150,13 @@ class QuantumPluginBaseV2(object): def update_network(self, context, id, network): """Update values of a network. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the network to update. :param network: dictionary with keys indicating fields to update. valid keys are those that have a value of True for 'allow_put' as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. + :file:`neutron/api/v2/attributes.py`. """ pass @@ -164,12 +164,12 @@ class QuantumPluginBaseV2(object): def get_network(self, context, id, fields=None): """Retrieve a network. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the network to fetch. :param fields: a list of strings that are valid keys in a network dictionary as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Only these fields + :file:`neutron/api/v2/attributes.py`. Only these fields will be returned. """ pass @@ -183,11 +183,11 @@ class QuantumPluginBaseV2(object): the identity of the user making the request (as indicated by the context) as well as any filters. - :param context: quantum api request context + :param context: neutron api request context :param filters: a dictionary with keys that are valid keys for a network as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Values in this + :file:`neutron/api/v2/attributes.py`. Values in this dictiontary are an iterable containing values that will be used for an exact match comparison for that value. Each result returned by this function will have matched @@ -195,7 +195,7 @@ class QuantumPluginBaseV2(object): :param fields: a list of strings that are valid keys in a network dictionary as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Only these fields + :file:`neutron/api/v2/attributes.py`. Only these fields will be returned. """ pass @@ -207,11 +207,11 @@ class QuantumPluginBaseV2(object): of the user making the request (as indicated by the context) as well as any filters. - :param context: quantum api request context + :param context: neutron api request context :param filters: a dictionary with keys that are valid keys for a network as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object - in :file:`quantum/api/v2/attributes.py`. Values in + in :file:`neutron/api/v2/attributes.py`. Values in this dictiontary are an iterable containing values that will be used for an exact match comparison for that value. Each result returned by this function will have @@ -226,7 +226,7 @@ class QuantumPluginBaseV2(object): def delete_network(self, context, id): """Delete a network. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the network to delete. """ pass @@ -236,12 +236,12 @@ class QuantumPluginBaseV2(object): """Create a port. Create a port, which is a connection point of a device (e.g., a VM - NIC) to attach to a L2 Quantum network. + NIC) to attach to a L2 neutron network. - :param context: quantum api request context + :param context: neutron api request context :param port: dictionary describing the port, with keys as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. All keys will be + :file:`neutron/api/v2/attributes.py`. All keys will be populated. """ pass @@ -250,12 +250,12 @@ class QuantumPluginBaseV2(object): def update_port(self, context, id, port): """Update values of a port. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the port to update. :param port: dictionary with keys indicating fields to update. valid keys are those that have a value of True for 'allow_put' as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` - object in :file:`quantum/api/v2/attributes.py`. + object in :file:`neutron/api/v2/attributes.py`. """ pass @@ -263,12 +263,12 @@ class QuantumPluginBaseV2(object): def get_port(self, context, id, fields=None): """Retrieve a port. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the port to fetch. :param fields: a list of strings that are valid keys in a port dictionary as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Only these fields + :file:`neutron/api/v2/attributes.py`. Only these fields will be returned. """ pass @@ -281,10 +281,10 @@ class QuantumPluginBaseV2(object): The contents of the list depends on the identity of the user making the request (as indicated by the context) as well as any filters. - :param context: quantum api request context + :param context: neutron api request context :param filters: a dictionary with keys that are valid keys for a port as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` - object in :file:`quantum/api/v2/attributes.py`. Values + object in :file:`neutron/api/v2/attributes.py`. Values in this dictiontary are an iterable containing values that will be used for an exact match comparison for that value. Each result returned by this function will @@ -292,7 +292,7 @@ class QuantumPluginBaseV2(object): :param fields: a list of strings that are valid keys in a port dictionary as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Only these fields + :file:`neutron/api/v2/attributes.py`. Only these fields will be returned. """ pass @@ -303,11 +303,11 @@ class QuantumPluginBaseV2(object): The result depends on the identity of the user making the request (as indicated by the context) as well as any filters. - :param context: quantum api request context + :param context: neutron api request context :param filters: a dictionary with keys that are valid keys for a network as listed in the :obj:`RESOURCE_ATTRIBUTE_MAP` object in - :file:`quantum/api/v2/attributes.py`. Values in this + :file:`neutron/api/v2/attributes.py`. Values in this dictiontary are an iterable containing values that will be used for an exact match comparison for that value. Each result returned by this function will have matched @@ -322,7 +322,7 @@ class QuantumPluginBaseV2(object): def delete_port(self, context, id): """Delete a port. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the port to delete. """ pass diff --git a/quantum/openstack/common/__init__.py b/neutron/openstack/__init__.py similarity index 100% rename from quantum/openstack/common/__init__.py rename to neutron/openstack/__init__.py diff --git a/quantum/plugins/cisco/test/__init__.py b/neutron/openstack/common/__init__.py similarity index 100% rename from quantum/plugins/cisco/test/__init__.py rename to neutron/openstack/common/__init__.py diff --git a/quantum/openstack/common/context.py b/neutron/openstack/common/context.py similarity index 98% rename from quantum/openstack/common/context.py rename to neutron/openstack/common/context.py index 5ba9cea497..fa62fc1f16 100644 --- a/quantum/openstack/common/context.py +++ b/neutron/openstack/common/context.py @@ -24,7 +24,7 @@ context or provide additional information in their specific WSGI pipeline. import itertools -from quantum.openstack.common import uuidutils +from neutron.openstack.common import uuidutils def generate_request_id(): diff --git a/quantum/openstack/common/db/__init__.py b/neutron/openstack/common/db/__init__.py similarity index 100% rename from quantum/openstack/common/db/__init__.py rename to neutron/openstack/common/db/__init__.py diff --git a/quantum/openstack/common/db/api.py b/neutron/openstack/common/db/api.py similarity index 95% rename from quantum/openstack/common/db/api.py rename to neutron/openstack/common/db/api.py index 08df0decf1..e39fdc9034 100644 --- a/quantum/openstack/common/db/api.py +++ b/neutron/openstack/common/db/api.py @@ -40,8 +40,8 @@ import functools from oslo.config import cfg -from quantum.openstack.common import importutils -from quantum.openstack.common import lockutils +from neutron.openstack.common import importutils +from neutron.openstack.common import lockutils db_opts = [ @@ -69,7 +69,7 @@ class DBAPI(object): self.__backend = None self.__backend_mapping = backend_mapping - @lockutils.synchronized('dbapi_backend', 'quantum-') + @lockutils.synchronized('dbapi_backend', 'neutron-') def __get_backend(self): """Get the actual backend. May be a module or an instance of a class. Doesn't matter to us. We do this synchronized as it's diff --git a/quantum/openstack/common/db/exception.py b/neutron/openstack/common/db/exception.py similarity index 96% rename from quantum/openstack/common/db/exception.py rename to neutron/openstack/common/db/exception.py index 410cd9bfcc..ed435777bc 100644 --- a/quantum/openstack/common/db/exception.py +++ b/neutron/openstack/common/db/exception.py @@ -18,7 +18,7 @@ """DB related custom exceptions.""" -from quantum.openstack.common.gettextutils import _ +from neutron.openstack.common.gettextutils import _ class DBError(Exception): diff --git a/quantum/openstack/common/db/sqlalchemy/__init__.py b/neutron/openstack/common/db/sqlalchemy/__init__.py similarity index 100% rename from quantum/openstack/common/db/sqlalchemy/__init__.py rename to neutron/openstack/common/db/sqlalchemy/__init__.py diff --git a/quantum/openstack/common/db/sqlalchemy/models.py b/neutron/openstack/common/db/sqlalchemy/models.py similarity index 96% rename from quantum/openstack/common/db/sqlalchemy/models.py rename to neutron/openstack/common/db/sqlalchemy/models.py index d108a55eaf..a72c4aa3e0 100644 --- a/quantum/openstack/common/db/sqlalchemy/models.py +++ b/neutron/openstack/common/db/sqlalchemy/models.py @@ -26,8 +26,8 @@ from sqlalchemy import Column, Integer from sqlalchemy import DateTime from sqlalchemy.orm import object_mapper -from quantum.openstack.common.db.sqlalchemy.session import get_session -from quantum.openstack.common import timeutils +from neutron.openstack.common.db.sqlalchemy.session import get_session +from neutron.openstack.common import timeutils class ModelBase(object): diff --git a/quantum/openstack/common/db/sqlalchemy/session.py b/neutron/openstack/common/db/sqlalchemy/session.py similarity index 98% rename from quantum/openstack/common/db/sqlalchemy/session.py rename to neutron/openstack/common/db/sqlalchemy/session.py index 0f3816be40..32793431dd 100644 --- a/quantum/openstack/common/db/sqlalchemy/session.py +++ b/neutron/openstack/common/db/sqlalchemy/session.py @@ -26,8 +26,8 @@ Initializing: Example: session.set_defaults( - sql_connection="sqlite:///var/lib/quantum/sqlite.db", - sqlite_db="/var/lib/quantum/sqlite.db") + sql_connection="sqlite:///var/lib/neutron/sqlite.db", + sqlite_db="/var/lib/neutron/sqlite.db") Recommended ways to use sessions within this framework: @@ -255,16 +255,16 @@ import sqlalchemy.orm from sqlalchemy.pool import NullPool, StaticPool from sqlalchemy.sql.expression import literal_column -from quantum.openstack.common.db import exception -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common import timeutils +from neutron.openstack.common.db import exception +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common import timeutils DEFAULT = 'DEFAULT' sqlite_db_opts = [ cfg.StrOpt('sqlite_db', - default='quantum.sqlite', + default='neutron.sqlite', help='the filename to use with sqlite'), cfg.BoolOpt('sqlite_synchronous', default=True, @@ -756,8 +756,8 @@ def _patch_mysqldb_with_stacktrace_comments(): # db/api is just a wrapper around db/sqlalchemy/api if file.endswith('db/api.py'): continue - # only trace inside quantum - index = file.rfind('quantum') + # only trace inside neutron + index = file.rfind('neutron') if index == -1: continue stack += "File:%s:%s Method:%s() Line:%s | " \ diff --git a/quantum/openstack/common/db/sqlalchemy/utils.py b/neutron/openstack/common/db/sqlalchemy/utils.py similarity index 97% rename from quantum/openstack/common/db/sqlalchemy/utils.py rename to neutron/openstack/common/db/sqlalchemy/utils.py index aaa763dd86..f3d56bfdf1 100644 --- a/quantum/openstack/common/db/sqlalchemy/utils.py +++ b/neutron/openstack/common/db/sqlalchemy/utils.py @@ -22,8 +22,8 @@ import sqlalchemy -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/eventlet_backdoor.py b/neutron/openstack/common/eventlet_backdoor.py similarity index 100% rename from quantum/openstack/common/eventlet_backdoor.py rename to neutron/openstack/common/eventlet_backdoor.py diff --git a/quantum/openstack/common/exception.py b/neutron/openstack/common/exception.py similarity index 98% rename from quantum/openstack/common/exception.py rename to neutron/openstack/common/exception.py index 7a994a2164..a1cf6bb900 100644 --- a/quantum/openstack/common/exception.py +++ b/neutron/openstack/common/exception.py @@ -21,7 +21,7 @@ Exceptions common to OpenStack projects import logging -from quantum.openstack.common.gettextutils import _ +from neutron.openstack.common.gettextutils import _ _FATAL_EXCEPTION_FORMAT_ERRORS = False diff --git a/quantum/openstack/common/excutils.py b/neutron/openstack/common/excutils.py similarity index 97% rename from quantum/openstack/common/excutils.py rename to neutron/openstack/common/excutils.py index d7fe150f0c..676baaeae4 100644 --- a/quantum/openstack/common/excutils.py +++ b/neutron/openstack/common/excutils.py @@ -24,7 +24,7 @@ import logging import sys import traceback -from quantum.openstack.common.gettextutils import _ +from neutron.openstack.common.gettextutils import _ @contextlib.contextmanager diff --git a/quantum/openstack/common/fileutils.py b/neutron/openstack/common/fileutils.py similarity index 94% rename from quantum/openstack/common/fileutils.py rename to neutron/openstack/common/fileutils.py index 54fcaa9b39..48aaee895a 100644 --- a/quantum/openstack/common/fileutils.py +++ b/neutron/openstack/common/fileutils.py @@ -20,9 +20,9 @@ import contextlib import errno import os -from quantum.openstack.common import excutils -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging +from neutron.openstack.common import excutils +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/gettextutils.py b/neutron/openstack/common/gettextutils.py similarity index 97% rename from quantum/openstack/common/gettextutils.py rename to neutron/openstack/common/gettextutils.py index 05dde48924..0fd139e3f4 100644 --- a/quantum/openstack/common/gettextutils.py +++ b/neutron/openstack/common/gettextutils.py @@ -21,7 +21,7 @@ gettext for openstack-common modules. Usual usage in an openstack.common module: - from quantum.openstack.common.gettextutils import _ + from neutron.openstack.common.gettextutils import _ """ import copy @@ -30,8 +30,8 @@ import logging.handlers import os import UserString -_localedir = os.environ.get('quantum'.upper() + '_LOCALEDIR') -_t = gettext.translation('quantum', localedir=_localedir, fallback=True) +_localedir = os.environ.get('neutron'.upper() + '_LOCALEDIR') +_t = gettext.translation('neutron', localedir=_localedir, fallback=True) def _(msg): diff --git a/quantum/openstack/common/importutils.py b/neutron/openstack/common/importutils.py similarity index 100% rename from quantum/openstack/common/importutils.py rename to neutron/openstack/common/importutils.py diff --git a/quantum/openstack/common/jsonutils.py b/neutron/openstack/common/jsonutils.py similarity index 99% rename from quantum/openstack/common/jsonutils.py rename to neutron/openstack/common/jsonutils.py index 0c3b40e2f2..2833876792 100644 --- a/quantum/openstack/common/jsonutils.py +++ b/neutron/openstack/common/jsonutils.py @@ -43,7 +43,7 @@ import xmlrpclib import six -from quantum.openstack.common import timeutils +from neutron.openstack.common import timeutils _nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod, diff --git a/quantum/openstack/common/local.py b/neutron/openstack/common/local.py similarity index 100% rename from quantum/openstack/common/local.py rename to neutron/openstack/common/local.py diff --git a/quantum/openstack/common/lockutils.py b/neutron/openstack/common/lockutils.py similarity index 98% rename from quantum/openstack/common/lockutils.py rename to neutron/openstack/common/lockutils.py index 44e7ba27f2..ea80e73c59 100644 --- a/quantum/openstack/common/lockutils.py +++ b/neutron/openstack/common/lockutils.py @@ -27,10 +27,10 @@ import weakref from eventlet import semaphore from oslo.config import cfg -from quantum.openstack.common import fileutils -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import local -from quantum.openstack.common import log as logging +from neutron.openstack.common import fileutils +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import local +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/log.py b/neutron/openstack/common/log.py similarity index 98% rename from quantum/openstack/common/log.py rename to neutron/openstack/common/log.py index 2969004b47..3bc4c7f0aa 100644 --- a/quantum/openstack/common/log.py +++ b/neutron/openstack/common/log.py @@ -42,10 +42,10 @@ import traceback from oslo.config import cfg -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import importutils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import local +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import importutils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import local _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" @@ -418,7 +418,7 @@ def _setup_logging_from_conf(): if CONF.publish_errors: handler = importutils.import_object( - "quantum.openstack.common.log_handler.PublishErrorsHandler", + "neutron.openstack.common.log_handler.PublishErrorsHandler", logging.ERROR) log_root.addHandler(handler) diff --git a/quantum/openstack/common/loopingcall.py b/neutron/openstack/common/loopingcall.py similarity index 96% rename from quantum/openstack/common/loopingcall.py rename to neutron/openstack/common/loopingcall.py index c755565423..f82dc7f3ae 100644 --- a/quantum/openstack/common/loopingcall.py +++ b/neutron/openstack/common/loopingcall.py @@ -22,9 +22,9 @@ import sys from eventlet import event from eventlet import greenthread -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common import timeutils +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common import timeutils LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/network_utils.py b/neutron/openstack/common/network_utils.py similarity index 97% rename from quantum/openstack/common/network_utils.py rename to neutron/openstack/common/network_utils.py index 3ab17adfa5..6ddb441d74 100644 --- a/quantum/openstack/common/network_utils.py +++ b/neutron/openstack/common/network_utils.py @@ -19,7 +19,7 @@ Network-related utilities and helper functions. """ -from quantum.openstack.common import log as logging +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/notifier/__init__.py b/neutron/openstack/common/notifier/__init__.py similarity index 100% rename from quantum/openstack/common/notifier/__init__.py rename to neutron/openstack/common/notifier/__init__.py diff --git a/quantum/openstack/common/notifier/api.py b/neutron/openstack/common/notifier/api.py similarity index 94% rename from quantum/openstack/common/notifier/api.py rename to neutron/openstack/common/notifier/api.py index 3be2cef150..d640a71d05 100644 --- a/quantum/openstack/common/notifier/api.py +++ b/neutron/openstack/common/notifier/api.py @@ -17,12 +17,12 @@ import uuid from oslo.config import cfg -from quantum.openstack.common import context -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import importutils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import timeutils +from neutron.openstack.common import context +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import importutils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import timeutils LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/notifier/log_notifier.py b/neutron/openstack/common/notifier/log_notifier.py similarity index 87% rename from quantum/openstack/common/notifier/log_notifier.py rename to neutron/openstack/common/notifier/log_notifier.py index cab81e0243..78e081293e 100644 --- a/quantum/openstack/common/notifier/log_notifier.py +++ b/neutron/openstack/common/notifier/log_notifier.py @@ -15,8 +15,8 @@ from oslo.config import cfg -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging CONF = cfg.CONF @@ -32,6 +32,6 @@ def notify(_context, message): CONF.default_notification_level) priority = priority.lower() logger = logging.getLogger( - 'quantum.openstack.common.notification.%s' % + 'neutron.openstack.common.notification.%s' % message['event_type']) getattr(logger, priority)(jsonutils.dumps(message)) diff --git a/quantum/openstack/common/notifier/no_op_notifier.py b/neutron/openstack/common/notifier/no_op_notifier.py similarity index 100% rename from quantum/openstack/common/notifier/no_op_notifier.py rename to neutron/openstack/common/notifier/no_op_notifier.py diff --git a/quantum/openstack/common/notifier/rabbit_notifier.py b/neutron/openstack/common/notifier/rabbit_notifier.py similarity index 85% rename from quantum/openstack/common/notifier/rabbit_notifier.py rename to neutron/openstack/common/notifier/rabbit_notifier.py index 428ec7b7f5..2204dfea0e 100644 --- a/quantum/openstack/common/notifier/rabbit_notifier.py +++ b/neutron/openstack/common/notifier/rabbit_notifier.py @@ -14,9 +14,9 @@ # under the License. -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common.notifier import rpc_notifier +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common.notifier import rpc_notifier LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/notifier/rpc_notifier.py b/neutron/openstack/common/notifier/rpc_notifier.py similarity index 87% rename from quantum/openstack/common/notifier/rpc_notifier.py rename to neutron/openstack/common/notifier/rpc_notifier.py index 42fa7c0382..536715da57 100644 --- a/quantum/openstack/common/notifier/rpc_notifier.py +++ b/neutron/openstack/common/notifier/rpc_notifier.py @@ -15,10 +15,10 @@ from oslo.config import cfg -from quantum.openstack.common import context as req_context -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc +from neutron.openstack.common import context as req_context +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/notifier/rpc_notifier2.py b/neutron/openstack/common/notifier/rpc_notifier2.py similarity index 89% rename from quantum/openstack/common/notifier/rpc_notifier2.py rename to neutron/openstack/common/notifier/rpc_notifier2.py index 9dba568a5d..2b96aa3625 100644 --- a/quantum/openstack/common/notifier/rpc_notifier2.py +++ b/neutron/openstack/common/notifier/rpc_notifier2.py @@ -17,10 +17,10 @@ from oslo.config import cfg -from quantum.openstack.common import context as req_context -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc +from neutron.openstack.common import context as req_context +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/notifier/test_notifier.py b/neutron/openstack/common/notifier/test_notifier.py similarity index 100% rename from quantum/openstack/common/notifier/test_notifier.py rename to neutron/openstack/common/notifier/test_notifier.py diff --git a/quantum/openstack/common/periodic_task.py b/neutron/openstack/common/periodic_task.py similarity index 97% rename from quantum/openstack/common/periodic_task.py rename to neutron/openstack/common/periodic_task.py index 50a35f4142..02d0048c6c 100644 --- a/quantum/openstack/common/periodic_task.py +++ b/neutron/openstack/common/periodic_task.py @@ -18,9 +18,9 @@ import time from oslo.config import cfg -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common import timeutils +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common import timeutils periodic_opts = [ diff --git a/quantum/openstack/common/policy.py b/neutron/openstack/common/policy.py similarity index 99% rename from quantum/openstack/common/policy.py rename to neutron/openstack/common/policy.py index fa1bfa2383..21ce9b80a9 100644 --- a/quantum/openstack/common/policy.py +++ b/neutron/openstack/common/policy.py @@ -63,9 +63,9 @@ import urllib import six import urllib2 -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/processutils.py b/neutron/openstack/common/processutils.py similarity index 98% rename from quantum/openstack/common/processutils.py rename to neutron/openstack/common/processutils.py index 1b574d1b41..73c214e8b2 100644 --- a/quantum/openstack/common/processutils.py +++ b/neutron/openstack/common/processutils.py @@ -27,8 +27,8 @@ import signal from eventlet.green import subprocess from eventlet import greenthread -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/rpc/__init__.py b/neutron/openstack/common/rpc/__init__.py similarity index 97% rename from quantum/openstack/common/rpc/__init__.py rename to neutron/openstack/common/rpc/__init__.py index cef3c349e5..e20d0b2889 100644 --- a/quantum/openstack/common/rpc/__init__.py +++ b/neutron/openstack/common/rpc/__init__.py @@ -29,10 +29,10 @@ import inspect from oslo.config import cfg -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import importutils -from quantum.openstack.common import local -from quantum.openstack.common import log as logging +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import importutils +from neutron.openstack.common import local +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -56,7 +56,7 @@ rpc_opts = [ help='Seconds to wait before a cast expires (TTL). ' 'Only supported by impl_zmq.'), cfg.ListOpt('allowed_rpc_exception_modules', - default=['quantum.openstack.common.exception', + default=['neutron.openstack.common.exception', 'nova.exception', 'cinder.exception', 'exceptions', diff --git a/quantum/openstack/common/rpc/amqp.py b/neutron/openstack/common/rpc/amqp.py similarity index 98% rename from quantum/openstack/common/rpc/amqp.py rename to neutron/openstack/common/rpc/amqp.py index f531277a09..7aaf34b773 100644 --- a/quantum/openstack/common/rpc/amqp.py +++ b/neutron/openstack/common/rpc/amqp.py @@ -35,11 +35,11 @@ from eventlet import pools from eventlet import queue from eventlet import semaphore -from quantum.openstack.common import excutils -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import local -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import common as rpc_common +from neutron.openstack.common import excutils +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import local +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import common as rpc_common UNIQUE_ID = '_unique_id' diff --git a/quantum/openstack/common/rpc/common.py b/neutron/openstack/common/rpc/common.py similarity index 98% rename from quantum/openstack/common/rpc/common.py rename to neutron/openstack/common/rpc/common.py index a8abcb411b..d240597afb 100644 --- a/quantum/openstack/common/rpc/common.py +++ b/neutron/openstack/common/rpc/common.py @@ -24,11 +24,11 @@ import traceback from oslo.config import cfg import six -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import importutils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import local -from quantum.openstack.common import log as logging +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import importutils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import local +from neutron.openstack.common import log as logging CONF = cfg.CONF diff --git a/quantum/openstack/common/rpc/dispatcher.py b/neutron/openstack/common/rpc/dispatcher.py similarity index 98% rename from quantum/openstack/common/rpc/dispatcher.py rename to neutron/openstack/common/rpc/dispatcher.py index 2b5fa06fa2..d734e32a6b 100644 --- a/quantum/openstack/common/rpc/dispatcher.py +++ b/neutron/openstack/common/rpc/dispatcher.py @@ -83,8 +83,8 @@ On the client side, the same changes should be made as in example 1. The minimum version that supports the new parameter should be specified. """ -from quantum.openstack.common.rpc import common as rpc_common -from quantum.openstack.common.rpc import serializer as rpc_serializer +from neutron.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.rpc import serializer as rpc_serializer class RpcDispatcher(object): diff --git a/quantum/openstack/common/rpc/impl_fake.py b/neutron/openstack/common/rpc/impl_fake.py similarity index 98% rename from quantum/openstack/common/rpc/impl_fake.py rename to neutron/openstack/common/rpc/impl_fake.py index 022a09c859..e24db8a6c7 100644 --- a/quantum/openstack/common/rpc/impl_fake.py +++ b/neutron/openstack/common/rpc/impl_fake.py @@ -27,7 +27,7 @@ import time import eventlet -from quantum.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.rpc import common as rpc_common CONSUMERS = {} diff --git a/quantum/openstack/common/rpc/impl_kombu.py b/neutron/openstack/common/rpc/impl_kombu.py similarity index 99% rename from quantum/openstack/common/rpc/impl_kombu.py rename to neutron/openstack/common/rpc/impl_kombu.py index ec5d303a3e..7f264a4365 100644 --- a/quantum/openstack/common/rpc/impl_kombu.py +++ b/neutron/openstack/common/rpc/impl_kombu.py @@ -30,10 +30,10 @@ import kombu.entity import kombu.messaging from oslo.config import cfg -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import network_utils -from quantum.openstack.common.rpc import amqp as rpc_amqp -from quantum.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import network_utils +from neutron.openstack.common.rpc import amqp as rpc_amqp +from neutron.openstack.common.rpc import common as rpc_common kombu_opts = [ cfg.StrOpt('kombu_ssl_version', diff --git a/quantum/openstack/common/rpc/impl_qpid.py b/neutron/openstack/common/rpc/impl_qpid.py similarity index 98% rename from quantum/openstack/common/rpc/impl_qpid.py rename to neutron/openstack/common/rpc/impl_qpid.py index 3c9bf6574c..a5f934e4d4 100644 --- a/quantum/openstack/common/rpc/impl_qpid.py +++ b/neutron/openstack/common/rpc/impl_qpid.py @@ -24,12 +24,12 @@ import eventlet import greenlet from oslo.config import cfg -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import importutils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import amqp as rpc_amqp -from quantum.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import importutils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import amqp as rpc_amqp +from neutron.openstack.common.rpc import common as rpc_common qpid_codec = importutils.try_import("qpid.codec010") qpid_messaging = importutils.try_import("qpid.messaging") diff --git a/quantum/openstack/common/rpc/impl_zmq.py b/neutron/openstack/common/rpc/impl_zmq.py similarity index 98% rename from quantum/openstack/common/rpc/impl_zmq.py rename to neutron/openstack/common/rpc/impl_zmq.py index eca48c12f1..2d9adf5647 100644 --- a/quantum/openstack/common/rpc/impl_zmq.py +++ b/neutron/openstack/common/rpc/impl_zmq.py @@ -26,11 +26,11 @@ import eventlet import greenlet from oslo.config import cfg -from quantum.openstack.common import excutils -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import importutils -from quantum.openstack.common import jsonutils -from quantum.openstack.common.rpc import common as rpc_common +from neutron.openstack.common import excutils +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import importutils +from neutron.openstack.common import jsonutils +from neutron.openstack.common.rpc import common as rpc_common zmq = importutils.try_import('eventlet.green.zmq') @@ -51,7 +51,7 @@ zmq_opts = [ # The module.Class to use for matchmaking. cfg.StrOpt( 'rpc_zmq_matchmaker', - default=('quantum.openstack.common.rpc.' + default=('neutron.openstack.common.rpc.' 'matchmaker.MatchMakerLocalhost'), help='MatchMaker driver', ), diff --git a/quantum/openstack/common/rpc/matchmaker.py b/neutron/openstack/common/rpc/matchmaker.py similarity index 98% rename from quantum/openstack/common/rpc/matchmaker.py rename to neutron/openstack/common/rpc/matchmaker.py index 60001b6273..71507f5700 100644 --- a/quantum/openstack/common/rpc/matchmaker.py +++ b/neutron/openstack/common/rpc/matchmaker.py @@ -23,8 +23,8 @@ import contextlib import eventlet from oslo.config import cfg -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging matchmaker_opts = [ diff --git a/quantum/openstack/common/rpc/matchmaker_redis.py b/neutron/openstack/common/rpc/matchmaker_redis.py similarity index 96% rename from quantum/openstack/common/rpc/matchmaker_redis.py rename to neutron/openstack/common/rpc/matchmaker_redis.py index 736a1d17a3..5b53e5d9a3 100644 --- a/quantum/openstack/common/rpc/matchmaker_redis.py +++ b/neutron/openstack/common/rpc/matchmaker_redis.py @@ -20,9 +20,9 @@ return keys for direct exchanges, per (approximate) AMQP parlance. from oslo.config import cfg -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import matchmaker as mm_common +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import matchmaker as mm_common redis = importutils.try_import('redis') diff --git a/quantum/openstack/common/rpc/matchmaker_ring.py b/neutron/openstack/common/rpc/matchmaker_ring.py similarity index 95% rename from quantum/openstack/common/rpc/matchmaker_ring.py rename to neutron/openstack/common/rpc/matchmaker_ring.py index 044ef4008a..15a4971d85 100644 --- a/quantum/openstack/common/rpc/matchmaker_ring.py +++ b/neutron/openstack/common/rpc/matchmaker_ring.py @@ -23,9 +23,9 @@ import json from oslo.config import cfg -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import matchmaker as mm +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import matchmaker as mm matchmaker_opts = [ diff --git a/quantum/openstack/common/rpc/proxy.py b/neutron/openstack/common/rpc/proxy.py similarity index 98% rename from quantum/openstack/common/rpc/proxy.py rename to neutron/openstack/common/rpc/proxy.py index 468741aa41..e180cdec79 100644 --- a/quantum/openstack/common/rpc/proxy.py +++ b/neutron/openstack/common/rpc/proxy.py @@ -22,9 +22,9 @@ For more information about rpc API version numbers, see: """ -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import common as rpc_common -from quantum.openstack.common.rpc import serializer as rpc_serializer +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.rpc import serializer as rpc_serializer class RpcProxy(object): diff --git a/quantum/openstack/common/rpc/serializer.py b/neutron/openstack/common/rpc/serializer.py similarity index 100% rename from quantum/openstack/common/rpc/serializer.py rename to neutron/openstack/common/rpc/serializer.py diff --git a/quantum/openstack/common/rpc/service.py b/neutron/openstack/common/rpc/service.py similarity index 90% rename from quantum/openstack/common/rpc/service.py rename to neutron/openstack/common/rpc/service.py index d24c66530d..39a98a2edc 100644 --- a/quantum/openstack/common/rpc/service.py +++ b/neutron/openstack/common/rpc/service.py @@ -17,11 +17,11 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import dispatcher as rpc_dispatcher -from quantum.openstack.common import service +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import dispatcher as rpc_dispatcher +from neutron.openstack.common import service LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/rpc/zmq_receiver.py b/neutron/openstack/common/rpc/zmq_receiver.py similarity index 88% rename from quantum/openstack/common/rpc/zmq_receiver.py rename to neutron/openstack/common/rpc/zmq_receiver.py index 57c32d7103..ca0e28e2ec 100755 --- a/quantum/openstack/common/rpc/zmq_receiver.py +++ b/neutron/openstack/common/rpc/zmq_receiver.py @@ -23,9 +23,9 @@ import sys from oslo.config import cfg -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import impl_zmq +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import impl_zmq CONF = cfg.CONF CONF.register_opts(rpc.rpc_opts) diff --git a/quantum/openstack/common/service.py b/neutron/openstack/common/service.py similarity index 96% rename from quantum/openstack/common/service.py rename to neutron/openstack/common/service.py index 188a1a0ae9..b76d355ec0 100644 --- a/quantum/openstack/common/service.py +++ b/neutron/openstack/common/service.py @@ -30,14 +30,14 @@ import eventlet import logging as std_logging from oslo.config import cfg -from quantum.openstack.common import eventlet_backdoor -from quantum.openstack.common.gettextutils import _ -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import threadgroup +from neutron.openstack.common import eventlet_backdoor +from neutron.openstack.common.gettextutils import _ +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import threadgroup -rpc = importutils.try_import('quantum.openstack.common.rpc') +rpc = importutils.try_import('neutron.openstack.common.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/threadgroup.py b/neutron/openstack/common/threadgroup.py similarity index 97% rename from quantum/openstack/common/threadgroup.py rename to neutron/openstack/common/threadgroup.py index a848f52af4..2705690422 100644 --- a/quantum/openstack/common/threadgroup.py +++ b/neutron/openstack/common/threadgroup.py @@ -18,8 +18,8 @@ from eventlet import greenlet from eventlet import greenpool from eventlet import greenthread -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall LOG = logging.getLogger(__name__) diff --git a/quantum/openstack/common/timeutils.py b/neutron/openstack/common/timeutils.py similarity index 100% rename from quantum/openstack/common/timeutils.py rename to neutron/openstack/common/timeutils.py diff --git a/quantum/openstack/common/uuidutils.py b/neutron/openstack/common/uuidutils.py similarity index 100% rename from quantum/openstack/common/uuidutils.py rename to neutron/openstack/common/uuidutils.py diff --git a/quantum/plugins/__init__.py b/neutron/plugins/__init__.py similarity index 89% rename from quantum/plugins/__init__.py rename to neutron/plugins/__init__.py index 4fce72d20f..a9badd30d7 100644 --- a/quantum/plugins/__init__.py +++ b/neutron/plugins/__init__.py @@ -19,10 +19,10 @@ import sys # catch an import error if nicira is not the configured plugin try: - from quantum.plugins import nicira + from neutron.plugins import nicira # Provide a mapping for the nicira_nvp_plugin package to ensure # backwards compatibility for configuration. - sys.modules['quantum.plugins.nicira.nicira_nvp_plugin'] = nicira + sys.modules['neutron.plugins.nicira.nicira_nvp_plugin'] = nicira except ImportError: pass diff --git a/quantum/plugins/bigswitch/README b/neutron/plugins/bigswitch/README similarity index 51% rename from quantum/plugins/bigswitch/README rename to neutron/plugins/bigswitch/README index ecdca13224..43f157d123 100644 --- a/quantum/plugins/bigswitch/README +++ b/neutron/plugins/bigswitch/README @@ -1,14 +1,14 @@ -# Quantum REST Proxy Plug-in for Big Switch and FloodLight Controllers +# Neuron REST Proxy Plug-in for Big Switch and FloodLight Controllers -This module provides a generic quantum plugin 'QuantumRestProxy' that -translates quantum function calls to authenticated REST requests (JSON supported) +This module provides a generic neutron plugin 'NeutronRestProxy' that +translates neutron function calls to authenticated REST requests (JSON supported) to a set of redundant external network controllers. -It also keeps a local persistent store of quantum state that has been +It also keeps a local persistent store of neutron state that has been setup using that API. Currently the FloodLight Openflow Controller or the Big Switch Networks Controller can be configured as external network controllers for this plugin. For more details on this plugin, please refer to the following link: -http://www.openflowhub.org/display/floodlightcontroller/Quantum+REST+Proxy+Plugin +http://www.openflowhub.org/display/floodlightcontroller/Neutron+REST+Proxy+Plugin diff --git a/quantum/plugins/bigswitch/__init__.py b/neutron/plugins/bigswitch/__init__.py similarity index 100% rename from quantum/plugins/bigswitch/__init__.py rename to neutron/plugins/bigswitch/__init__.py diff --git a/quantum/plugins/bigswitch/db/__init__.py b/neutron/plugins/bigswitch/db/__init__.py similarity index 100% rename from quantum/plugins/bigswitch/db/__init__.py rename to neutron/plugins/bigswitch/db/__init__.py diff --git a/quantum/plugins/bigswitch/db/porttracker_db.py b/neutron/plugins/bigswitch/db/porttracker_db.py similarity index 92% rename from quantum/plugins/bigswitch/db/porttracker_db.py rename to neutron/plugins/bigswitch/db/porttracker_db.py index 14d1418944..b2e3ec8079 100644 --- a/quantum/plugins/bigswitch/db/porttracker_db.py +++ b/neutron/plugins/bigswitch/db/porttracker_db.py @@ -17,9 +17,9 @@ import sqlalchemy as sa -from quantum.api.v2 import attributes -from quantum.db import model_base -from quantum.openstack.common import log as logging +from neutron.api.v2 import attributes +from neutron.db import model_base +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/bigswitch/extensions/__init__.py b/neutron/plugins/bigswitch/extensions/__init__.py similarity index 100% rename from quantum/plugins/bigswitch/extensions/__init__.py rename to neutron/plugins/bigswitch/extensions/__init__.py diff --git a/quantum/plugins/bigswitch/extensions/routerrule.py b/neutron/plugins/bigswitch/extensions/routerrule.py similarity index 94% rename from quantum/plugins/bigswitch/extensions/routerrule.py rename to neutron/plugins/bigswitch/extensions/routerrule.py index 884e3649f4..5f682de2ff 100644 --- a/quantum/plugins/bigswitch/extensions/routerrule.py +++ b/neutron/plugins/bigswitch/extensions/routerrule.py @@ -17,9 +17,9 @@ # # @author: Kevin Benton, Big Switch Networks, Inc. -from quantum.api.v2 import attributes as attr -from quantum.common import exceptions as qexception -from quantum.openstack.common import log as logging +from neutron.api.v2 import attributes as attr +from neutron.common import exceptions as qexception +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -108,7 +108,7 @@ class Routerrule(object): @classmethod def get_name(cls): - return "Quantum Router Rule" + return "Neutron Router Rule" @classmethod def get_alias(cls): @@ -120,7 +120,7 @@ class Routerrule(object): @classmethod def get_namespace(cls): - return "http://docs.openstack.org/ext/quantum/routerrules/api/v1.0" + return "http://docs.openstack.org/ext/neutron/routerrules/api/v1.0" @classmethod def get_updated(cls): diff --git a/quantum/plugins/bigswitch/plugin.py b/neutron/plugins/bigswitch/plugin.py similarity index 85% rename from quantum/plugins/bigswitch/plugin.py rename to neutron/plugins/bigswitch/plugin.py index 5476993a47..29a5fb7f95 100644 --- a/quantum/plugins/bigswitch/plugin.py +++ b/neutron/plugins/bigswitch/plugin.py @@ -18,11 +18,11 @@ # @author: Sumit Naiksatam, sumitnaiksatam@gmail.com, Big Switch Networks, Inc. """ -Quantum REST Proxy Plug-in for Big Switch and FloodLight Controllers. +Neutron REST Proxy Plug-in for Big Switch and FloodLight Controllers. -QuantumRestProxy provides a generic quantum plugin that translates all plugin +NeutronRestProxy provides a generic neutron plugin that translates all plugin function calls to equivalent authenticated REST calls to a set of redundant -external network controllers. It also keeps persistent store for all quantum +external network controllers. It also keeps persistent store for all neutron state to allow for re-sync of the external controller(s), if required. The local state on the plugin also allows for local response and fast-fail @@ -32,14 +32,14 @@ Network controller specific code is decoupled from this plugin and expected to reside on the controller itself (via the REST interface). This allows for: - - independent authentication and redundancy schemes between quantum and the + - independent authentication and redundancy schemes between neutron and the network controller - - independent upgrade/development cycles between quantum and the controller - as it limits the proxy code upgrade requirement to quantum release cycle + - independent upgrade/development cycles between neutron and the controller + as it limits the proxy code upgrade requirement to neutron release cycle and the controller specific code upgrade requirement to controller code - - ability to sync the controller with quantum for independent recovery/reset + - ability to sync the controller with neutron for independent recovery/reset -External REST API used by proxy is the same API as defined for quantum (JSON +External REST API used by proxy is the same API as defined for neutron (JSON subset) with some additional parameters (gateway on network-create and macaddr on port-attach) on an additional PUT to do a bulk dump of all persistent data. """ @@ -53,24 +53,24 @@ import socket from oslo.config import cfg -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.common import constants as const -from quantum.common import exceptions -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.common import utils -from quantum import context as qcontext -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import dhcp_rpc_base -from quantum.db import l3_db -from quantum.extensions import l3 -from quantum.extensions import portbindings -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.plugins.bigswitch.db import porttracker_db -from quantum.plugins.bigswitch import routerrule_db -from quantum.plugins.bigswitch.version import version_string_with_vcs +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.common import constants as const +from neutron.common import exceptions +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.common import utils +from neutron import context as qcontext +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import dhcp_rpc_base +from neutron.db import l3_db +from neutron.extensions import l3 +from neutron.extensions import portbindings +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.plugins.bigswitch.db import porttracker_db +from neutron.plugins.bigswitch import routerrule_db +from neutron.plugins.bigswitch.version import version_string_with_vcs LOG = logging.getLogger(__name__) @@ -99,8 +99,9 @@ restproxy_opts = [ cfg.IntOpt('server_timeout', default=10, help=_("Maximum number of seconds to wait for proxy request " "to connect and complete.")), - cfg.StrOpt('quantum_id', default='Quantum-' + utils.get_hostname(), - help=_("User defined identifier for this Quantum deployment")), + cfg.StrOpt('neutron_id', default='neutron-' + utils.get_hostname(), + deprecated_name='quantum_id', + help=_("User defined identifier for this Neutron deployment")), cfg.BoolOpt('add_meta_server_route', default=True, help=_("Flag to decide if a route to the metadata server " "should be injected into the VM")), @@ -155,11 +156,11 @@ FAILURE_CODES = [0, 301, 302, 303, 400, 401, 403, 404, 500, 501, 502, 503, 504, 505] SYNTAX_ERROR_MESSAGE = 'Syntax error in server config file, aborting plugin' BASE_URI = '/networkService/v1.1' -ORCHESTRATION_SERVICE_ID = 'Quantum v2.0' +ORCHESTRATION_SERVICE_ID = 'Neutron v2.0' METADATA_SERVER_IP = '169.254.169.254' -class RemoteRestError(exceptions.QuantumException): +class RemoteRestError(exceptions.NeutronException): def __init__(self, message): if message is None: @@ -172,7 +173,7 @@ class RemoteRestError(exceptions.QuantumException): class ServerProxy(object): """REST server proxy to a network controller.""" - def __init__(self, server, port, ssl, auth, quantum_id, timeout, + def __init__(self, server, port, ssl, auth, neutron_id, timeout, base_uri, name): self.server = server self.port = port @@ -182,7 +183,7 @@ class ServerProxy(object): self.name = name self.success_codes = SUCCESS_CODES self.auth = None - self.quantum_id = quantum_id + self.neutron_id = neutron_id if auth: self.auth = 'Basic ' + base64.encodestring(auth).strip() @@ -194,8 +195,8 @@ class ServerProxy(object): headers = {} headers['Content-type'] = 'application/json' headers['Accept'] = 'application/json' - headers['QuantumProxy-Agent'] = self.name - headers['Instance-ID'] = self.quantum_id + headers['NeutronProxy-Agent'] = self.name + headers['Instance-ID'] = self.neutron_id headers['Orchestration-Service-ID'] = ORCHESTRATION_SERVICE_ID if self.auth: headers['Authorization'] = self.auth @@ -251,20 +252,20 @@ class ServerProxy(object): class ServerPool(object): - def __init__(self, servers, ssl, auth, quantum_id, timeout=10, - base_uri='/quantum/v1.0', name='QuantumRestProxy'): + def __init__(self, servers, ssl, auth, neutron_id, timeout=10, + base_uri='/quantum/v1.0', name='NeutronRestProxy'): self.base_uri = base_uri self.timeout = timeout self.name = name self.auth = auth self.ssl = ssl - self.quantum_id = quantum_id + self.neutron_id = neutron_id self.servers = [] for server_port in servers: self.servers.append(self.server_proxy_for(*server_port)) def server_proxy_for(self, server, port): - return ServerProxy(server, port, self.ssl, self.auth, self.quantum_id, + return ServerProxy(server, port, self.ssl, self.auth, self.neutron_id, self.timeout, self.base_uri, self.name) def server_failure(self, resp): @@ -328,13 +329,13 @@ class RpcProxy(dhcp_rpc_base.DhcpRpcCallbackMixin): return q_rpc.PluginRpcDispatcher([self]) -class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, +class NeutronRestProxyV2(db_base_plugin_v2.NeutronDbPluginV2, routerrule_db.RouterRule_db_mixin): supported_extension_aliases = ["router", "binding", "router_rules"] def __init__(self, server_timeout=None): - LOG.info(_('QuantumRestProxy: Starting plugin. Version=%s'), + LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'), version_string_with_vcs()) # init DB, proxy's persistent store defaults to in-memory sql-lite DB @@ -347,7 +348,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, server_auth = cfg.CONF.RESTPROXY.server_auth server_ssl = cfg.CONF.RESTPROXY.server_ssl sync_data = cfg.CONF.RESTPROXY.sync_data - quantum_id = cfg.CONF.RESTPROXY.quantum_id + neutron_id = cfg.CONF.RESTPROXY.neutron_id self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route timeout = cfg.CONF.RESTPROXY.server_timeout if server_timeout is not None: @@ -360,7 +361,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, assert all(len(s) == 2 for s in servers), SYNTAX_ERROR_MESSAGE # init network ctrl connections - self.servers = ServerPool(servers, server_ssl, server_auth, quantum_id, + self.servers = ServerPool(servers, server_ssl, server_auth, neutron_id, timeout, BASE_URI) # init dhcp support @@ -376,7 +377,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, self._send_all_data() self._dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI() - LOG.debug(_("QuantumRestProxyV2: initialization done")) + LOG.debug(_("NeutronRestProxyV2: initialization done")) def create_network(self, context, network): """Create a network. @@ -384,7 +385,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, Network represents an L2 network segment which can have a set of subnets and ports associated with it. - :param context: quantum api request context + :param context: neutron api request context :param network: dictionary describing the network :returns: a sequence of mappings with the following signature: @@ -402,7 +403,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2: create_network() called")) + LOG.debug(_("NeutronRestProxyV2: create_network() called")) self._warn_on_state_status(network['network']) @@ -412,7 +413,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, session = context.session with session.begin(subtransactions=True): # create network in DB - new_net = super(QuantumRestProxyV2, self).create_network(context, + new_net = super(NeutronRestProxyV2, self).create_network(context, network) self._process_l3_create(context, new_net, network['network']) @@ -427,9 +428,9 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2:Unable to create remote " + LOG.error(_("NeutronRestProxyV2:Unable to create remote " "network: %s"), e.message) - super(QuantumRestProxyV2, self).delete_network(context, + super(NeutronRestProxyV2, self).delete_network(context, new_net['id']) raise @@ -439,7 +440,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, def update_network(self, context, net_id, network): """Updates the properties of a particular Virtual Network. - :param context: quantum api request context + :param context: neutron api request context :param net_id: uuid of the network to update :param network: dictionary describing the updates @@ -459,15 +460,15 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: exceptions.NetworkNotFound :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2.update_network() called")) + LOG.debug(_("NeutronRestProxyV2.update_network() called")) self._warn_on_state_status(network['network']) session = context.session with session.begin(subtransactions=True): - orig_net = super(QuantumRestProxyV2, self).get_network(context, + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) - new_net = super(QuantumRestProxyV2, self).update_network(context, + new_net = super(NeutronRestProxyV2, self).update_network(context, net_id, network) self._process_l3_update(context, new_net, network['network']) @@ -476,10 +477,10 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, try: self._send_update_network(new_net) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to update remote " + LOG.error(_("NeutronRestProxyV2: Unable to update remote " "network: %s"), e.message) # reset network to original state - super(QuantumRestProxyV2, self).update_network(context, id, + super(NeutronRestProxyV2, self).update_network(context, id, orig_net) raise @@ -488,7 +489,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, def delete_network(self, context, net_id): """Delete a network. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the network to delete. :returns: None @@ -497,10 +498,10 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: exceptions.NetworkNotFound :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2: delete_network() called")) + LOG.debug(_("NeutronRestProxyV2: delete_network() called")) # Validate args - orig_net = super(QuantumRestProxyV2, self).get_network(context, net_id) + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) tenant_id = orig_net["tenant_id"] filter = {'network_id': [net_id]} @@ -520,18 +521,18 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, ret = self.servers.delete(resource) if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) - ret_val = super(QuantumRestProxyV2, self).delete_network(context, + ret_val = super(NeutronRestProxyV2, self).delete_network(context, net_id) return ret_val except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to update remote " + LOG.error(_("NeutronRestProxyV2: Unable to update remote " "network: %s"), e.message) raise def create_port(self, context, port): """Create a port, which is a connection point of a device - (e.g., a VM NIC) to attach to a L2 Quantum network. - :param context: quantum api request context + (e.g., a VM NIC) to attach to a L2 Neutron network. + :param context: neutron api request context :param port: dictionary describing the port :returns: @@ -554,7 +555,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: exceptions.StateInvalid :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2: create_port() called")) + LOG.debug(_("NeutronRestProxyV2: create_port() called")) # Update DB port["port"]["admin_state_up"] = False @@ -562,8 +563,8 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, and 'device_id' in port['port']): porttracker_db.put_port_hostid(context, port['port']['device_id'], port['port'][portbindings.HOST_ID]) - new_port = super(QuantumRestProxyV2, self).create_port(context, port) - net = super(QuantumRestProxyV2, + new_port = super(NeutronRestProxyV2, self).create_port(context, port) + net = super(NeutronRestProxyV2, self).get_network(context, new_port["network_id"]) if self.add_meta_server_route: @@ -589,29 +590,29 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, net["tenant_id"], net["id"], new_port["id"], device_id) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to create remote port: " + LOG.error(_("NeutronRestProxyV2: Unable to create remote port: " "%s"), e.message) - super(QuantumRestProxyV2, self).delete_port(context, + super(NeutronRestProxyV2, self).delete_port(context, new_port["id"]) raise # Set port state up and return that port port_update = {"port": {"admin_state_up": True}} - new_port = super(QuantumRestProxyV2, self).update_port(context, + new_port = super(NeutronRestProxyV2, self).update_port(context, new_port["id"], port_update) return self._extend_port_dict_binding(context, new_port) def get_port(self, context, id, fields=None): with context.session.begin(subtransactions=True): - port = super(QuantumRestProxyV2, self).get_port(context, id, + port = super(NeutronRestProxyV2, self).get_port(context, id, fields) self._extend_port_dict_binding(context, port) return self._fields(port, fields) def get_ports(self, context, filters=None, fields=None): with context.session.begin(subtransactions=True): - ports = super(QuantumRestProxyV2, self).get_ports(context, filters, + ports = super(NeutronRestProxyV2, self).get_ports(context, filters, fields) for port in ports: self._extend_port_dict_binding(context, port) @@ -620,7 +621,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, def update_port(self, context, port_id, port): """Update values of a port. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the port to update. :param port: dictionary with keys indicating fields to update. @@ -644,15 +645,15 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: exceptions.PortNotFound :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2: update_port() called")) + LOG.debug(_("NeutronRestProxyV2: update_port() called")) self._warn_on_state_status(port['port']) # Validate Args - orig_port = super(QuantumRestProxyV2, self).get_port(context, port_id) + orig_port = super(NeutronRestProxyV2, self).get_port(context, port_id) # Update DB - new_port = super(QuantumRestProxyV2, self).update_port(context, + new_port = super(NeutronRestProxyV2, self).update_port(context, port_id, port) if (portbindings.HOST_ID in port['port'] and 'device_id' in port['port']): @@ -680,10 +681,10 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, new_port["id"], device_id) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to create remote port: " + LOG.error(_("NeutronRestProxyV2: Unable to create remote port: " "%s"), e.message) # reset port to original state - super(QuantumRestProxyV2, self).update_port(context, port_id, + super(NeutronRestProxyV2, self).update_port(context, port_id, orig_port) raise @@ -693,7 +694,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, def delete_port(self, context, port_id, l3_port_check=True): """Delete a port. - :param context: quantum api request context + :param context: neutron api request context :param id: UUID representing the port to delete. :raises: exceptions.PortInUse @@ -701,7 +702,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: exceptions.NetworkNotFound :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2: delete_port() called")) + LOG.debug(_("NeutronRestProxyV2: delete_port() called")) # if needed, check to see if this is a port owned by # and l3-router. If so, we should prevent deletion. @@ -709,14 +710,14 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, self.prevent_l3_port_deletion(context, port_id) self.disassociate_floatingips(context, port_id) - super(QuantumRestProxyV2, self).delete_port(context, port_id) + super(NeutronRestProxyV2, self).delete_port(context, port_id) def _delete_port(self, context, port_id): # Delete from DB - port = super(QuantumRestProxyV2, self).get_port(context, port_id) + port = super(NeutronRestProxyV2, self).get_port(context, port_id) tenant_id = port['tenant_id'] if tenant_id == '': - net = super(QuantumRestProxyV2, + net = super(NeutronRestProxyV2, self).get_network(context, port['network_id']) tenant_id = net['tenant_id'] @@ -731,11 +732,11 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if port.get("device_id"): self._unplug_interface(context, tenant_id, port["network_id"], port["id"]) - ret_val = super(QuantumRestProxyV2, self)._delete_port(context, + ret_val = super(NeutronRestProxyV2, self)._delete_port(context, port_id) return ret_val except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to update remote port: " + LOG.error(_("NeutronRestProxyV2: Unable to update remote port: " "%s"), e.message) raise @@ -752,11 +753,11 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: exceptions.PortNotFound :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2: _plug_interface() called")) + LOG.debug(_("NeutronRestProxyV2: _plug_interface() called")) # update attachment on network controller try: - port = super(QuantumRestProxyV2, self).get_port(context, port_id) + port = super(NeutronRestProxyV2, self).get_port(context, port_id) mac = port["mac_address"] if mac is not None: @@ -770,7 +771,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2:Unable to update remote network: " + LOG.error(_("NeutronRestProxyV2:Unable to update remote network: " "%s"), e.message) raise @@ -784,7 +785,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, :raises: RemoteRestError """ - LOG.debug(_("QuantumRestProxyV2: _unplug_interface() called")) + LOG.debug(_("NeutronRestProxyV2: _unplug_interface() called")) # delete from network ctrl. Remote error on delete is ignored try: @@ -793,60 +794,60 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to update remote port: " + LOG.error(_("NeutronRestProxyV2: Unable to update remote port: " "%s"), e.message) def create_subnet(self, context, subnet): - LOG.debug(_("QuantumRestProxyV2: create_subnet() called")) + LOG.debug(_("NeutronRestProxyV2: create_subnet() called")) self._warn_on_state_status(subnet['subnet']) # create subnet in DB - new_subnet = super(QuantumRestProxyV2, self).create_subnet(context, + new_subnet = super(NeutronRestProxyV2, self).create_subnet(context, subnet) net_id = new_subnet['network_id'] - orig_net = super(QuantumRestProxyV2, self).get_network(context, + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) # update network on network controller try: self._send_update_network(orig_net) except RemoteRestError: # rollback creation of subnet - super(QuantumRestProxyV2, self).delete_subnet(context, + super(NeutronRestProxyV2, self).delete_subnet(context, subnet['id']) raise return new_subnet def update_subnet(self, context, id, subnet): - LOG.debug(_("QuantumRestProxyV2: update_subnet() called")) + LOG.debug(_("NeutronRestProxyV2: update_subnet() called")) self._warn_on_state_status(subnet['subnet']) - orig_subnet = super(QuantumRestProxyV2, self)._get_subnet(context, id) + orig_subnet = super(NeutronRestProxyV2, self)._get_subnet(context, id) # update subnet in DB - new_subnet = super(QuantumRestProxyV2, self).update_subnet(context, id, + new_subnet = super(NeutronRestProxyV2, self).update_subnet(context, id, subnet) net_id = new_subnet['network_id'] - orig_net = super(QuantumRestProxyV2, self).get_network(context, + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) # update network on network controller try: self._send_update_network(orig_net) except RemoteRestError: # rollback updation of subnet - super(QuantumRestProxyV2, self).update_subnet(context, id, + super(NeutronRestProxyV2, self).update_subnet(context, id, orig_subnet) raise return new_subnet def delete_subnet(self, context, id): - LOG.debug(_("QuantumRestProxyV2: delete_subnet() called")) - orig_subnet = super(QuantumRestProxyV2, self).get_subnet(context, id) + LOG.debug(_("NeutronRestProxyV2: delete_subnet() called")) + orig_subnet = super(NeutronRestProxyV2, self).get_subnet(context, id) net_id = orig_subnet['network_id'] # delete subnet in DB - super(QuantumRestProxyV2, self).delete_subnet(context, id) - orig_net = super(QuantumRestProxyV2, self).get_network(context, + super(NeutronRestProxyV2, self).delete_subnet(context, id) + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) # update network on network controller try: @@ -882,7 +883,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, return defaultset def create_router(self, context, router): - LOG.debug(_("QuantumRestProxyV2: create_router() called")) + LOG.debug(_("NeutronRestProxyV2: create_router() called")) self._warn_on_state_status(router['router']) @@ -893,7 +894,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, router['router']['router_rules'] = rules # create router in DB - new_router = super(QuantumRestProxyV2, self).create_router(context, + new_router = super(NeutronRestProxyV2, self).create_router(context, router) # create router on the network controller @@ -907,9 +908,9 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to create remote router: " + LOG.error(_("NeutronRestProxyV2: Unable to create remote router: " "%s"), e.message) - super(QuantumRestProxyV2, self).delete_router(context, + super(NeutronRestProxyV2, self).delete_router(context, new_router['id']) raise @@ -918,14 +919,14 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, def update_router(self, context, router_id, router): - LOG.debug(_("QuantumRestProxyV2.update_router() called")) + LOG.debug(_("NeutronRestProxyV2.update_router() called")) self._warn_on_state_status(router['router']) - orig_router = super(QuantumRestProxyV2, self).get_router(context, + orig_router = super(NeutronRestProxyV2, self).get_router(context, router_id) tenant_id = orig_router["tenant_id"] - new_router = super(QuantumRestProxyV2, self).update_router(context, + new_router = super(NeutronRestProxyV2, self).update_router(context, router_id, router) @@ -940,10 +941,10 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to update remote router: " + LOG.error(_("NeutronRestProxyV2: Unable to update remote router: " "%s"), e.message) # reset router to original state - super(QuantumRestProxyV2, self).update_router(context, + super(NeutronRestProxyV2, self).update_router(context, router_id, orig_router) raise @@ -952,7 +953,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, return new_router def delete_router(self, context, router_id): - LOG.debug(_("QuantumRestProxyV2: delete_router() called")) + LOG.debug(_("NeutronRestProxyV2: delete_router() called")) with context.session.begin(subtransactions=True): orig_router = self._get_router(context, router_id) @@ -979,24 +980,24 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, ret = self.servers.delete(resource) if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) - ret_val = super(QuantumRestProxyV2, self).delete_router(context, + ret_val = super(NeutronRestProxyV2, self).delete_router(context, router_id) return ret_val except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to delete remote router: " + LOG.error(_("NeutronRestProxyV2: Unable to delete remote router: " "%s"), e.message) raise def add_router_interface(self, context, router_id, interface_info): - LOG.debug(_("QuantumRestProxyV2: add_router_interface() called")) + LOG.debug(_("NeutronRestProxyV2: add_router_interface() called")) # Validate args router = self._get_router(context, router_id) tenant_id = router['tenant_id'] # create interface in DB - new_interface_info = super(QuantumRestProxyV2, + new_interface_info = super(NeutronRestProxyV2, self).add_router_interface(context, router_id, interface_info) @@ -1017,9 +1018,9 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to create interface: " + LOG.error(_("NeutronRestProxyV2: Unable to create interface: " "%s"), e.message) - super(QuantumRestProxyV2, + super(NeutronRestProxyV2, self).remove_router_interface(context, router_id, interface_info) raise @@ -1028,7 +1029,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, def remove_router_interface(self, context, router_id, interface_info): - LOG.debug(_("QuantumRestProxyV2: remove_router_interface() called")) + LOG.debug(_("NeutronRestProxyV2: remove_router_interface() called")) # Validate args router = self._get_router(context, router_id) @@ -1049,7 +1050,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, raise exceptions.BadRequest(resource='router', msg=msg) # remove router in DB - del_intf_info = super(QuantumRestProxyV2, + del_intf_info = super(NeutronRestProxyV2, self).remove_router_interface(context, router_id, interface_info) @@ -1061,7 +1062,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2:Unable to delete remote intf: " + LOG.error(_("NeutronRestProxyV2:Unable to delete remote intf: " "%s"), e.message) raise @@ -1069,22 +1070,22 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, return del_intf_info def create_floatingip(self, context, floatingip): - LOG.debug(_("QuantumRestProxyV2: create_floatingip() called")) + LOG.debug(_("NeutronRestProxyV2: create_floatingip() called")) # create floatingip in DB - new_fl_ip = super(QuantumRestProxyV2, + new_fl_ip = super(NeutronRestProxyV2, self).create_floatingip(context, floatingip) net_id = new_fl_ip['floating_network_id'] - orig_net = super(QuantumRestProxyV2, self).get_network(context, + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) # create floatingip on the network controller try: self._send_update_network(orig_net) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to create remote " + LOG.error(_("NeutronRestProxyV2: Unable to create remote " "floatin IP: %s"), e.message) - super(QuantumRestProxyV2, self).delete_floatingip(context, + super(NeutronRestProxyV2, self).delete_floatingip(context, floatingip) raise @@ -1092,38 +1093,38 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, return new_fl_ip def update_floatingip(self, context, id, floatingip): - LOG.debug(_("QuantumRestProxyV2: update_floatingip() called")) + LOG.debug(_("NeutronRestProxyV2: update_floatingip() called")) - orig_fl_ip = super(QuantumRestProxyV2, self).get_floatingip(context, + orig_fl_ip = super(NeutronRestProxyV2, self).get_floatingip(context, id) # update floatingip in DB - new_fl_ip = super(QuantumRestProxyV2, + new_fl_ip = super(NeutronRestProxyV2, self).update_floatingip(context, id, floatingip) net_id = new_fl_ip['floating_network_id'] - orig_net = super(QuantumRestProxyV2, self).get_network(context, + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) # update network on network controller try: self._send_update_network(orig_net) except RemoteRestError: # rollback updation of subnet - super(QuantumRestProxyV2, self).update_floatingip(context, id, + super(NeutronRestProxyV2, self).update_floatingip(context, id, orig_fl_ip) raise return new_fl_ip def delete_floatingip(self, context, id): - LOG.debug(_("QuantumRestProxyV2: delete_floatingip() called")) + LOG.debug(_("NeutronRestProxyV2: delete_floatingip() called")) - orig_fl_ip = super(QuantumRestProxyV2, self).get_floatingip(context, + orig_fl_ip = super(NeutronRestProxyV2, self).get_floatingip(context, id) # delete floating IP in DB net_id = orig_fl_ip['floating_network_id'] - super(QuantumRestProxyV2, self).delete_floatingip(context, id) + super(NeutronRestProxyV2, self).delete_floatingip(context, id) - orig_net = super(QuantumRestProxyV2, self).get_network(context, + orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) # update network on network controller try: @@ -1136,13 +1137,13 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, """Pushes all data to network ctrl (networks/ports, ports/attachments). This gives the controller an option to re-sync it's persistent store - with quantum's current view of that data. + with neutron's current view of that data. """ admin_context = qcontext.get_admin_context() networks = [] routers = [] - all_networks = super(QuantumRestProxyV2, + all_networks = super(NeutronRestProxyV2, self).get_networks(admin_context) or [] for net in all_networks: mapped_network = self._get_mapped_network_with_subnets(net) @@ -1150,7 +1151,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, ports = [] net_filter = {'network_id': [net.get('id')]} - net_ports = super(QuantumRestProxyV2, + net_ports = super(NeutronRestProxyV2, self).get_ports(admin_context, filters=net_filter) or [] for port in net_ports: @@ -1164,7 +1165,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, networks.append(net_fl_ips) - all_routers = super(QuantumRestProxyV2, + all_routers = super(NeutronRestProxyV2, self).get_routers(admin_context) or [] for router in all_routers: interfaces = [] @@ -1173,7 +1174,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, 'device_owner': ["network:router_interface"], 'device_id': [router.get('id')] } - router_ports = super(QuantumRestProxyV2, + router_ports = super(NeutronRestProxyV2, self).get_ports(admin_context, filters=router_filter) or [] for port in router_ports: @@ -1198,7 +1199,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, raise RemoteRestError(ret[2]) return ret except RemoteRestError as e: - LOG.error(_('QuantumRestProxy: Unable to update remote ' + LOG.error(_('NeutronRestProxy: Unable to update remote ' 'topology: %s'), e.message) raise @@ -1224,7 +1225,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, net_id = network['id'] net_filter = {'floating_network_id': [net_id]} - fl_ips = super(QuantumRestProxyV2, + fl_ips = super(NeutronRestProxyV2, self).get_floatingips(admin_context, filters=net_filter) or [] network['floatingips'] = fl_ips @@ -1277,7 +1278,7 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: - LOG.error(_("QuantumRestProxyV2: Unable to update remote " + LOG.error(_("NeutronRestProxyV2: Unable to update remote " "network: %s"), e.message) raise @@ -1308,9 +1309,9 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, # we will use the network id as interface's id net_id = intf_id - network = super(QuantumRestProxyV2, self).get_network(context, + network = super(NeutronRestProxyV2, self).get_network(context, net_id) - subnet = super(QuantumRestProxyV2, self).get_subnet(context, + subnet = super(NeutronRestProxyV2, self).get_subnet(context, subnet_id) mapped_network = self._get_mapped_network_with_subnets(network) mapped_subnet = self._map_state_and_status(subnet) diff --git a/quantum/plugins/bigswitch/routerrule_db.py b/neutron/plugins/bigswitch/routerrule_db.py similarity index 97% rename from quantum/plugins/bigswitch/routerrule_db.py rename to neutron/plugins/bigswitch/routerrule_db.py index 70261c6e92..1e6b4b9339 100644 --- a/quantum/plugins/bigswitch/routerrule_db.py +++ b/neutron/plugins/bigswitch/routerrule_db.py @@ -19,10 +19,10 @@ from oslo.config import cfg import sqlalchemy as sa from sqlalchemy import orm -from quantum.db import l3_db -from quantum.db import model_base -from quantum.openstack.common import log as logging -from quantum.plugins.bigswitch.extensions import routerrule +from neutron.db import l3_db +from neutron.db import model_base +from neutron.openstack.common import log as logging +from neutron.plugins.bigswitch.extensions import routerrule LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/bigswitch/tests/__init__.py b/neutron/plugins/bigswitch/tests/__init__.py similarity index 100% rename from quantum/plugins/bigswitch/tests/__init__.py rename to neutron/plugins/bigswitch/tests/__init__.py diff --git a/quantum/plugins/bigswitch/tests/test_server.py b/neutron/plugins/bigswitch/tests/test_server.py similarity index 99% rename from quantum/plugins/bigswitch/tests/test_server.py rename to neutron/plugins/bigswitch/tests/test_server.py index ee7cb8f9a0..e37d6ea3dd 100755 --- a/quantum/plugins/bigswitch/tests/test_server.py +++ b/neutron/plugins/bigswitch/tests/test_server.py @@ -20,7 +20,7 @@ """Test server mocking a REST based network ctrl. -Used for QuantumRestProxy tests +Used for NeutronRestProxy tests """ import json diff --git a/quantum/plugins/bigswitch/vcsversion.py b/neutron/plugins/bigswitch/vcsversion.py similarity index 90% rename from quantum/plugins/bigswitch/vcsversion.py rename to neutron/plugins/bigswitch/vcsversion.py index 651594179e..6ed5e26808 100644 --- a/quantum/plugins/bigswitch/vcsversion.py +++ b/neutron/plugins/bigswitch/vcsversion.py @@ -16,12 +16,12 @@ # # @author: Sumit Naiksatam, sumitnaiksatam@gmail.com # -version_info = {'branch_nick': u'quantum/trunk', +version_info = {'branch_nick': u'neutron/trunk', 'revision_id': u'1', 'revno': 0} -QUANTUMRESTPROXY_VERSION = ['2013', '1', None] +NEUTRONRESTPROXY_VERSION = ['2013', '1', None] FINAL = False # This becomes true at Release Candidate time diff --git a/quantum/plugins/bigswitch/version.py b/neutron/plugins/bigswitch/version.py similarity index 80% rename from quantum/plugins/bigswitch/version.py rename to neutron/plugins/bigswitch/version.py index 5ea183f9fb..fa0ca26cc6 100755 --- a/quantum/plugins/bigswitch/version.py +++ b/neutron/plugins/bigswitch/version.py @@ -19,30 +19,30 @@ # Based on openstack generic code # @author: Mandeep Dhami, Big Switch Networks, Inc. -"""Determine version of QuantumRestProxy plugin""" +"""Determine version of NeutronRestProxy plugin""" # if vcsversion exists, use it. Else, use LOCALBRANCH:LOCALREVISION try: - from quantum.plugins.bigswitch.vcsversion import version_info + from neutron.plugins.bigswitch.vcsversion import version_info except ImportError: version_info = {'branch_nick': u'LOCALBRANCH', 'revision_id': u'LOCALREVISION', 'revno': 0} try: - from quantum.plugins.bigswitch.vcsversion import QUANTUMRESTPROXY_VERSION + from neutron.plugins.bigswitch.vcsversion import NeutronRestPROXY_VERSION except ImportError: - QUANTUMRESTPROXY_VERSION = ['2013', '1', None] + NeutronRestPROXY_VERSION = ['2013', '1', None] try: - from quantum.plugins.bigswitch.vcsversion import FINAL + from neutron.plugins.bigswitch.vcsversion import FINAL except ImportError: FINAL = False # This becomes true at Release Candidate time -YEAR, COUNT, REVISION = QUANTUMRESTPROXY_VERSION +YEAR, COUNT, REVISION = NeutronRestPROXY_VERSION def canonical_version_string(): - return '.'.join(filter(None, QUANTUMRESTPROXY_VERSION)) + return '.'.join(filter(None, NeutronRestPROXY_VERSION)) def version_string(): diff --git a/quantum/plugins/brocade/QuantumPlugin.py b/neutron/plugins/brocade/NeutronPlugin.py similarity index 90% rename from quantum/plugins/brocade/QuantumPlugin.py rename to neutron/plugins/brocade/NeutronPlugin.py index 1495088db4..04ed7fb29d 100644 --- a/quantum/plugins/brocade/QuantumPlugin.py +++ b/neutron/plugins/brocade/NeutronPlugin.py @@ -23,40 +23,40 @@ # TODO(shiv) need support for security groups -"""Implentation of Brocade Quantum Plugin.""" +"""Implentation of Brocade Neutron Plugin.""" from oslo.config import cfg -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.common import utils -from quantum.db import agents_db -from quantum.db import agentschedulers_db -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import dhcp_rpc_base -from quantum.db import extraroute_db -from quantum.db import l3_rpc_base -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.extensions import portbindings -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import context -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import proxy -from quantum.plugins.brocade.db import models as brocade_db -from quantum.plugins.brocade import vlanbm as vbm -from quantum import scheduler +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.common import utils +from neutron.db import agents_db +from neutron.db import agentschedulers_db +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import dhcp_rpc_base +from neutron.db import extraroute_db +from neutron.db import l3_rpc_base +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.extensions import portbindings +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import context +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import proxy +from neutron.plugins.brocade.db import models as brocade_db +from neutron.plugins.brocade import vlanbm as vbm +from neutron import scheduler LOG = logging.getLogger(__name__) PLUGIN_VERSION = 0.88 AGENT_OWNER_PREFIX = "network:" -NOS_DRIVER = 'quantum.plugins.brocade.nos.nosdriver.NOSdriver' +NOS_DRIVER = 'neutron.plugins.brocade.nos.nosdriver.NOSdriver' SWITCH_OPTS = [cfg.StrOpt('address', default=''), cfg.StrOpt('username', default=''), @@ -100,7 +100,7 @@ class BridgeRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin, # an argument to this function; # # need to be fixed in: - # file: quantum/db/securtygroups_rpc_base.py + # file: neutron/db/securtygroups_rpc_base.py # function: securitygroup_rules_for_devices() # which needs to pass context to us @@ -194,11 +194,11 @@ class AgentNotifierApi(proxy.RpcProxy, topic=self.topic_port_update) -class BrocadePluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class BrocadePluginV2(db_base_plugin_v2.NeutronDbPluginV2, extraroute_db.ExtraRoute_db_mixin, sg_db_rpc.SecurityGroupServerRpcMixin, agentschedulers_db.AgentSchedulerDbMixin): - """BrocadePluginV2 is a Quantum plugin. + """BrocadePluginV2 is a Neutron plugin. Provides L2 Virtual Network functionality using VDX. Upper layer driver class that interfaces to NETCONF layer below. @@ -223,9 +223,11 @@ class BrocadePluginV2(db_base_plugin_v2.QuantumDbPluginV2, self._vlan_bitmap = vbm.VlanBitmap(self.ctxt) self._setup_rpc() self.network_scheduler = importutils.import_object( - cfg.CONF.network_scheduler_driver) + cfg.CONF.network_scheduler_driver + ) self.router_scheduler = importutils.import_object( - cfg.CONF.router_scheduler_driver) + cfg.CONF.router_scheduler_driver + ) self.brocade_init() def brocade_init(self): @@ -240,7 +242,7 @@ class BrocadePluginV2(db_base_plugin_v2.QuantumDbPluginV2, def _setup_rpc(self): # RPC support self.topic = topics.PLUGIN - self.rpc_context = context.RequestContext('quantum', 'quantum', + self.rpc_context = context.RequestContext('neutron', 'neutron', is_admin=False) self.conn = rpc.create_connection(new=True) self.callbacks = BridgeRpcCallbacks() @@ -348,10 +350,10 @@ class BrocadePluginV2(db_base_plugin_v2.QuantumDbPluginV2, bnet = brocade_db.get_network(context, network_id) vlan_id = bnet['vlan'] - quantum_port = super(BrocadePluginV2, self).create_port(context, + neutron_port = super(BrocadePluginV2, self).create_port(context, port) - interface_mac = quantum_port['mac_address'] - port_id = quantum_port['id'] + interface_mac = neutron_port['mac_address'] + port_id = neutron_port['id'] switch = self._switch @@ -375,7 +377,7 @@ class BrocadePluginV2(db_base_plugin_v2.QuantumDbPluginV2, vlan_id, tenant_id, admin_state_up) # apply any extensions - return self._extend_port_dict_binding(context, quantum_port) + return self._extend_port_dict_binding(context, neutron_port) def delete_port(self, context, port_id): with context.session.begin(subtransactions=True): diff --git a/quantum/plugins/brocade/README.md b/neutron/plugins/brocade/README.md similarity index 72% rename from quantum/plugins/brocade/README.md rename to neutron/plugins/brocade/README.md index 27a7fce666..d390c4f771 100644 --- a/quantum/plugins/brocade/README.md +++ b/neutron/plugins/brocade/README.md @@ -1,29 +1,29 @@ -Brocade Openstack Quantum Plugin +Brocade Openstack Neutron Plugin ================================ * up-to-date version of these instructions are located at: - http://wiki.openstack.org/brocade-quantum-plugin + http://wiki.openstack.org/brocade-neutron-plugin * N.B.: Please see Prerequisites section regarding ncclient (netconf client library) * Supports VCS (Virtual Cluster of Switches) -Openstack Brocade Quantum Plugin implements the Quantum v2.0 API. +Openstack Brocade Neutron Plugin implements the Neutron v2.0 API. This plugin is meant to orchestrate Brocade VCS switches running NOS, examples of these are: 1. VDX 67xx series of switches 2. VDX 87xx series of switches -Brocade Quantum plugin implements the Quantum v2.0 API. It uses NETCONF at the backend +Brocade Neutron plugin implements the Neutron v2.0 API. It uses NETCONF at the backend to configure the Brocade switch. +------------+ +------------+ +-------------+ | | | | | | | | | | | Brocade | | Openstack | v2.0 | Brocade | NETCONF | VCS Switch | - | Quantum +--------+ Quantum +----------+ | + | Neutron +--------+ Neutron +----------+ | | | | Plugin | | VDX 67xx | | | | | | VDX 87xx | | | | | | | @@ -39,11 +39,11 @@ Normally you will have your Openstack directory structure as follows: /opt/stack/nova/ /opt/stack/horizon/ ... - /opt/stack/quantum/quantum/plugins/ + /opt/stack/neutron/neutron/plugins/ Within this structure, Brocade plugin resides at: - /opt/stack/quantum/quantum/plugins/brocade + /opt/stack/neutron/neutron/plugins/brocade Prerequsites @@ -60,15 +60,15 @@ ncclient v0.3.1 - Python library for NETCONF clients available at http://github. Configuration ============= -1. Specify to Quantum that you will be using the Brocade Plugin - this is done -by setting the parameter core_plugin in Quantum: +1. Specify to Neutron that you will be using the Brocade Plugin - this is done +by setting the parameter core_plugin in Neutron: - core_plugin = quantum.plugins.brocade.QuantumPlugin.BrocadePluginV2 + core_plugin = neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2 2. Physical switch configuration parameters and Brocade specific database configuration is specified in the configuration file specified in the brocade.ini files: - % cat /etc/quantum/plugins/brocade/brocade.ini + % cat /etc/neutron/plugins/brocade/brocade.ini [SWITCH] username = admin password = password @@ -76,7 +76,7 @@ the configuration file specified in the brocade.ini files: ostype = NOS [database] - connection = mysql://root:pass@localhost/brocade_quantum?charset=utf8 + connection = mysql://root:pass@localhost/brocade_neutron?charset=utf8 (please see list of more configuration parameters in the brocade.ini file) @@ -84,10 +84,10 @@ Running Setup.py ================ Running setup.py with appropriate permissions will copy the default configuration -file to /etc/quantum/plugins/brocade/brocade.ini. This file MUST be edited to +file to /etc/neutron/plugins/brocade/brocade.ini. This file MUST be edited to suit your setup/environment. - % cd /opt/stack/quantum/quantum/plugins/brocade + % cd /opt/stack/neutron/neutron/plugins/brocade % python setup.py @@ -95,9 +95,9 @@ Devstack ======== Please see special notes for devstack at: -http://wiki.openstack.org/brocade-quantum-plugin +http://wiki.openstack.org/brocade-neutron-plugin -In order to use Brocade Quantum Plugin, add the following lines in localrc, if localrc file doe +In order to use Brocade Neutron Plugin, add the following lines in localrc, if localrc file doe not exist create one: ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,quantum,q-svc,q-agt @@ -105,8 +105,8 @@ Q_PLUGIN=brocade As part of running devstack/stack.sh, the configuration files is copied as: - % cp /opt/stack/quantum/etc/quantum/plugins/brocade/brocade.ini /etc/quantum/plugins/brocade/brocade.ini + % cp /opt/stack/neutron/etc/neutron/plugins/brocade/brocade.ini /etc/neutron/plugins/brocade/brocade.ini (hence it is important to make any changes to the configuration in: -/opt/stack/quantum/etc/quantum/plugins/brocade/brocade.ini) +/opt/stack/neutron/etc/neutron/plugins/brocade/brocade.ini) diff --git a/quantum/plugins/brocade/__init__.py b/neutron/plugins/brocade/__init__.py similarity index 100% rename from quantum/plugins/brocade/__init__.py rename to neutron/plugins/brocade/__init__.py diff --git a/quantum/plugins/brocade/db/__init__.py b/neutron/plugins/brocade/db/__init__.py similarity index 100% rename from quantum/plugins/brocade/db/__init__.py rename to neutron/plugins/brocade/db/__init__.py diff --git a/quantum/plugins/brocade/db/models.py b/neutron/plugins/brocade/db/models.py similarity index 98% rename from quantum/plugins/brocade/db/models.py rename to neutron/plugins/brocade/db/models.py index dd511420a2..d9b3663a1a 100644 --- a/quantum/plugins/brocade/db/models.py +++ b/neutron/plugins/brocade/db/models.py @@ -24,8 +24,8 @@ import sqlalchemy as sa -from quantum.db import model_base -from quantum.db import models_v2 +from neutron.db import model_base +from neutron.db import models_v2 class BrocadeNetwork(model_base.BASEV2, models_v2.HasId): diff --git a/quantum/plugins/brocade/nos/__init__.py b/neutron/plugins/brocade/nos/__init__.py similarity index 100% rename from quantum/plugins/brocade/nos/__init__.py rename to neutron/plugins/brocade/nos/__init__.py diff --git a/quantum/plugins/brocade/nos/fake_nosdriver.py b/neutron/plugins/brocade/nos/fake_nosdriver.py similarity index 95% rename from quantum/plugins/brocade/nos/fake_nosdriver.py rename to neutron/plugins/brocade/nos/fake_nosdriver.py index 5a911721ae..8984768d5a 100644 --- a/quantum/plugins/brocade/nos/fake_nosdriver.py +++ b/neutron/plugins/brocade/nos/fake_nosdriver.py @@ -23,14 +23,14 @@ """FAKE DRIVER, for unit tests purposes. Brocade NOS Driver implements NETCONF over SSHv2 for -Quantum network life-cycle management. +Neutron network life-cycle management. """ class NOSdriver(): - """NOS NETCONF interface driver for Quantum network. + """NOS NETCONF interface driver for Neutron network. - Fake: Handles life-cycle management of Quantum network, + Fake: Handles life-cycle management of Neutron network, leverages AMPP on NOS (for use by unit tests, avoids touching any hardware) """ diff --git a/quantum/plugins/brocade/nos/nctemplates.py b/neutron/plugins/brocade/nos/nctemplates.py similarity index 99% rename from quantum/plugins/brocade/nos/nctemplates.py rename to neutron/plugins/brocade/nos/nctemplates.py index de7437c19a..48071dbcd9 100644 --- a/quantum/plugins/brocade/nos/nctemplates.py +++ b/neutron/plugins/brocade/nos/nctemplates.py @@ -196,7 +196,7 @@ xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete"> # Constants # -# Port profile naming convention for Quantum networks +# Port profile naming convention for Neutron networks OS_PORT_PROFILE_NAME = "openstack-profile-{id}" # Port profile filter expressions diff --git a/quantum/plugins/brocade/nos/nosdriver.py b/neutron/plugins/brocade/nos/nosdriver.py similarity index 96% rename from quantum/plugins/brocade/nos/nosdriver.py rename to neutron/plugins/brocade/nos/nosdriver.py index 028d14dbbc..12bd9b7cad 100644 --- a/quantum/plugins/brocade/nos/nosdriver.py +++ b/neutron/plugins/brocade/nos/nosdriver.py @@ -21,13 +21,13 @@ """Brocade NOS Driver implements NETCONF over SSHv2 for -Quantum network life-cycle management. +Neutron network life-cycle management. """ from ncclient import manager -from quantum.openstack.common import log as logging -from quantum.plugins.brocade.nos import nctemplates as template +from neutron.openstack.common import log as logging +from neutron.plugins.brocade.nos import nctemplates as template LOG = logging.getLogger(__name__) @@ -45,9 +45,9 @@ def nos_unknown_host_cb(host, fingerprint): class NOSdriver(): - """NOS NETCONF interface driver for Quantum network. + """NOS NETCONF interface driver for Neutron network. - Handles life-cycle management of Quantum network (leverages AMPP on NOS) + Handles life-cycle management of Neutron network (leverages AMPP on NOS) """ def __init__(self): diff --git a/quantum/plugins/brocade/tests/README b/neutron/plugins/brocade/tests/README similarity index 82% rename from quantum/plugins/brocade/tests/README rename to neutron/plugins/brocade/tests/README index 16072799a1..476ca0535a 100644 --- a/quantum/plugins/brocade/tests/README +++ b/neutron/plugins/brocade/tests/README @@ -1,9 +1,9 @@ -Start the quantum-server with IP address of switch configured in brocade.ini: +Start the neutron-server with IP address of switch configured in brocade.ini: (for configuration instruction please see README.md in the above directory) nostest.py: This tests two things: - 1. Creates port-profile on the physical switch when a quantum 'network' is created + 1. Creates port-profile on the physical switch when a neutron 'network' is created 2. Associates the MAC address with the created port-profile noscli.py: diff --git a/quantum/plugins/brocade/tests/noscli.py b/neutron/plugins/brocade/tests/noscli.py similarity index 96% rename from quantum/plugins/brocade/tests/noscli.py rename to neutron/plugins/brocade/tests/noscli.py index 9df8512b32..a009e3c0a8 100644 --- a/quantum/plugins/brocade/tests/noscli.py +++ b/neutron/plugins/brocade/tests/noscli.py @@ -24,8 +24,8 @@ import argparse -from quantum.openstack.common import log as logging -from quantum.plugins.brocade.nos import nosdriver as nos +from neutron.openstack.common import log as logging +from neutron.plugins.brocade.nos import nosdriver as nos LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/brocade/tests/nostest.py b/neutron/plugins/brocade/tests/nostest.py similarity index 94% rename from quantum/plugins/brocade/tests/nostest.py rename to neutron/plugins/brocade/tests/nostest.py index c95bf3a16b..22dd1e2c03 100644 --- a/quantum/plugins/brocade/tests/nostest.py +++ b/neutron/plugins/brocade/tests/nostest.py @@ -21,14 +21,14 @@ """Brocade NOS Driver Test.""" import sys -from quantum.plugins.brocade.nos import nosdriver as nos +from neutron.plugins.brocade.nos import nosdriver as nos def nostest(host, username, password): # Driver driver = nos.NOSdriver() - # Quantum operations + # Neutron operations vlan = 1001 mac = '0050.56bf.0001' driver.create_network(host, username, password, vlan) diff --git a/quantum/plugins/brocade/vlanbm.py b/neutron/plugins/brocade/vlanbm.py similarity index 95% rename from quantum/plugins/brocade/vlanbm.py rename to neutron/plugins/brocade/vlanbm.py index b4431d4951..37a43a1126 100644 --- a/quantum/plugins/brocade/vlanbm.py +++ b/neutron/plugins/brocade/vlanbm.py @@ -22,8 +22,8 @@ """A Vlan Bitmap class to handle allocation/de-allocation of vlan ids.""" -from quantum.common import constants -from quantum.plugins.brocade.db import models as brocade_db +from neutron.common import constants +from neutron.plugins.brocade.db import models as brocade_db MIN_VLAN = constants.MIN_VLAN_TAG + 1 diff --git a/neutron/plugins/cisco/README b/neutron/plugins/cisco/README new file mode 100644 index 0000000000..2bedb75b10 --- /dev/null +++ b/neutron/plugins/cisco/README @@ -0,0 +1,7 @@ +Cisco Neutron Virtual Network Plugin + +This plugin implements Neutron v2 APIs and helps configure +topologies consisting of virtual and physical switches. + +For more details on use please refer to: +http://wiki.openstack.org/cisco-neutron diff --git a/quantum/plugins/cisco/__init__.py b/neutron/plugins/cisco/__init__.py similarity index 100% rename from quantum/plugins/cisco/__init__.py rename to neutron/plugins/cisco/__init__.py diff --git a/quantum/plugins/cisco/common/__init__.py b/neutron/plugins/cisco/common/__init__.py similarity index 100% rename from quantum/plugins/cisco/common/__init__.py rename to neutron/plugins/cisco/common/__init__.py diff --git a/quantum/plugins/cisco/common/cisco_constants.py b/neutron/plugins/cisco/common/cisco_constants.py similarity index 100% rename from quantum/plugins/cisco/common/cisco_constants.py rename to neutron/plugins/cisco/common/cisco_constants.py diff --git a/quantum/plugins/cisco/common/cisco_credentials_v2.py b/neutron/plugins/cisco/common/cisco_credentials_v2.py similarity index 91% rename from quantum/plugins/cisco/common/cisco_credentials_v2.py rename to neutron/plugins/cisco/common/cisco_credentials_v2.py index bfc8a76c55..be1749afd4 100644 --- a/quantum/plugins/cisco/common/cisco_credentials_v2.py +++ b/neutron/plugins/cisco/common/cisco_credentials_v2.py @@ -18,10 +18,10 @@ import logging as LOG -from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_exceptions as cexc -from quantum.plugins.cisco.common import config -from quantum.plugins.cisco.db import network_db_v2 as cdb +from neutron.plugins.cisco.common import cisco_constants as const +from neutron.plugins.cisco.common import cisco_exceptions as cexc +from neutron.plugins.cisco.common import config +from neutron.plugins.cisco.db import network_db_v2 as cdb LOG.basicConfig(level=LOG.WARN) diff --git a/quantum/plugins/cisco/common/cisco_exceptions.py b/neutron/plugins/cisco/common/cisco_exceptions.py similarity index 75% rename from quantum/plugins/cisco/common/cisco_exceptions.py rename to neutron/plugins/cisco/common/cisco_exceptions.py index e33fa65e69..bde3ea7feb 100644 --- a/quantum/plugins/cisco/common/cisco_exceptions.py +++ b/neutron/plugins/cisco/common/cisco_exceptions.py @@ -19,82 +19,82 @@ """Exceptions used by the Cisco plugin.""" -from quantum.common import exceptions +from neutron.common import exceptions -class NetworkSegmentIDNotFound(exceptions.QuantumException): +class NetworkSegmentIDNotFound(exceptions.NeutronException): """Segmentation ID for network is not found.""" message = _("Segmentation ID for network %(net_id)s is not found.") -class NoMoreNics(exceptions.QuantumException): +class NoMoreNics(exceptions.NeutronException): """No more dynamic nics are available in the system.""" message = _("Unable to complete operation. No more dynamic nics are " "available in the system.") -class NetworkVlanBindingAlreadyExists(exceptions.QuantumException): +class NetworkVlanBindingAlreadyExists(exceptions.NeutronException): """Binding cannot be created, since it already exists.""" message = _("NetworkVlanBinding for %(vlan_id)s and network " "%(network_id)s already exists") -class VlanIDNotFound(exceptions.QuantumException): +class VlanIDNotFound(exceptions.NeutronException): """VLAN ID cannot be found.""" message = _("Vlan ID %(vlan_id)s not found") -class VlanIDNotAvailable(exceptions.QuantumException): +class VlanIDNotAvailable(exceptions.NeutronException): """No VLAN ID available.""" message = _("No Vlan ID available") -class QosNotFound(exceptions.QuantumException): +class QosNotFound(exceptions.NeutronException): """QoS level with this ID cannot be found.""" message = _("QoS level %(qos_id)s could not be found " "for tenant %(tenant_id)s") -class QosNameAlreadyExists(exceptions.QuantumException): +class QosNameAlreadyExists(exceptions.NeutronException): """QoS Name already exists.""" message = _("QoS level with name %(qos_name)s already exists " "for tenant %(tenant_id)s") -class CredentialNotFound(exceptions.QuantumException): +class CredentialNotFound(exceptions.NeutronException): """Credential with this ID cannot be found.""" message = _("Credential %(credential_id)s could not be found " "for tenant %(tenant_id)s") -class CredentialNameNotFound(exceptions.QuantumException): +class CredentialNameNotFound(exceptions.NeutronException): """Credential Name could not be found.""" message = _("Credential %(credential_name)s could not be found " "for tenant %(tenant_id)s") -class CredentialAlreadyExists(exceptions.QuantumException): +class CredentialAlreadyExists(exceptions.NeutronException): """Credential ID already exists.""" message = _("Credential %(credential_id)s already exists " "for tenant %(tenant_id)s") -class NexusComputeHostNotConfigured(exceptions.QuantumException): +class NexusComputeHostNotConfigured(exceptions.NeutronException): """Connection to compute host is not configured.""" message = _("Connection to %(host)s is not configured.") -class NexusConnectFailed(exceptions.QuantumException): +class NexusConnectFailed(exceptions.NeutronException): """Failed to connect to Nexus switch.""" message = _("Unable to connect to Nexus %(nexus_host)s. Reason: %(exc)s.") -class NexusConfigFailed(exceptions.QuantumException): +class NexusConfigFailed(exceptions.NeutronException): """Failed to configure Nexus switch.""" message = _("Failed to configure Nexus: %(config)s. Reason: %(exc)s.") -class NexusPortBindingNotFound(exceptions.QuantumException): +class NexusPortBindingNotFound(exceptions.NeutronException): """NexusPort Binding is not present.""" message = _("Nexus Port Binding (%(filters)s) is not present") @@ -103,31 +103,31 @@ class NexusPortBindingNotFound(exceptions.QuantumException): super(NexusPortBindingNotFound, self).__init__(filters=filters) -class NoNexusSviSwitch(exceptions.QuantumException): +class NoNexusSviSwitch(exceptions.NeutronException): """No usable nexus switch found.""" message = _("No usable Nexus switch found to create SVI interface") -class PortVnicBindingAlreadyExists(exceptions.QuantumException): +class PortVnicBindingAlreadyExists(exceptions.NeutronException): """PortVnic Binding already exists.""" message = _("PortVnic Binding %(port_id)s already exists") -class PortVnicNotFound(exceptions.QuantumException): +class PortVnicNotFound(exceptions.NeutronException): """PortVnic Binding is not present.""" message = _("PortVnic Binding %(port_id)s is not present") -class SubnetNotSpecified(exceptions.QuantumException): +class SubnetNotSpecified(exceptions.NeutronException): """Subnet id not specified.""" message = _("No subnet_id specified for router gateway") -class SubnetInterfacePresent(exceptions.QuantumException): +class SubnetInterfacePresent(exceptions.NeutronException): """Subnet SVI interface already exists.""" message = _("Subnet %(subnet_id)s has an interface on %(router_id)s") -class PortIdForNexusSvi(exceptions.QuantumException): +class PortIdForNexusSvi(exceptions.NeutronException): """Port Id specified for Nexus SVI.""" message = _('Nexus hardware router gateway only uses Subnet Ids') diff --git a/quantum/plugins/cisco/common/cisco_faults.py b/neutron/plugins/cisco/common/cisco_faults.py similarity index 97% rename from quantum/plugins/cisco/common/cisco_faults.py rename to neutron/plugins/cisco/common/cisco_faults.py index 9c3df25335..80e787e418 100644 --- a/quantum/plugins/cisco/common/cisco_faults.py +++ b/neutron/plugins/cisco/common/cisco_faults.py @@ -18,7 +18,7 @@ import webob.dec -from quantum import wsgi +from neutron import wsgi class Fault(webob.exc.HTTPException): @@ -47,7 +47,7 @@ class Fault(webob.exc.HTTPException): """ # Replace the body with fault details. code = self.wrapped_exc.status_int - fault_name = self._fault_names.get(code, "quantumServiceFault") + fault_name = self._fault_names.get(code, "neutronServiceFault") fault_data = { fault_name: { 'code': code, diff --git a/quantum/plugins/cisco/common/cisco_utils.py b/neutron/plugins/cisco/common/cisco_utils.py similarity index 95% rename from quantum/plugins/cisco/common/cisco_utils.py rename to neutron/plugins/cisco/common/cisco_utils.py index 1fa04be219..82bd8bf2ab 100644 --- a/quantum/plugins/cisco/common/cisco_utils.py +++ b/neutron/plugins/cisco/common/cisco_utils.py @@ -19,7 +19,7 @@ import hashlib import logging -from quantum.plugins.cisco.common import cisco_constants as const +from neutron.plugins.cisco.common import cisco_constants as const LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/cisco/common/config.py b/neutron/plugins/cisco/common/config.py similarity index 89% rename from quantum/plugins/cisco/common/config.py rename to neutron/plugins/cisco/common/config.py index 38f0cd3910..6708de8757 100644 --- a/quantum/plugins/cisco/common/config.py +++ b/neutron/plugins/cisco/common/config.py @@ -16,16 +16,16 @@ from oslo.config import cfg -from quantum.agent.common import config +from neutron.agent.common import config cisco_plugins_opts = [ cfg.StrOpt('vswitch_plugin', - default='quantum.plugins.openvswitch.ovs_quantum_plugin.' - 'OVSQuantumPluginV2', + default='neutron.plugins.openvswitch.ovs_neutron_plugin.' + 'OVSNeutronPluginV2', help=_("Virtual Switch to use")), cfg.StrOpt('nexus_plugin', - default='quantum.plugins.cisco.nexus.cisco_nexus_plugin_v2.' + default='neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.' 'NexusPlugin', help=_("Nexus Switch to use")), ] @@ -47,15 +47,15 @@ cisco_opts = [ cfg.BoolOpt('svi_round_robin', default=False, help=_("Distribute SVI interfaces over all switches")), cfg.StrOpt('model_class', - default='quantum.plugins.cisco.models.virt_phy_sw_v2.' + default='neutron.plugins.cisco.models.virt_phy_sw_v2.' 'VirtualPhysicalSwitchModelV2', help=_("Model Class")), cfg.StrOpt('manager_class', - default='quantum.plugins.cisco.segmentation.' + default='neutron.plugins.cisco.segmentation.' 'l2network_vlan_mgr_v2.L2NetworkVLANMgr', help=_("Manager Class")), cfg.StrOpt('nexus_driver', - default='quantum.plugins.cisco.test.nexus.' + default='neutron.plugins.cisco.test.nexus.' 'fake_nexus_driver.CiscoNEXUSFakeDriver', help=_("Nexus Driver Name")), ] diff --git a/quantum/plugins/cisco/db/__init__.py b/neutron/plugins/cisco/db/__init__.py similarity index 100% rename from quantum/plugins/cisco/db/__init__.py rename to neutron/plugins/cisco/db/__init__.py diff --git a/quantum/plugins/cisco/db/api.py b/neutron/plugins/cisco/db/api.py similarity index 98% rename from quantum/plugins/cisco/db/api.py rename to neutron/plugins/cisco/db/api.py index 080ec2955c..3f79754964 100644 --- a/quantum/plugins/cisco/db/api.py +++ b/neutron/plugins/cisco/db/api.py @@ -20,9 +20,9 @@ from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, exc, joinedload -from quantum.common import constants -from quantum.common import exceptions as q_exc -from quantum.plugins.cisco.db import models +from neutron.common import constants +from neutron.common import exceptions as q_exc +from neutron.plugins.cisco.db import models _ENGINE = None _MAKER = None diff --git a/quantum/plugins/cisco/db/l2network_db.py b/neutron/plugins/cisco/db/l2network_db.py similarity index 97% rename from quantum/plugins/cisco/db/l2network_db.py rename to neutron/plugins/cisco/db/l2network_db.py index 71d138465d..dd8201bb3f 100644 --- a/quantum/plugins/cisco/db/l2network_db.py +++ b/neutron/plugins/cisco/db/l2network_db.py @@ -17,13 +17,13 @@ from sqlalchemy.orm import exc -from quantum.common import exceptions as q_exc -from quantum.openstack.common import log as logging -from quantum.plugins.cisco.common import cisco_exceptions as c_exc -from quantum.plugins.cisco.common import config -from quantum.plugins.cisco.db import l2network_models +from neutron.common import exceptions as q_exc +from neutron.openstack.common import log as logging +from neutron.plugins.cisco.common import cisco_exceptions as c_exc +from neutron.plugins.cisco.common import config +from neutron.plugins.cisco.db import l2network_models -import quantum.plugins.cisco.db.api as db +import neutron.plugins.cisco.db.api as db LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/cisco/db/l2network_models.py b/neutron/plugins/cisco/db/l2network_models.py similarity index 97% rename from quantum/plugins/cisco/db/l2network_models.py rename to neutron/plugins/cisco/db/l2network_models.py index da46777b81..a552837232 100644 --- a/quantum/plugins/cisco/db/l2network_models.py +++ b/neutron/plugins/cisco/db/l2network_models.py @@ -18,8 +18,8 @@ from sqlalchemy import Column, Integer, String, Boolean from sqlalchemy.orm import object_mapper -from quantum.openstack.common import uuidutils -from quantum.plugins.cisco.db.models import BASE +from neutron.openstack.common import uuidutils +from neutron.plugins.cisco.db.models import BASE class L2NetworkBase(object): diff --git a/quantum/plugins/cisco/db/models.py b/neutron/plugins/cisco/db/models.py similarity index 91% rename from quantum/plugins/cisco/db/models.py rename to neutron/plugins/cisco/db/models.py index 9308347d2e..ccb4a08a17 100644 --- a/quantum/plugins/cisco/db/models.py +++ b/neutron/plugins/cisco/db/models.py @@ -22,14 +22,14 @@ from sqlalchemy import Column, String, ForeignKey from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation, object_mapper -from quantum.openstack.common import uuidutils +from neutron.openstack.common import uuidutils BASE = declarative_base() -class QuantumBase(object): - """Base class for Quantum Models.""" +class NeutronBase(object): + """Base class for Neutron Models.""" __table_args__ = {'mysql_engine': 'InnoDB'} @@ -67,8 +67,8 @@ class QuantumBase(object): return local.iteritems() -class Port(BASE, QuantumBase): - """Represents a port on a quantum network.""" +class Port(BASE, NeutronBase): + """Represents a port on a neutron network.""" __tablename__ = 'ports' @@ -89,8 +89,8 @@ class Port(BASE, QuantumBase): self.state, self.interface_id) -class Network(BASE, QuantumBase): - """Represents a quantum network.""" +class Network(BASE, NeutronBase): + """Represents a neutron network.""" __tablename__ = 'networks' diff --git a/quantum/plugins/cisco/db/network_db_v2.py b/neutron/plugins/cisco/db/network_db_v2.py similarity index 96% rename from quantum/plugins/cisco/db/network_db_v2.py rename to neutron/plugins/cisco/db/network_db_v2.py index 41d0b68cd7..a80c8b5131 100644 --- a/quantum/plugins/cisco/db/network_db_v2.py +++ b/neutron/plugins/cisco/db/network_db_v2.py @@ -18,13 +18,13 @@ from sqlalchemy.orm import exc -from quantum.db import api as db -from quantum.openstack.common import log as logging -from quantum.plugins.cisco.common import cisco_exceptions as c_exc -from quantum.plugins.cisco.common import config -from quantum.plugins.cisco.db import network_models_v2 -from quantum.plugins.cisco.db import nexus_models_v2 # noqa -from quantum.plugins.openvswitch import ovs_models_v2 +from neutron.db import api as db +from neutron.openstack.common import log as logging +from neutron.plugins.cisco.common import cisco_exceptions as c_exc +from neutron.plugins.cisco.common import config +from neutron.plugins.cisco.db import network_models_v2 +from neutron.plugins.cisco.db import nexus_models_v2 # noqa +from neutron.plugins.openvswitch import ovs_models_v2 LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/cisco/db/network_models_v2.py b/neutron/plugins/cisco/db/network_models_v2.py similarity index 96% rename from quantum/plugins/cisco/db/network_models_v2.py rename to neutron/plugins/cisco/db/network_models_v2.py index 60e4b21619..a3b829760f 100644 --- a/quantum/plugins/cisco/db/network_models_v2.py +++ b/neutron/plugins/cisco/db/network_models_v2.py @@ -19,9 +19,9 @@ from sqlalchemy import Column, Integer, String, Boolean from sqlalchemy.orm import object_mapper -from quantum.db import model_base -from quantum.db import models_v2 as models # noqa -from quantum.openstack.common import uuidutils +from neutron.db import model_base +from neutron.db import models_v2 as models # noqa +from neutron.openstack.common import uuidutils class L2NetworkBase(object): diff --git a/quantum/plugins/cisco/db/nexus_db_v2.py b/neutron/plugins/cisco/db/nexus_db_v2.py similarity index 96% rename from quantum/plugins/cisco/db/nexus_db_v2.py rename to neutron/plugins/cisco/db/nexus_db_v2.py index a268937daf..8c99d7ae2d 100644 --- a/quantum/plugins/cisco/db/nexus_db_v2.py +++ b/neutron/plugins/cisco/db/nexus_db_v2.py @@ -20,10 +20,10 @@ from sqlalchemy.orm import exc -import quantum.db.api as db -from quantum.openstack.common import log as logging -from quantum.plugins.cisco.common import cisco_exceptions as c_exc -from quantum.plugins.cisco.db import nexus_models_v2 +import neutron.db.api as db +from neutron.openstack.common import log as logging +from neutron.plugins.cisco.common import cisco_exceptions as c_exc +from neutron.plugins.cisco.db import nexus_models_v2 LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/cisco/db/nexus_models_v2.py b/neutron/plugins/cisco/db/nexus_models_v2.py similarity index 94% rename from quantum/plugins/cisco/db/nexus_models_v2.py rename to neutron/plugins/cisco/db/nexus_models_v2.py index ca3710ccec..8b3d7c2914 100644 --- a/quantum/plugins/cisco/db/nexus_models_v2.py +++ b/neutron/plugins/cisco/db/nexus_models_v2.py @@ -17,8 +17,8 @@ from sqlalchemy import Column, Integer, String -from quantum.db import model_base -from quantum.plugins.cisco.db.l2network_models import L2NetworkBase +from neutron.db import model_base +from neutron.plugins.cisco.db.l2network_models import L2NetworkBase class NexusPortBinding(model_base.BASEV2, L2NetworkBase): diff --git a/quantum/plugins/cisco/extensions/__init__.py b/neutron/plugins/cisco/extensions/__init__.py similarity index 100% rename from quantum/plugins/cisco/extensions/__init__.py rename to neutron/plugins/cisco/extensions/__init__.py diff --git a/quantum/plugins/cisco/extensions/_credential_view.py b/neutron/plugins/cisco/extensions/_credential_view.py similarity index 96% rename from quantum/plugins/cisco/extensions/_credential_view.py rename to neutron/plugins/cisco/extensions/_credential_view.py index 04eea64e17..9dcbbc81ed 100644 --- a/quantum/plugins/cisco/extensions/_credential_view.py +++ b/neutron/plugins/cisco/extensions/_credential_view.py @@ -24,7 +24,7 @@ def get_view_builder(req): class ViewBuilder(object): - """ViewBuilder for Credential, derived from quantum.views.networks.""" + """ViewBuilder for Credential, derived from neutron.views.networks.""" def __init__(self, base_url): """Initialize builder. diff --git a/quantum/plugins/cisco/extensions/_qos_view.py b/neutron/plugins/cisco/extensions/_qos_view.py similarity index 96% rename from quantum/plugins/cisco/extensions/_qos_view.py rename to neutron/plugins/cisco/extensions/_qos_view.py index 93472adaed..81ef5fef61 100644 --- a/quantum/plugins/cisco/extensions/_qos_view.py +++ b/neutron/plugins/cisco/extensions/_qos_view.py @@ -24,7 +24,7 @@ def get_view_builder(req): class ViewBuilder(object): - """ViewBuilder for QoS, derived from quantum.views.networks.""" + """ViewBuilder for QoS, derived from neutron.views.networks.""" def __init__(self, base_url): """Initialize builder. diff --git a/quantum/plugins/cisco/extensions/credential.py b/neutron/plugins/cisco/extensions/credential.py similarity index 91% rename from quantum/plugins/cisco/extensions/credential.py rename to neutron/plugins/cisco/extensions/credential.py index c727407800..f06563cfac 100644 --- a/quantum/plugins/cisco/extensions/credential.py +++ b/neutron/plugins/cisco/extensions/credential.py @@ -20,14 +20,14 @@ from webob import exc -from quantum.api import api_common as common -from quantum.api import extensions -from quantum.manager import QuantumManager -from quantum.plugins.cisco.common import cisco_exceptions as exception -from quantum.plugins.cisco.common import cisco_faults as faults -from quantum.plugins.cisco.extensions import (_credential_view as +from neutron.api import api_common as common +from neutron.api import extensions +from neutron.manager import NeutronManager +from neutron.plugins.cisco.common import cisco_exceptions as exception +from neutron.plugins.cisco.common import cisco_faults as faults +from neutron.plugins.cisco.extensions import (_credential_view as credential_view) -from quantum import wsgi +from neutron import wsgi class Credential(extensions.ExtensionDescriptor): @@ -63,13 +63,13 @@ class Credential(extensions.ExtensionDescriptor): """Returns Ext Resources.""" parent_resource = dict(member_name="tenant", collection_name="extensions/csco/tenants") - controller = CredentialController(QuantumManager.get_plugin()) + controller = CredentialController(NeutronManager.get_plugin()) return [extensions.ResourceExtension('credentials', controller, parent=parent_resource)] -class CredentialController(common.QuantumController, wsgi.Controller): - """Credential API controller based on QuantumController.""" +class CredentialController(common.NeutronController, wsgi.Controller): + """Credential API controller based on NeutronController.""" _credential_ops_param_list = [ {'param-name': 'credential_name', 'required': True}, diff --git a/quantum/plugins/cisco/extensions/qos.py b/neutron/plugins/cisco/extensions/qos.py similarity index 90% rename from quantum/plugins/cisco/extensions/qos.py rename to neutron/plugins/cisco/extensions/qos.py index 1c53b378c8..4db5a7a62e 100644 --- a/quantum/plugins/cisco/extensions/qos.py +++ b/neutron/plugins/cisco/extensions/qos.py @@ -20,13 +20,13 @@ from webob import exc -from quantum.api import api_common as common -from quantum.api import extensions -from quantum.manager import QuantumManager -from quantum.plugins.cisco.common import cisco_exceptions as exception -from quantum.plugins.cisco.common import cisco_faults as faults -from quantum.plugins.cisco.extensions import _qos_view as qos_view -from quantum import wsgi +from neutron.api import api_common as common +from neutron.api import extensions +from neutron.manager import NeutronManager +from neutron.plugins.cisco.common import cisco_exceptions as exception +from neutron.plugins.cisco.common import cisco_faults as faults +from neutron.plugins.cisco.extensions import _qos_view as qos_view +from neutron import wsgi class Qos(extensions.ExtensionDescriptor): @@ -63,13 +63,13 @@ class Qos(extensions.ExtensionDescriptor): parent_resource = dict(member_name="tenant", collection_name="extensions/csco/tenants") - controller = QosController(QuantumManager.get_plugin()) + controller = QosController(NeutronManager.get_plugin()) return [extensions.ResourceExtension('qoss', controller, parent=parent_resource)] -class QosController(common.QuantumController, wsgi.Controller): - """qos API controller based on QuantumController.""" +class QosController(common.NeutronController, wsgi.Controller): + """qos API controller based on NeutronController.""" _qos_ops_param_list = [ {'param-name': 'qos_name', 'required': True}, diff --git a/quantum/plugins/cisco/l2device_plugin_base.py b/neutron/plugins/cisco/l2device_plugin_base.py similarity index 100% rename from quantum/plugins/cisco/l2device_plugin_base.py rename to neutron/plugins/cisco/l2device_plugin_base.py diff --git a/quantum/plugins/cisco/models/__init__.py b/neutron/plugins/cisco/models/__init__.py similarity index 100% rename from quantum/plugins/cisco/models/__init__.py rename to neutron/plugins/cisco/models/__init__.py diff --git a/quantum/plugins/cisco/models/virt_phy_sw_v2.py b/neutron/plugins/cisco/models/virt_phy_sw_v2.py similarity index 97% rename from quantum/plugins/cisco/models/virt_phy_sw_v2.py rename to neutron/plugins/cisco/models/virt_phy_sw_v2.py index 3642cd7d68..8d65580660 100644 --- a/quantum/plugins/cisco/models/virt_phy_sw_v2.py +++ b/neutron/plugins/cisco/models/virt_phy_sw_v2.py @@ -26,21 +26,21 @@ import sys from novaclient.v1_1 import client as nova_client from oslo.config import cfg -from quantum.db import api as db_api -from quantum.openstack.common import importutils -from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_credentials_v2 as cred -from quantum.plugins.cisco.common import cisco_exceptions as cexc -from quantum.plugins.cisco.common import config as conf -from quantum.plugins.cisco.db import network_db_v2 as cdb -from quantum.plugins.openvswitch import ovs_db_v2 as odb -from quantum import quantum_plugin_base_v2 +from neutron.db import api as db_api +from neutron import neutron_plugin_base_v2 +from neutron.openstack.common import importutils +from neutron.plugins.cisco.common import cisco_constants as const +from neutron.plugins.cisco.common import cisco_credentials_v2 as cred +from neutron.plugins.cisco.common import cisco_exceptions as cexc +from neutron.plugins.cisco.common import config as conf +from neutron.plugins.cisco.db import network_db_v2 as cdb +from neutron.plugins.openvswitch import ovs_db_v2 as odb LOG = logging.getLogger(__name__) -class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): +class VirtualPhysicalSwitchModelV2(neutron_plugin_base_v2.NeutronPluginBaseV2): """Virtual Physical Switch Model. This implementation works with OVS and Nexus plugin for the diff --git a/quantum/plugins/cisco/network_plugin.py b/neutron/plugins/cisco/network_plugin.py similarity index 96% rename from quantum/plugins/cisco/network_plugin.py rename to neutron/plugins/cisco/network_plugin.py index 2985be448c..ecbbf71633 100644 --- a/quantum/plugins/cisco/network_plugin.py +++ b/neutron/plugins/cisco/network_plugin.py @@ -22,20 +22,20 @@ import logging from sqlalchemy import orm import webob.exc as wexc -from quantum.api.v2 import base -from quantum.common import exceptions as exc -from quantum.db import db_base_plugin_v2 -from quantum.db import models_v2 -from quantum.openstack.common import importutils -from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_exceptions as cexc -from quantum.plugins.cisco.common import config # noqa -from quantum.plugins.cisco.db import network_db_v2 as cdb +from neutron.api.v2 import base +from neutron.common import exceptions as exc +from neutron.db import db_base_plugin_v2 +from neutron.db import models_v2 +from neutron.openstack.common import importutils +from neutron.plugins.cisco.common import cisco_constants as const +from neutron.plugins.cisco.common import cisco_exceptions as cexc +from neutron.plugins.cisco.common import config # noqa +from neutron.plugins.cisco.db import network_db_v2 as cdb LOG = logging.getLogger(__name__) -class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): +class PluginV2(db_base_plugin_v2.NeutronDbPluginV2): """Meta-Plugin with v2 API support for multiple sub-plugins.""" supported_extension_aliases = ["Cisco Credential", "Cisco qos"] @@ -118,7 +118,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): (self._model, name)) def _extend_fault_map(self): - """Extend the Quantum Fault Map for Cisco exceptions. + """Extend the Neutron Fault Map for Cisco exceptions. Map exceptions which are specific to the Cisco Plugin to standard HTTP exceptions. diff --git a/quantum/plugins/cisco/nexus/__init__.py b/neutron/plugins/cisco/nexus/__init__.py similarity index 100% rename from quantum/plugins/cisco/nexus/__init__.py rename to neutron/plugins/cisco/nexus/__init__.py diff --git a/quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py b/neutron/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py similarity index 96% rename from quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py rename to neutron/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py index a92681a2eb..61daa738a2 100644 --- a/quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py +++ b/neutron/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py @@ -25,11 +25,11 @@ import logging from ncclient import manager -from quantum.openstack.common import excutils -from quantum.plugins.cisco.common import cisco_exceptions as cexc -from quantum.plugins.cisco.db import network_db_v2 as cdb -from quantum.plugins.cisco.db import nexus_db_v2 -from quantum.plugins.cisco.nexus import cisco_nexus_snippets as snipp +from neutron.openstack.common import excutils +from neutron.plugins.cisco.common import cisco_exceptions as cexc +from neutron.plugins.cisco.db import network_db_v2 as cdb +from neutron.plugins.cisco.db import nexus_db_v2 +from neutron.plugins.cisco.nexus import cisco_nexus_snippets as snipp LOG = logging.getLogger(__name__) @@ -62,7 +62,7 @@ class CiscoNEXUSDriver(): if exc_str in str(e): break else: - # Raise a Quantum exception. Include a description of + # Raise a Neutron exception. Include a description of # the original ncclient exception. raise cexc.NexusConfigFailed(config=config, exc=e) @@ -79,7 +79,7 @@ class CiscoNEXUSDriver(): password=nexus_password) self.connections[nexus_host] = man except Exception as e: - # Raise a Quantum exception. Include a description of + # Raise a Neutron exception. Include a description of # the original ncclient exception. raise cexc.NexusConnectFailed(nexus_host=nexus_host, exc=e) diff --git a/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py b/neutron/plugins/cisco/nexus/cisco_nexus_plugin_v2.py similarity index 96% rename from quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py rename to neutron/plugins/cisco/nexus/cisco_nexus_plugin_v2.py index 568a0e8b64..48dcf95409 100644 --- a/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py +++ b/neutron/plugins/cisco/nexus/cisco_nexus_plugin_v2.py @@ -26,15 +26,15 @@ PlugIn for Nexus OS driver import logging -from quantum.common import exceptions as exc -from quantum.openstack.common import excutils -from quantum.openstack.common import importutils -from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_credentials_v2 as cred -from quantum.plugins.cisco.common import cisco_exceptions as cisco_exc -from quantum.plugins.cisco.common import config as conf -from quantum.plugins.cisco.db import nexus_db_v2 as nxos_db -from quantum.plugins.cisco.l2device_plugin_base import L2DevicePluginBase +from neutron.common import exceptions as exc +from neutron.openstack.common import excutils +from neutron.openstack.common import importutils +from neutron.plugins.cisco.common import cisco_constants as const +from neutron.plugins.cisco.common import cisco_credentials_v2 as cred +from neutron.plugins.cisco.common import cisco_exceptions as cisco_exc +from neutron.plugins.cisco.common import config as conf +from neutron.plugins.cisco.db import nexus_db_v2 as nxos_db +from neutron.plugins.cisco.l2device_plugin_base import L2DevicePluginBase LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/cisco/nexus/cisco_nexus_snippets.py b/neutron/plugins/cisco/nexus/cisco_nexus_snippets.py similarity index 100% rename from quantum/plugins/cisco/nexus/cisco_nexus_snippets.py rename to neutron/plugins/cisco/nexus/cisco_nexus_snippets.py diff --git a/quantum/plugins/linuxbridge/__init__.py b/neutron/plugins/cisco/test/__init__.py similarity index 100% rename from quantum/plugins/linuxbridge/__init__.py rename to neutron/plugins/cisco/test/__init__.py diff --git a/quantum/plugins/cisco/test/nexus/__init__.py b/neutron/plugins/cisco/test/nexus/__init__.py similarity index 100% rename from quantum/plugins/cisco/test/nexus/__init__.py rename to neutron/plugins/cisco/test/nexus/__init__.py diff --git a/quantum/plugins/cisco/test/nexus/fake_nexus_driver.py b/neutron/plugins/cisco/test/nexus/fake_nexus_driver.py similarity index 100% rename from quantum/plugins/cisco/test/nexus/fake_nexus_driver.py rename to neutron/plugins/cisco/test/nexus/fake_nexus_driver.py diff --git a/quantum/plugins/common/__init__.py b/neutron/plugins/common/__init__.py similarity index 100% rename from quantum/plugins/common/__init__.py rename to neutron/plugins/common/__init__.py diff --git a/quantum/plugins/common/constants.py b/neutron/plugins/common/constants.py similarity index 100% rename from quantum/plugins/common/constants.py rename to neutron/plugins/common/constants.py diff --git a/quantum/plugins/common/utils.py b/neutron/plugins/common/utils.py similarity index 96% rename from quantum/plugins/common/utils.py rename to neutron/plugins/common/utils.py index f5651b3897..0daffad22a 100644 --- a/quantum/plugins/common/utils.py +++ b/neutron/plugins/common/utils.py @@ -18,8 +18,8 @@ Common utilities and helper functions for Openstack Networking Plugins. """ -from quantum.common import exceptions as q_exc -from quantum.common import utils +from neutron.common import exceptions as q_exc +from neutron.common import utils def verify_vlan_range(vlan_range): diff --git a/quantum/plugins/hyperv/__init__.py b/neutron/plugins/hyperv/__init__.py similarity index 100% rename from quantum/plugins/hyperv/__init__.py rename to neutron/plugins/hyperv/__init__.py diff --git a/quantum/plugins/hyperv/agent/__init__.py b/neutron/plugins/hyperv/agent/__init__.py similarity index 100% rename from quantum/plugins/hyperv/agent/__init__.py rename to neutron/plugins/hyperv/agent/__init__.py diff --git a/quantum/plugins/hyperv/agent/hyperv_quantum_agent.py b/neutron/plugins/hyperv/agent/hyperv_neutron_agent.py similarity index 96% rename from quantum/plugins/hyperv/agent/hyperv_quantum_agent.py rename to neutron/plugins/hyperv/agent/hyperv_neutron_agent.py index b340d24219..ec6843d8b5 100644 --- a/quantum/plugins/hyperv/agent/hyperv_quantum_agent.py +++ b/neutron/plugins/hyperv/agent/hyperv_neutron_agent.py @@ -26,14 +26,14 @@ import time from oslo.config import cfg -from quantum.agent import rpc as agent_rpc -from quantum.common import config as logging_config -from quantum.common import topics -from quantum import context -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import dispatcher -from quantum.plugins.hyperv.agent import utils -from quantum.plugins.hyperv.common import constants +from neutron.agent import rpc as agent_rpc +from neutron.common import config as logging_config +from neutron.common import topics +from neutron import context +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import dispatcher +from neutron.plugins.hyperv.agent import utils +from neutron.plugins.hyperv.common import constants LOG = logging.getLogger(__name__) @@ -58,7 +58,7 @@ CONF = cfg.CONF CONF.register_opts(agent_opts, "AGENT") -class HyperVQuantumAgent(object): +class HyperVNeutronAgent(object): # Set RPC API version to 1.0 by default. RPC_API_VERSION = '1.0' @@ -336,10 +336,10 @@ class HyperVQuantumAgent(object): def main(): eventlet.monkey_patch() - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') logging_config.setup_logging(cfg.CONF) - plugin = HyperVQuantumAgent() + plugin = HyperVNeutronAgent() # Start everything. LOG.info(_("Agent initialized successfully, now running... ")) diff --git a/quantum/plugins/hyperv/agent/utils.py b/neutron/plugins/hyperv/agent/utils.py similarity index 98% rename from quantum/plugins/hyperv/agent/utils.py rename to neutron/plugins/hyperv/agent/utils.py index 860a08f703..f9e41bfac6 100644 --- a/quantum/plugins/hyperv/agent/utils.py +++ b/neutron/plugins/hyperv/agent/utils.py @@ -23,8 +23,8 @@ import time from oslo.config import cfg -from quantum.common import exceptions as q_exc -from quantum.openstack.common import log as logging +from neutron.common import exceptions as q_exc +from neutron.openstack.common import log as logging # Check needed for unit testing on Unix if sys.platform == 'win32': @@ -34,7 +34,7 @@ CONF = cfg.CONF LOG = logging.getLogger(__name__) -class HyperVException(q_exc.QuantumException): +class HyperVException(q_exc.NeutronException): message = _('HyperVException: %(msg)s') WMI_JOB_STATE_RUNNING = 4 diff --git a/quantum/plugins/hyperv/agent_notifier_api.py b/neutron/plugins/hyperv/agent_notifier_api.py similarity index 94% rename from quantum/plugins/hyperv/agent_notifier_api.py rename to neutron/plugins/hyperv/agent_notifier_api.py index 016ad6a83d..f90fe248e6 100644 --- a/quantum/plugins/hyperv/agent_notifier_api.py +++ b/neutron/plugins/hyperv/agent_notifier_api.py @@ -16,10 +16,10 @@ # under the License. # @author: Alessandro Pilotti, Cloudbase Solutions Srl -from quantum.common import topics -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import proxy -from quantum.plugins.hyperv.common import constants +from neutron.common import topics +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import proxy +from neutron.plugins.hyperv.common import constants LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/hyperv/common/__init__.py b/neutron/plugins/hyperv/common/__init__.py similarity index 100% rename from quantum/plugins/hyperv/common/__init__.py rename to neutron/plugins/hyperv/common/__init__.py diff --git a/quantum/plugins/hyperv/common/constants.py b/neutron/plugins/hyperv/common/constants.py similarity index 100% rename from quantum/plugins/hyperv/common/constants.py rename to neutron/plugins/hyperv/common/constants.py diff --git a/quantum/plugins/hyperv/db.py b/neutron/plugins/hyperv/db.py similarity index 97% rename from quantum/plugins/hyperv/db.py rename to neutron/plugins/hyperv/db.py index 8e36c7ea61..81ca4ab8b5 100644 --- a/quantum/plugins/hyperv/db.py +++ b/neutron/plugins/hyperv/db.py @@ -18,12 +18,12 @@ from sqlalchemy.orm import exc -from quantum.common import exceptions as q_exc -import quantum.db.api as db_api -from quantum.db import models_v2 -from quantum.openstack.common import log as logging -from quantum.plugins.hyperv.common import constants -from quantum.plugins.hyperv import model as hyperv_model +from neutron.common import exceptions as q_exc +import neutron.db.api as db_api +from neutron.db import models_v2 +from neutron.openstack.common import log as logging +from neutron.plugins.hyperv.common import constants +from neutron.plugins.hyperv import model as hyperv_model LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/hyperv/hyperv_quantum_plugin.py b/neutron/plugins/hyperv/hyperv_neutron_plugin.py similarity index 89% rename from quantum/plugins/hyperv/hyperv_quantum_plugin.py rename to neutron/plugins/hyperv/hyperv_neutron_plugin.py index 934fa1179c..fcb77c98a1 100644 --- a/quantum/plugins/hyperv/hyperv_quantum_plugin.py +++ b/neutron/plugins/hyperv/hyperv_neutron_plugin.py @@ -18,21 +18,21 @@ from oslo.config import cfg -from quantum.api.v2 import attributes -from quantum.common import exceptions as q_exc -from quantum.common import topics -from quantum.db import db_base_plugin_v2 -from quantum.db import l3_gwmode_db -from quantum.db import quota_db # noqa -from quantum.extensions import portbindings -from quantum.extensions import providernet as provider -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.plugins.common import utils as plugin_utils -from quantum.plugins.hyperv import agent_notifier_api -from quantum.plugins.hyperv.common import constants -from quantum.plugins.hyperv import db as hyperv_db -from quantum.plugins.hyperv import rpc_callbacks +from neutron.api.v2 import attributes +from neutron.common import exceptions as q_exc +from neutron.common import topics +from neutron.db import db_base_plugin_v2 +from neutron.db import l3_gwmode_db +from neutron.db import quota_db # noqa +from neutron.extensions import portbindings +from neutron.extensions import providernet as provider +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.plugins.common import utils as plugin_utils +from neutron.plugins.hyperv import agent_notifier_api +from neutron.plugins.hyperv.common import constants +from neutron.plugins.hyperv import db as hyperv_db +from neutron.plugins.hyperv import rpc_callbacks DEFAULT_VLAN_RANGES = [] @@ -140,7 +140,7 @@ class VlanNetworkProvider(BaseNetworkProvider): network[provider.SEGMENTATION_ID] = binding.segmentation_id -class HyperVQuantumPlugin(db_base_plugin_v2.QuantumDbPluginV2, +class HyperVNeutronPlugin(db_base_plugin_v2.NeutronDbPluginV2, l3_gwmode_db.L3_NAT_db_mixin): # This attribute specifies whether the plugin supports or not @@ -228,7 +228,7 @@ class HyperVQuantumPlugin(db_base_plugin_v2.QuantumDbPluginV2, network_attrs = network['network'] self._process_provider_create(context, session, network_attrs) - net = super(HyperVQuantumPlugin, self).create_network( + net = super(HyperVNeutronPlugin, self).create_network( context, network) network_type = network_attrs[provider.NETWORK_TYPE] @@ -257,7 +257,7 @@ class HyperVQuantumPlugin(db_base_plugin_v2.QuantumDbPluginV2, session = context.session with session.begin(subtransactions=True): - net = super(HyperVQuantumPlugin, self).update_network(context, id, + net = super(HyperVNeutronPlugin, self).update_network(context, id, network) self._process_l3_update(context, net, network['network']) self._extend_network_dict_provider(context, net) @@ -267,7 +267,7 @@ class HyperVQuantumPlugin(db_base_plugin_v2.QuantumDbPluginV2, session = context.session with session.begin(subtransactions=True): binding = self._db.get_network_binding(session, id) - super(HyperVQuantumPlugin, self).delete_network(context, id) + super(HyperVNeutronPlugin, self).delete_network(context, id) p = self._network_providers_map[binding.network_type] p.delete_network(session, binding) # the network_binding record is deleted via cascade from @@ -275,12 +275,12 @@ class HyperVQuantumPlugin(db_base_plugin_v2.QuantumDbPluginV2, self.notifier.network_delete(context, id) def get_network(self, context, id, fields=None): - net = super(HyperVQuantumPlugin, self).get_network(context, id, None) + net = super(HyperVNeutronPlugin, self).get_network(context, id, None) self._extend_network_dict_provider(context, net) return self._fields(net, fields) def get_networks(self, context, filters=None, fields=None): - nets = super(HyperVQuantumPlugin, self).get_networks( + nets = super(HyperVNeutronPlugin, self).get_networks( context, filters, None) for net in nets: self._extend_network_dict_provider(context, net) @@ -292,24 +292,24 @@ class HyperVQuantumPlugin(db_base_plugin_v2.QuantumDbPluginV2, return port def create_port(self, context, port): - port = super(HyperVQuantumPlugin, self).create_port(context, port) + port = super(HyperVNeutronPlugin, self).create_port(context, port) return self._extend_port_dict_binding(context, port) def get_port(self, context, id, fields=None): - port = super(HyperVQuantumPlugin, self).get_port(context, id, fields) + port = super(HyperVNeutronPlugin, self).get_port(context, id, fields) return self._fields(self._extend_port_dict_binding(context, port), fields) def get_ports(self, context, filters=None, fields=None): - ports = super(HyperVQuantumPlugin, self).get_ports( + ports = super(HyperVNeutronPlugin, self).get_ports( context, filters, fields) return [self._fields(self._extend_port_dict_binding(context, port), fields) for port in ports] def update_port(self, context, id, port): - original_port = super(HyperVQuantumPlugin, self).get_port( + original_port = super(HyperVNeutronPlugin, self).get_port( context, id) - port = super(HyperVQuantumPlugin, self).update_port(context, id, port) + port = super(HyperVNeutronPlugin, self).update_port(context, id, port) if original_port['admin_state_up'] != port['admin_state_up']: binding = self._db.get_network_binding( None, port['network_id']) @@ -326,5 +326,5 @@ class HyperVQuantumPlugin(db_base_plugin_v2.QuantumDbPluginV2, self.prevent_l3_port_deletion(context, id) self.disassociate_floatingips(context, id) - super(HyperVQuantumPlugin, self).delete_port(context, id) + super(HyperVNeutronPlugin, self).delete_port(context, id) self.notifier.port_delete(context, id) diff --git a/quantum/plugins/hyperv/model.py b/neutron/plugins/hyperv/model.py similarity index 97% rename from quantum/plugins/hyperv/model.py rename to neutron/plugins/hyperv/model.py index fac657a4ce..697e3383b9 100644 --- a/quantum/plugins/hyperv/model.py +++ b/neutron/plugins/hyperv/model.py @@ -18,7 +18,7 @@ from sqlalchemy import Boolean, Column, ForeignKey, Integer, String -from quantum.db.models_v2 import model_base +from neutron.db.models_v2 import model_base class VlanAllocation(model_base.BASEV2): diff --git a/quantum/plugins/hyperv/rpc_callbacks.py b/neutron/plugins/hyperv/rpc_callbacks.py similarity index 93% rename from quantum/plugins/hyperv/rpc_callbacks.py rename to neutron/plugins/hyperv/rpc_callbacks.py index 91f0a58950..7b26525de4 100644 --- a/quantum/plugins/hyperv/rpc_callbacks.py +++ b/neutron/plugins/hyperv/rpc_callbacks.py @@ -16,12 +16,12 @@ # under the License. # @author: Alessandro Pilotti, Cloudbase Solutions Srl -from quantum.common import constants as q_const -from quantum.common import rpc as q_rpc -from quantum.db import dhcp_rpc_base -from quantum.db import l3_rpc_base -from quantum.openstack.common import log as logging -from quantum.plugins.hyperv import db as hyperv_db +from neutron.common import constants as q_const +from neutron.common import rpc as q_rpc +from neutron.db import dhcp_rpc_base +from neutron.db import l3_rpc_base +from neutron.openstack.common import log as logging +from neutron.plugins.hyperv import db as hyperv_db LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/linuxbridge/README b/neutron/plugins/linuxbridge/README similarity index 70% rename from quantum/plugins/linuxbridge/README rename to neutron/plugins/linuxbridge/README index a5e2bca371..b7601205ff 100644 --- a/quantum/plugins/linuxbridge/README +++ b/neutron/plugins/linuxbridge/README @@ -1,28 +1,28 @@ # -- Background -The Quantum Linux Bridge plugin is a plugin that allows you to manage +The Neutron Linux Bridge plugin is a plugin that allows you to manage connectivity between VMs on hosts that are capable of running a Linux Bridge. -The Quantum Linux Bridge plugin consists of three components: +The Neutron Linux Bridge plugin consists of three components: 1) The plugin itself: The plugin uses a database backend (mysql for now) to store configuration and mappings that are used by the agent. The mysql server runs on a central server (often the same host as nova itself). -2) The quantum service host which will be running quantum. This can +2) The neutron service host which will be running neutron. This can be run on the server running nova. 3) An agent which runs on the host and communicates with the host operating system. The agent gathers the configuration and mappings from - the mysql database running on the quantum host. + the mysql database running on the neutron host. -The sections below describe how to configure and run the quantum +The sections below describe how to configure and run the neutron service with the Linux Bridge plugin. # -- Python library dependencies - Make sure you have the following package(s) installedi on quantum server + Make sure you have the following package(s) installedi on neutron server host as well as any hosts which run the agent: python-configobj bridge-utils @@ -31,10 +31,10 @@ service with the Linux Bridge plugin. # -- Nova configuration (controller node) -1) Ensure that the quantum network manager is configured in the +1) Ensure that the neutron network manager is configured in the nova.conf on the node that will be running nova-network. -network_manager=nova.network.quantum.manager.QuantumManager +network_manager=nova.network.neutron.manager.NeutronManager # -- Nova configuration (compute node(s)) @@ -43,33 +43,33 @@ network_manager=nova.network.quantum.manager.QuantumManager connection_type=libvirt libvirt_type=qemu libvirt_vif_type=ethernet -libvirt_vif_driver=nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver -linuxnet_interface_driver=nova.network.linux_net.QuantumLinuxBridgeInterfaceDriver +libvirt_vif_driver=nova.virt.libvirt.vif.NeutronLinuxBridgeVIFDriver +linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver 2) If you want a DHCP server to be run for the VMs to acquire IPs, add the following flag to your nova.conf file: -quantum_use_dhcp=true +neutron_use_dhcp=true -(Note: For more details on how to work with Quantum using Nova, i.e. how to create networks and such, - please refer to the top level Quantum README which points to the relevant documentation.) +(Note: For more details on how to work with Neutron using Nova, i.e. how to create networks and such, + please refer to the top level Neutron README which points to the relevant documentation.) -# -- Quantum configuration +# -- Neutron configuration -Make the Linux Bridge plugin the current quantum plugin +Make the Linux Bridge plugin the current neutron plugin -- edit quantum.conf and change the core_plugin +- edit neutron.conf and change the core_plugin -core_plugin = quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2 +core_plugin = neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2 # -- Database config. (Note: The plugin ships with a default SQLite in-memory database configuration, and can be used to run tests without performing the suggested DB config below.) -The Linux Bridge quantum plugin requires access to a mysql database in order +The Linux Bridge neutron plugin requires access to a mysql database in order to store configuration and mappings that will be used by the agent. Here is -how to set up the database on the host that you will be running the quantum +how to set up the database on the host that you will be running the neutron service on. MySQL should be installed on the host, and all plugins and clients @@ -77,11 +77,11 @@ must be configured with access to the database. To prep mysql, run: -$ mysql -u root -p -e "create database quantum_linux_bridge" +$ mysql -u root -p -e "create database neutron_linux_bridge" # log in to mysql service $ mysql -u root -p -# The Linux Bridge Quantum agent running on each compute node must be able to +# The Linux Bridge Neutron agent running on each compute node must be able to # make a mysql connection back to the main database server. mysql> GRANT USAGE ON *.* to root@'yourremotehost' IDENTIFIED BY 'newpassword'; # force update of authorization changes @@ -94,17 +94,17 @@ mysql> FLUSH PRIVILEGES; # -- Plugin configuration - Edit the configuration file: - etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini + etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini Make sure it matches your mysql configuration. This file must be updated with the addresses and credentials to access the database. - Note: debug and logging information should be updated in etc/quantum.conf + Note: debug and logging information should be updated in etc/neutron.conf Note: When running the tests, set the connection type to sqlite, and when actually running the server set it to mysql. At any given time, only one of these should be active in the conf file (you can comment out the other). -- On the quantum server, network_vlan_ranges must be configured in +- On the neutron server, network_vlan_ranges must be configured in linuxbridge_conf.ini to specify the names of the physical networks managed by the linuxbridge plugin, along with the ranges of VLAN IDs available on each physical network for allocation to virtual @@ -128,15 +128,15 @@ mysql> FLUSH PRIVILEGES; # -- Agent configuration - Edit the configuration file: - etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini + etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini -- Copy quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py - and etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini +- Copy neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py + and etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini to the compute node. -- Copy the quantum.conf file to the compute node +- Copy the neutron.conf file to the compute node - Note: debug and logging information should be updated in etc/quantum.conf + Note: debug and logging information should be updated in etc/neutron.conf - On each compute node, the network_interface_mappings must be configured in linuxbridge_conf.ini to map each physical network name @@ -155,15 +155,15 @@ mysql> FLUSH PRIVILEGES; $ Run the following: - python linuxbridge_quantum_agent.py --config-file quantum.conf + python linuxbridge_neutron_agent.py --config-file neutron.conf --config-file linuxbridge_conf.ini Note that the the user running the agent must have sudo priviliges to run various networking commands. Also, the agent can be - configured to use quantum-rootwrap, limiting what commands it can + configured to use neutron-rootwrap, limiting what commands it can run via sudo. See http://wiki.openstack.org/Packager/Rootwrap for details on rootwrap. - As an alternative to coping the agent python file, if quantum is + As an alternative to coping the agent python file, if neutron is installed on the compute node, the agent can be run as - bin/quantum-linuxbridge-agent. + bin/neutron-linuxbridge-agent. diff --git a/quantum/plugins/linuxbridge/agent/__init__.py b/neutron/plugins/linuxbridge/__init__.py similarity index 100% rename from quantum/plugins/linuxbridge/agent/__init__.py rename to neutron/plugins/linuxbridge/__init__.py diff --git a/quantum/plugins/nicira/dbexts/__init__.py b/neutron/plugins/linuxbridge/agent/__init__.py similarity index 100% rename from quantum/plugins/nicira/dbexts/__init__.py rename to neutron/plugins/linuxbridge/agent/__init__.py diff --git a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py similarity index 95% rename from quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py rename to neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py index 4018c460db..c71f6acdbb 100755 --- a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py +++ b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py @@ -17,9 +17,9 @@ # under the License. # # -# Performs per host Linux Bridge configuration for Quantum. +# Performs per host Linux Bridge configuration for Neutron. # Based on the structure of the OpenVSwitch agent in the -# Quantum OpenVSwitch Plugin. +# Neutron OpenVSwitch Plugin. # @author: Sumit Naiksatam, Cisco Systems, Inc. import os @@ -30,21 +30,21 @@ import eventlet from oslo.config import cfg import pyudev -from quantum.agent.linux import ip_lib -from quantum.agent.linux import utils -from quantum.agent import rpc as agent_rpc -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.common import config as logging_config -from quantum.common import constants -from quantum.common import topics -from quantum.common import utils as q_utils -from quantum import context -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall -from quantum.openstack.common.rpc import common as rpc_common -from quantum.openstack.common.rpc import dispatcher -from quantum.plugins.linuxbridge.common import config # noqa -from quantum.plugins.linuxbridge.common import constants as lconst +from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils +from neutron.agent import rpc as agent_rpc +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.common import config as logging_config +from neutron.common import constants +from neutron.common import topics +from neutron.common import utils as q_utils +from neutron import context +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall +from neutron.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.rpc import dispatcher +from neutron.plugins.linuxbridge.common import config # noqa +from neutron.plugins.linuxbridge.common import constants as lconst LOG = logging.getLogger(__name__) @@ -105,13 +105,13 @@ class LinuxBridgeManager: tap_device_name = TAP_INTERFACE_PREFIX + interface_id[0:11] return tap_device_name - def get_all_quantum_bridges(self): - quantum_bridge_list = [] + def get_all_neutron_bridges(self): + neutron_bridge_list = [] bridge_list = os.listdir(BRIDGE_FS) for bridge in bridge_list: if bridge.startswith(BRIDGE_NAME_PREFIX): - quantum_bridge_list.append(bridge) - return quantum_bridge_list + neutron_bridge_list.append(bridge) + return neutron_bridge_list def get_interfaces_on_bridge(self, bridge_name): if self.device_exists(bridge_name): @@ -120,7 +120,7 @@ class LinuxBridgeManager: return os.listdir(bridge_interface_path) def get_bridge_for_tap_device(self, tap_device_name): - bridges = self.get_all_quantum_bridges() + bridges = self.get_all_neutron_bridges() for bridge in bridges: interfaces = self.get_interfaces_on_bridge(bridge) if tap_device_name in interfaces: @@ -486,7 +486,7 @@ class LinuxBridgePluginApi(agent_rpc.PluginApi, pass -class LinuxBridgeQuantumAgentRPC(sg_rpc.SecurityGroupAgentRpcMixin): +class LinuxBridgeNeutronAgentRPC(sg_rpc.SecurityGroupAgentRpcMixin): def __init__(self, interface_mappings, polling_interval, root_helper): @@ -494,7 +494,7 @@ class LinuxBridgeQuantumAgentRPC(sg_rpc.SecurityGroupAgentRpcMixin): self.root_helper = root_helper self.setup_linux_bridge(interface_mappings) self.agent_state = { - 'binary': 'quantum-linuxbridge-agent', + 'binary': 'neutron-linuxbridge-agent', 'host': cfg.CONF.host, 'topic': constants.L2_AGENT_TOPIC, 'configurations': interface_mappings, @@ -671,7 +671,7 @@ class LinuxBridgeQuantumAgentRPC(sg_rpc.SecurityGroupAgentRpcMixin): def main(): eventlet.monkey_patch() - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') logging_config.setup_logging(cfg.CONF) try: @@ -685,7 +685,7 @@ def main(): polling_interval = cfg.CONF.AGENT.polling_interval root_helper = cfg.CONF.AGENT.root_helper - plugin = LinuxBridgeQuantumAgentRPC(interface_mappings, + plugin = LinuxBridgeNeutronAgentRPC(interface_mappings, polling_interval, root_helper) LOG.info(_("Agent initialized successfully, now running... ")) diff --git a/quantum/plugins/linuxbridge/common/__init__.py b/neutron/plugins/linuxbridge/common/__init__.py similarity index 100% rename from quantum/plugins/linuxbridge/common/__init__.py rename to neutron/plugins/linuxbridge/common/__init__.py diff --git a/quantum/plugins/linuxbridge/common/config.py b/neutron/plugins/linuxbridge/common/config.py similarity index 96% rename from quantum/plugins/linuxbridge/common/config.py rename to neutron/plugins/linuxbridge/common/config.py index 99eccc20b9..dc35f76503 100644 --- a/quantum/plugins/linuxbridge/common/config.py +++ b/neutron/plugins/linuxbridge/common/config.py @@ -19,8 +19,8 @@ from oslo.config import cfg -from quantum.agent.common import config -from quantum import scheduler +from neutron.agent.common import config +from neutron import scheduler DEFAULT_VLAN_RANGES = [] DEFAULT_INTERFACE_MAPPINGS = [] diff --git a/quantum/plugins/linuxbridge/common/constants.py b/neutron/plugins/linuxbridge/common/constants.py similarity index 100% rename from quantum/plugins/linuxbridge/common/constants.py rename to neutron/plugins/linuxbridge/common/constants.py diff --git a/quantum/plugins/linuxbridge/db/__init__.py b/neutron/plugins/linuxbridge/db/__init__.py similarity index 100% rename from quantum/plugins/linuxbridge/db/__init__.py rename to neutron/plugins/linuxbridge/db/__init__.py diff --git a/quantum/plugins/linuxbridge/db/l2network_db_v2.py b/neutron/plugins/linuxbridge/db/l2network_db_v2.py similarity index 95% rename from quantum/plugins/linuxbridge/db/l2network_db_v2.py rename to neutron/plugins/linuxbridge/db/l2network_db_v2.py index 46b1f6ec16..786fe841a1 100644 --- a/quantum/plugins/linuxbridge/db/l2network_db_v2.py +++ b/neutron/plugins/linuxbridge/db/l2network_db_v2.py @@ -16,15 +16,15 @@ from sqlalchemy.orm import exc -from quantum.common import exceptions as q_exc -import quantum.db.api as db -from quantum.db import models_v2 -from quantum.db import securitygroups_db as sg_db -from quantum import manager -from quantum.openstack.common import log as logging -from quantum.plugins.linuxbridge.common import config # noqa -from quantum.plugins.linuxbridge.common import constants -from quantum.plugins.linuxbridge.db import l2network_models_v2 +from neutron.common import exceptions as q_exc +import neutron.db.api as db +from neutron.db import models_v2 +from neutron.db import securitygroups_db as sg_db +from neutron import manager +from neutron.openstack.common import log as logging +from neutron.plugins.linuxbridge.common import config # noqa +from neutron.plugins.linuxbridge.common import constants +from neutron.plugins.linuxbridge.db import l2network_models_v2 LOG = logging.getLogger(__name__) @@ -216,7 +216,7 @@ def get_port_from_device(device): if not port_and_sgs: return port = port_and_sgs[0][0] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin._make_port_dict(port) port_dict['security_groups'] = [] for port_in_db, sg_id in port_and_sgs: diff --git a/quantum/plugins/linuxbridge/db/l2network_models_v2.py b/neutron/plugins/linuxbridge/db/l2network_models_v2.py similarity index 98% rename from quantum/plugins/linuxbridge/db/l2network_models_v2.py rename to neutron/plugins/linuxbridge/db/l2network_models_v2.py index d30485c99d..0c08e29c50 100644 --- a/quantum/plugins/linuxbridge/db/l2network_models_v2.py +++ b/neutron/plugins/linuxbridge/db/l2network_models_v2.py @@ -15,7 +15,7 @@ import sqlalchemy as sa -from quantum.db import model_base +from neutron.db import model_base class NetworkState(model_base.BASEV2): diff --git a/quantum/plugins/linuxbridge/lb_quantum_plugin.py b/neutron/plugins/linuxbridge/lb_neutron_plugin.py similarity index 92% rename from quantum/plugins/linuxbridge/lb_quantum_plugin.py rename to neutron/plugins/linuxbridge/lb_neutron_plugin.py index a54f1d0182..4d7c5cd8ec 100644 --- a/quantum/plugins/linuxbridge/lb_quantum_plugin.py +++ b/neutron/plugins/linuxbridge/lb_neutron_plugin.py @@ -17,35 +17,35 @@ import sys from oslo.config import cfg -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api -from quantum.api.v2 import attributes -from quantum.common import constants as q_const -from quantum.common import exceptions as q_exc -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.common import utils -from quantum.db import agents_db -from quantum.db import agentschedulers_db -from quantum.db import api as db_api -from quantum.db import db_base_plugin_v2 -from quantum.db import dhcp_rpc_base -from quantum.db import extraroute_db -from quantum.db import l3_gwmode_db -from quantum.db import l3_rpc_base -from quantum.db import portbindings_db -from quantum.db import quota_db # noqa -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.extensions import portbindings -from quantum.extensions import providernet as provider -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import proxy -from quantum.plugins.common import utils as plugin_utils -from quantum.plugins.linuxbridge.common import constants -from quantum.plugins.linuxbridge.db import l2network_db_v2 as db +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api +from neutron.api.v2 import attributes +from neutron.common import constants as q_const +from neutron.common import exceptions as q_exc +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.common import utils +from neutron.db import agents_db +from neutron.db import agentschedulers_db +from neutron.db import api as db_api +from neutron.db import db_base_plugin_v2 +from neutron.db import dhcp_rpc_base +from neutron.db import extraroute_db +from neutron.db import l3_gwmode_db +from neutron.db import l3_rpc_base +from neutron.db import portbindings_db +from neutron.db import quota_db # noqa +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.extensions import portbindings +from neutron.extensions import providernet as provider +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import proxy +from neutron.plugins.common import utils as plugin_utils +from neutron.plugins.linuxbridge.common import constants +from neutron.plugins.linuxbridge.db import l2network_db_v2 as db LOG = logging.getLogger(__name__) @@ -184,22 +184,22 @@ class AgentNotifierApi(proxy.RpcProxy, topic=self.topic_port_update) -class LinuxBridgePluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class LinuxBridgePluginV2(db_base_plugin_v2.NeutronDbPluginV2, extraroute_db.ExtraRoute_db_mixin, l3_gwmode_db.L3_NAT_db_mixin, sg_db_rpc.SecurityGroupServerRpcMixin, agentschedulers_db.AgentSchedulerDbMixin, portbindings_db.PortBindingMixin): - """Implement the Quantum abstractions using Linux bridging. + """Implement the Neutron abstractions using Linux bridging. A new VLAN is created for each network. An agent is relied upon to perform the actual Linux bridge configuration on each host. The provider extension is also supported. As discussed in - https://bugs.launchpad.net/quantum/+bug/1023156, this class could + https://bugs.launchpad.net/neutron/+bug/1023156, this class could be simplified, and filtering on extended attributes could be handled, by adding support for extended attributes to the - QuantumDbPluginV2 base class. When that occurs, this class should + NeutronDbPluginV2 base class. When that occurs, this class should be updated to take advantage of it. The port binding extension enables an external application relay @@ -244,9 +244,11 @@ class LinuxBridgePluginV2(db_base_plugin_v2.QuantumDbPluginV2, sys.exit(1) self._setup_rpc() self.network_scheduler = importutils.import_object( - cfg.CONF.network_scheduler_driver) + cfg.CONF.network_scheduler_driver + ) self.router_scheduler = importutils.import_object( - cfg.CONF.router_scheduler_driver) + cfg.CONF.router_scheduler_driver + ) LOG.debug(_("Linux Bridge Plugin initialization complete")) def _setup_rpc(self): diff --git a/quantum/plugins/metaplugin/README b/neutron/plugins/metaplugin/README similarity index 69% rename from quantum/plugins/metaplugin/README rename to neutron/plugins/metaplugin/README index e5d118fb2a..5b634b3903 100644 --- a/quantum/plugins/metaplugin/README +++ b/neutron/plugins/metaplugin/README @@ -9,10 +9,10 @@ This plugin also support extensions. We can map extension to plugin by using ext [database] # This line MUST be changed to actually run the plugin. # Example: -# connection = mysql://root:nova@127.0.0.1:3306/ovs_quantum +# connection = mysql://root:nova@127.0.0.1:3306/ovs_neutron # Replace 127.0.0.1 above with the IP address of the database used by the -# main quantum server. (Leave it as is if the database runs on this host.) -connection = mysql://root:password@localhost/quantum_metaplugin?charset=utf8 +# main neutron server. (Leave it as is if the database runs on this host.) +connection = mysql://root:password@localhost/neutron_metaplugin?charset=utf8 # Database reconnection retry times - in event connectivity is lost # set to -1 implgies an infinite retry count @@ -21,11 +21,11 @@ connection = mysql://root:password@localhost/quantum_metaplugin?charset=utf8 retry_interval = 2 [meta] -## This is list of flavor:quantum_plugins +## This is list of flavor:neutron_plugins # extension method is used in the order of this list -plugin_list= 'openvswitch:quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2,linuxbridge:quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2' +plugin_list= 'openvswitch:neutron.plugins.openvswitch.ovs_neutron_plugin.OVSneutronPluginV2,linuxbridge:neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2' # plugin for l3 -l3_plugin_list= 'openvswitch:quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2,linuxbridge:quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2' +l3_plugin_list= 'openvswitch:neutron.plugins.openvswitch.ovs_neutron_plugin.OVSneutronPluginV2,linuxbridge:neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2' # Default value of flavor default_flavor = 'openvswitch' @@ -43,21 +43,21 @@ extension_map = 'get_port_stats:nvp' [DEFAULT] # Meta Plugin # Mapping between flavor and driver -meta_flavor_driver_mappings = openvswitch:quantum.agent.linux.interface.OVSInterfaceDriver, linuxbridge:quantum.agent.linux.interface.BridgeInterfaceDriver +meta_flavor_driver_mappings = openvswitch:neutron.agent.linux.interface.OVSInterfaceDriver, linuxbridge:neutron.agent.linux.interface.BridgeInterfaceDriver # interface driver for MetaPlugin -interface_driver = quantum.agent.linux.interface.MetaInterfaceDriver +interface_driver = neutron.agent.linux.interface.MetaInterfaceDriver [proxy] auth_url = http://10.0.0.1:35357/v2.0 auth_region = RegionOne admin_tenant_name = service -admin_user = quantum +admin_user = neutron admin_password = password # -- Agent -Agents for Metaplugin are in quantum/plugins/metaplugin/agent -linuxbridge_quantum_agent and ovs_quantum_agent is available. +Agents for Metaplugin are in neutron/plugins/metaplugin/agent +linuxbridge_neutron_agent and ovs_neutron_agent is available. # -- Extensions @@ -75,13 +75,13 @@ Vlan ID range of each plugin should be different, since Metaplugin dose not mana #- limitations -Basically, All plugin should inherit QuantumDBPluginV2. -Metaplugin assumes all plugin share same Database expecially for IPAM part in QuantumV2 API. -You can use another plugin if you use ProxyPluginV2, which proxies request to the another quantum server. +Basically, All plugin should inherit NeutronDbPluginV2. +Metaplugin assumes all plugin share same Database expecially for IPAM part in NeutronV2 API. +You can use another plugin if you use ProxyPluginV2, which proxies request to the another neutron server. Example flavor configration for ProxyPluginV2 -meta_flavor_driver_mappings = "openvswitch:quantum.agent.linux.interface.OVSInterfaceDriver,proxy:quantum.plugins.metaplugin.proxy_quantum_plugin.ProxyPluginV2" +meta_flavor_driver_mappings = "openvswitch:neutron.agent.linux.interface.OVSInterfaceDriver,proxy:neutron.plugins.metaplugin.proxy_neutron_plugin.ProxyPluginV2" - Limited L3 support In folsom version, l3 is an extension. There is no way to extend exntension attributes. diff --git a/quantum/plugins/metaplugin/__init__.py b/neutron/plugins/metaplugin/__init__.py similarity index 100% rename from quantum/plugins/metaplugin/__init__.py rename to neutron/plugins/metaplugin/__init__.py diff --git a/quantum/plugins/metaplugin/common/__init__.py b/neutron/plugins/metaplugin/common/__init__.py similarity index 100% rename from quantum/plugins/metaplugin/common/__init__.py rename to neutron/plugins/metaplugin/common/__init__.py diff --git a/quantum/plugins/metaplugin/common/config.py b/neutron/plugins/metaplugin/common/config.py similarity index 100% rename from quantum/plugins/metaplugin/common/config.py rename to neutron/plugins/metaplugin/common/config.py diff --git a/quantum/plugins/metaplugin/meta_db_v2.py b/neutron/plugins/metaplugin/meta_db_v2.py similarity index 96% rename from quantum/plugins/metaplugin/meta_db_v2.py rename to neutron/plugins/metaplugin/meta_db_v2.py index 7f03fd259a..68c9055ff1 100644 --- a/quantum/plugins/metaplugin/meta_db_v2.py +++ b/neutron/plugins/metaplugin/meta_db_v2.py @@ -17,7 +17,7 @@ from sqlalchemy.orm import exc -from quantum.plugins.metaplugin import meta_models_v2 +from neutron.plugins.metaplugin import meta_models_v2 def get_flavor_by_network(session, net_id): diff --git a/quantum/plugins/metaplugin/meta_models_v2.py b/neutron/plugins/metaplugin/meta_models_v2.py similarity index 97% rename from quantum/plugins/metaplugin/meta_models_v2.py rename to neutron/plugins/metaplugin/meta_models_v2.py index 50c3a4361d..566d1d8d84 100644 --- a/quantum/plugins/metaplugin/meta_models_v2.py +++ b/neutron/plugins/metaplugin/meta_models_v2.py @@ -18,7 +18,7 @@ import sqlalchemy as sa from sqlalchemy import Column, String -from quantum.db import models_v2 +from neutron.db import models_v2 class NetworkFlavor(models_v2.model_base.BASEV2): diff --git a/quantum/plugins/metaplugin/meta_quantum_plugin.py b/neutron/plugins/metaplugin/meta_neutron_plugin.py similarity index 94% rename from quantum/plugins/metaplugin/meta_quantum_plugin.py rename to neutron/plugins/metaplugin/meta_neutron_plugin.py index fe428c5928..58c9f15e8d 100644 --- a/quantum/plugins/metaplugin/meta_quantum_plugin.py +++ b/neutron/plugins/metaplugin/meta_neutron_plugin.py @@ -17,18 +17,18 @@ from oslo.config import cfg -from quantum.common import exceptions as exc -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import extraroute_db -from quantum.db import l3_db -from quantum.db import models_v2 -from quantum.extensions.flavor import (FLAVOR_NETWORK, FLAVOR_ROUTER) -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.plugins.metaplugin.common import config # noqa -from quantum.plugins.metaplugin import meta_db_v2 -from quantum.plugins.metaplugin.meta_models_v2 import (NetworkFlavor, +from neutron.common import exceptions as exc +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import extraroute_db +from neutron.db import l3_db +from neutron.db import models_v2 +from neutron.extensions.flavor import (FLAVOR_NETWORK, FLAVOR_ROUTER) +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.plugins.metaplugin.common import config # noqa +from neutron.plugins.metaplugin import meta_db_v2 +from neutron.plugins.metaplugin.meta_models_v2 import (NetworkFlavor, RouterFlavor) @@ -40,11 +40,11 @@ class FlavorNotFound(exc.NotFound): message = _("Flavor %(flavor)s could not be found") -class FaildToAddFlavorBinding(exc.QuantumException): +class FaildToAddFlavorBinding(exc.NeutronException): message = _("Failed to add flavor binding") -class MetaPluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class MetaPluginV2(db_base_plugin_v2.NeutronDbPluginV2, extraroute_db.ExtraRoute_db_mixin): def __init__(self, configfile=None): @@ -64,7 +64,7 @@ class MetaPluginV2(db_base_plugin_v2.QuantumDbPluginV2, cfg._is_opt_registered = _is_opt_registered # Keep existing tables if multiple plugin use same table name. - db.model_base.QuantumBase.__table_args__ = {'keep_existing': True} + db.model_base.NeutronBase.__table_args__ = {'keep_existing': True} self.plugins = {} diff --git a/quantum/plugins/metaplugin/proxy_quantum_plugin.py b/neutron/plugins/metaplugin/proxy_neutron_plugin.py similarity index 93% rename from quantum/plugins/metaplugin/proxy_quantum_plugin.py rename to neutron/plugins/metaplugin/proxy_neutron_plugin.py index b9c603faf3..0dc5711584 100644 --- a/quantum/plugins/metaplugin/proxy_quantum_plugin.py +++ b/neutron/plugins/metaplugin/proxy_neutron_plugin.py @@ -17,24 +17,24 @@ from oslo.config import cfg -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import l3_db -from quantum.openstack.common import log as logging -from quantumclient.common import exceptions -from quantumclient.v2_0 import client +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import l3_db +from neutron.openstack.common import log as logging +from neutronclient.common import exceptions +from neutronclient.v2_0 import client LOG = logging.getLogger(__name__) -class ProxyPluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class ProxyPluginV2(db_base_plugin_v2.NeutronDbPluginV2, l3_db.L3_NAT_db_mixin): supported_extension_aliases = ["router"] def __init__(self, configfile=None): db.configure_db() - self.quantum = client.Client( + self.neutron = client.Client( username=cfg.CONF.PROXY.admin_user, password=cfg.CONF.PROXY.admin_password, tenant_name=cfg.CONF.PROXY.admin_tenant_name, @@ -44,7 +44,7 @@ class ProxyPluginV2(db_base_plugin_v2.QuantumDbPluginV2, ) def _get_client(self): - return self.quantum + return self.neutron def create_subnet(self, context, subnet): subnet_remote = self._get_client().create_subnet(subnet) diff --git a/quantum/plugins/metaplugin/run_tests.py b/neutron/plugins/metaplugin/run_tests.py similarity index 78% rename from quantum/plugins/metaplugin/run_tests.py rename to neutron/plugins/metaplugin/run_tests.py index 2d22b417be..ac647569c0 100755 --- a/quantum/plugins/metaplugin/run_tests.py +++ b/neutron/plugins/metaplugin/run_tests.py @@ -17,12 +17,12 @@ # limitations under the License. -"""Unittest runner for quantum Meta plugin +"""Unittest runner for neutron Meta plugin -This file should be run from the top dir in the quantum directory +This file should be run from the top dir in the neutron directory To run all tests:: - PLUGIN_DIR=quantum/plugins/metaplugin ./run_tests.sh + PLUGIN_DIR=neutron/plugins/metaplugin ./run_tests.sh """ import os @@ -33,7 +33,7 @@ from nose import config sys.path.append(os.getcwd()) sys.path.append(os.path.dirname(__file__)) -from quantum.common.test_lib import run_tests, test_config +from neutron.common.test_lib import run_tests, test_config if __name__ == '__main__': exit_status = False @@ -42,11 +42,11 @@ if __name__ == '__main__': # we should only invoked the tests once invoke_once = len(sys.argv) > 1 - test_config['plugin_name'] = "meta_quantum_plugin.MetaPluginV2" + test_config['plugin_name'] = "meta_neutron_plugin.MetaPluginV2" cwd = os.getcwd() - working_dir = os.path.abspath("quantum/plugins/metaplugin") + working_dir = os.path.abspath("neutron/plugins/metaplugin") c = config.Config(stream=sys.stdout, env=os.environ, verbosity=3, diff --git a/quantum/plugins/midonet/__init__.py b/neutron/plugins/midonet/__init__.py similarity index 100% rename from quantum/plugins/midonet/__init__.py rename to neutron/plugins/midonet/__init__.py diff --git a/quantum/plugins/midonet/config.py b/neutron/plugins/midonet/config.py similarity index 100% rename from quantum/plugins/midonet/config.py rename to neutron/plugins/midonet/config.py diff --git a/quantum/plugins/midonet/midonet_lib.py b/neutron/plugins/midonet/midonet_lib.py similarity index 99% rename from quantum/plugins/midonet/midonet_lib.py rename to neutron/plugins/midonet/midonet_lib.py index 8e2c1dfda0..a9133900e9 100644 --- a/quantum/plugins/midonet/midonet_lib.py +++ b/neutron/plugins/midonet/midonet_lib.py @@ -22,8 +22,8 @@ from webob import exc as w_exc -from quantum.common import exceptions as q_exc -from quantum.openstack.common import log as logging +from neutron.common import exceptions as q_exc +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -79,7 +79,7 @@ class MidonetResourceNotFound(q_exc.NotFound): message = _('MidoNet %(resource_type)s %(id)s could not be found') -class MidonetApiException(q_exc.QuantumException): +class MidonetApiException(q_exc.NeutronException): message = _("MidoNet API error: %(msg)s") diff --git a/quantum/plugins/midonet/plugin.py b/neutron/plugins/midonet/plugin.py similarity index 94% rename from quantum/plugins/midonet/plugin.py rename to neutron/plugins/midonet/plugin.py index e485231965..05b9ef698b 100644 --- a/quantum/plugins/midonet/plugin.py +++ b/neutron/plugins/midonet/plugin.py @@ -23,26 +23,26 @@ from midonetclient import api from oslo.config import cfg -from quantum.common import exceptions as q_exc -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import l3_db -from quantum.db import models_v2 -from quantum.db import securitygroups_db -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import log as logging -from quantum.plugins.midonet import config # noqa -from quantum.plugins.midonet import midonet_lib +from neutron.common import exceptions as q_exc +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import l3_db +from neutron.db import models_v2 +from neutron.db import securitygroups_db +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import log as logging +from neutron.plugins.midonet import config # noqa +from neutron.plugins.midonet import midonet_lib LOG = logging.getLogger(__name__) -class MidonetPluginException(q_exc.QuantumException): +class MidonetPluginException(q_exc.NeutronException): message = _("%(msg)s") -class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class MidonetPluginV2(db_base_plugin_v2.NeutronDbPluginV2, l3_db.L3_NAT_db_mixin, securitygroups_db.SecurityGroupDbMixin): @@ -85,9 +85,9 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, db.configure_db() def create_subnet(self, context, subnet): - """Create Quantum subnet. + """Create Neutron subnet. - Creates a Quantum subnet and a DHCP entry in MidoNet bridge. + Creates a Neutron subnet and a DHCP entry in MidoNet bridge. """ LOG.debug(_("MidonetPluginV2.create_subnet called: subnet=%r"), subnet) @@ -127,9 +127,9 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, return sn_entry def delete_subnet(self, context, id): - """Delete Quantum subnet. + """Delete Neutron subnet. - Delete quantum network and its corresponding MidoNet bridge. + Delete neutron network and its corresponding MidoNet bridge. """ LOG.debug(_("MidonetPluginV2.delete_subnet called: id=%s"), id) subnet = super(MidonetPluginV2, self).get_subnet(context, id, @@ -149,9 +149,9 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, LOG.debug(_("MidonetPluginV2.delete_subnet exiting")) def create_network(self, context, network): - """Create Quantum network. + """Create Neutron network. - Create a new Quantum network and its corresponding MidoNet bridge. + Create a new Neutron network and its corresponding MidoNet bridge. """ LOG.debug(_('MidonetPluginV2.create_network called: network=%r'), network) @@ -169,7 +169,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, bridge = self.client.create_bridge(tenant_id, network['network']['name']) - # Set MidoNet bridge ID to the quantum DB entry + # Set MidoNet bridge ID to the neutron DB entry network['network']['id'] = bridge.get_id() net = super(MidonetPluginV2, self).create_network(context, network) @@ -179,9 +179,9 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, return net def update_network(self, context, id, network): - """Update Quantum network. + """Update Neutron network. - Update an existing Quantum network and its corresponding MidoNet + Update an existing Neutron network and its corresponding MidoNet bridge. """ LOG.debug(_("MidonetPluginV2.update_network called: id=%(id)r, " @@ -204,9 +204,9 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, return net def get_network(self, context, id, fields=None): - """Get Quantum network. + """Get Neutron network. - Retrieves a Quantum network and its corresponding MidoNet bridge. + Retrieves a Neutron network and its corresponding MidoNet bridge. """ LOG.debug(_("MidonetPluginV2.get_network called: id=%(id)r, " "fields=%(fields)r"), {'id': id, 'fields': fields}) @@ -224,12 +224,12 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, try: super(MidonetPluginV2, self).delete_network(context, id) except Exception: - LOG.error(_('Failed to delete quantum db, while Midonet bridge=%r' + LOG.error(_('Failed to delete neutron db, while Midonet bridge=%r' 'had been deleted'), id) raise def create_port(self, context, port): - """Create a L2 port in Quantum/MidoNet.""" + """Create a L2 port in Neutron/MidoNet.""" LOG.debug(_("MidonetPluginV2.create_port called: port=%r"), port) is_compute_interface = False @@ -252,7 +252,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, bridge_port = self.client.create_interior_bridge_port(bridge) if bridge_port: - # set midonet port id to quantum port id and create a DB record. + # set midonet port id to neutron port id and create a DB record. port_data['id'] = bridge_port.get_id() session = context.session @@ -280,7 +280,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, LOG.debug(_("MidonetPluginV2.get_port called: id=%(id)s " "fields=%(fields)r"), {'id': id, 'fields': fields}) - # get the quantum port from DB. + # get the neutron port from DB. port_db_entry = super(MidonetPluginV2, self).get_port(context, id, fields) # verify that corresponding port exists in MidoNet. @@ -291,7 +291,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, return port_db_entry def get_ports(self, context, filters=None, fields=None): - """List quantum ports and verify that they exist in MidoNet.""" + """List neutron ports and verify that they exist in MidoNet.""" LOG.debug(_("MidonetPluginV2.get_ports called: filters=%(filters)s " "fields=%(fields)r"), {'filters': filters, 'fields': fields}) @@ -305,7 +305,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, return ports_db_entry def delete_port(self, context, id, l3_port_check=True): - """Delete a quantum port and corresponding MidoNet bridge port.""" + """Delete a neutron port and corresponding MidoNet bridge port.""" LOG.debug(_("MidonetPluginV2.delete_port called: id=%(id)s " "l3_port_check=%(l3_port_check)r"), {'id': id, 'l3_port_check': l3_port_check}) @@ -479,7 +479,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, subnet = self._get_subnet(context, subnet_id) network_id = subnet['network_id'] - # find a quantum port for the network + # find a neutron port for the network rport_qry = context.session.query(models_v2.Port) ports = rport_qry.filter_by( device_id=router_id, @@ -542,7 +542,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, # def create_security_group(self, context, security_group, default_sg=False): - """Create chains for Quantum security group.""" + """Create chains for Neutron security group.""" LOG.debug(_("MidonetPluginV2.create_security_group called: " "security_group=%(security_group)s " "default_sg=%(default_sg)s "), @@ -564,7 +564,7 @@ class MidonetPluginV2(db_base_plugin_v2.QuantumDbPluginV2, return sg_db_entry def delete_security_group(self, context, id): - """Delete chains for Quantum security group.""" + """Delete chains for Neutron security group.""" LOG.debug(_("MidonetPluginV2.delete_security_group called: id=%s"), id) with context.session.begin(subtransactions=True): diff --git a/quantum/plugins/ml2/README b/neutron/plugins/ml2/README similarity index 100% rename from quantum/plugins/ml2/README rename to neutron/plugins/ml2/README diff --git a/quantum/plugins/ml2/__init__.py b/neutron/plugins/ml2/__init__.py similarity index 100% rename from quantum/plugins/ml2/__init__.py rename to neutron/plugins/ml2/__init__.py diff --git a/quantum/plugins/ml2/config.py b/neutron/plugins/ml2/config.py similarity index 89% rename from quantum/plugins/ml2/config.py rename to neutron/plugins/ml2/config.py index 139cfeda19..867fd8fcf9 100644 --- a/quantum/plugins/ml2/config.py +++ b/neutron/plugins/ml2/config.py @@ -15,14 +15,14 @@ from oslo.config import cfg -from quantum import scheduler +from neutron import scheduler ml2_opts = [ cfg.ListOpt('type_drivers', default=['local', 'flat', 'vlan'], help=_("List of network type driver entrypoints to be loaded " - "from the quantum.ml2.type_drivers namespace.")), + "from the neutron.ml2.type_drivers namespace.")), cfg.ListOpt('tenant_network_types', default=['local'], help=_("Ordered list of network_types to allocate as tenant " @@ -30,7 +30,7 @@ ml2_opts = [ cfg.ListOpt('mechanism_drivers', default=[], help=_("List of networking mechanism driver entrypoints to " - "be loaded from the quantum.ml2.mechanism_drivers " + "be loaded from the neutron.ml2.mechanism_drivers " "namespace.")), ] diff --git a/quantum/plugins/ml2/db.py b/neutron/plugins/ml2/db.py similarity index 90% rename from quantum/plugins/ml2/db.py rename to neutron/plugins/ml2/db.py index 1c12bab7a7..48c3b678e9 100644 --- a/quantum/plugins/ml2/db.py +++ b/neutron/plugins/ml2/db.py @@ -15,14 +15,14 @@ from sqlalchemy.orm import exc -from quantum.db import api as db_api -from quantum.db import models_v2 -from quantum.db import securitygroups_db as sg_db -from quantum import manager -from quantum.openstack.common import log -from quantum.openstack.common import uuidutils -from quantum.plugins.ml2 import driver_api as api -from quantum.plugins.ml2 import models +from neutron.db import api as db_api +from neutron.db import models_v2 +from neutron.db import securitygroups_db as sg_db +from neutron import manager +from neutron.openstack.common import log +from neutron.openstack.common import uuidutils +from neutron.plugins.ml2 import driver_api as api +from neutron.plugins.ml2 import models LOG = log.getLogger(__name__) @@ -92,7 +92,7 @@ def get_port_and_sgs(port_id): if not port_and_sgs: return port = port_and_sgs[0][0] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin._make_port_dict(port) port_dict['security_groups'] = [ sg_id for port_, sg_id in port_and_sgs if sg_id] diff --git a/quantum/plugins/ml2/driver_api.py b/neutron/plugins/ml2/driver_api.py similarity index 97% rename from quantum/plugins/ml2/driver_api.py rename to neutron/plugins/ml2/driver_api.py index 305fd3e600..adc969b015 100644 --- a/quantum/plugins/ml2/driver_api.py +++ b/neutron/plugins/ml2/driver_api.py @@ -17,7 +17,7 @@ from abc import ABCMeta, abstractmethod # The following keys are used in the segment dictionaries passed via # the driver API. These are defined separately from similar keys in -# quantum.extensions.providernet so that drivers don't need to change +# neutron.extensions.providernet so that drivers don't need to change # if/when providernet moves to the core API. # NETWORK_TYPE = 'network_type' @@ -68,7 +68,7 @@ class TypeDriver(object): :param segment: segment dictionary using keys defined above :returns: segment dictionary with any defaulted attributes added - :raises: quantum.common.exceptions.InvalidInput if invalid + :raises: neutron.common.exceptions.InvalidInput if invalid Called outside transaction context to validate the provider attributes for a provider network segment. Raise InvalidInput diff --git a/quantum/plugins/ml2/drivers/__init__.py b/neutron/plugins/ml2/drivers/__init__.py similarity index 100% rename from quantum/plugins/ml2/drivers/__init__.py rename to neutron/plugins/ml2/drivers/__init__.py diff --git a/quantum/plugins/ml2/drivers/type_flat.py b/neutron/plugins/ml2/drivers/type_flat.py similarity index 96% rename from quantum/plugins/ml2/drivers/type_flat.py rename to neutron/plugins/ml2/drivers/type_flat.py index 4619a99795..af67366e50 100644 --- a/quantum/plugins/ml2/drivers/type_flat.py +++ b/neutron/plugins/ml2/drivers/type_flat.py @@ -16,10 +16,10 @@ from oslo.config import cfg import sqlalchemy as sa -from quantum.common import exceptions as exc -from quantum.db import model_base -from quantum.openstack.common import log -from quantum.plugins.ml2 import driver_api as api +from neutron.common import exceptions as exc +from neutron.db import model_base +from neutron.openstack.common import log +from neutron.plugins.ml2 import driver_api as api LOG = log.getLogger(__name__) diff --git a/quantum/plugins/ml2/drivers/type_local.py b/neutron/plugins/ml2/drivers/type_local.py similarity index 93% rename from quantum/plugins/ml2/drivers/type_local.py rename to neutron/plugins/ml2/drivers/type_local.py index f79485babd..1fb0f2e961 100644 --- a/quantum/plugins/ml2/drivers/type_local.py +++ b/neutron/plugins/ml2/drivers/type_local.py @@ -13,9 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.common import exceptions as exc -from quantum.openstack.common import log -from quantum.plugins.ml2 import driver_api as api +from neutron.common import exceptions as exc +from neutron.openstack.common import log +from neutron.plugins.ml2 import driver_api as api LOG = log.getLogger(__name__) diff --git a/quantum/plugins/ml2/drivers/type_vlan.py b/neutron/plugins/ml2/drivers/type_vlan.py similarity index 97% rename from quantum/plugins/ml2/drivers/type_vlan.py rename to neutron/plugins/ml2/drivers/type_vlan.py index 357744e0fc..185be432cf 100644 --- a/quantum/plugins/ml2/drivers/type_vlan.py +++ b/neutron/plugins/ml2/drivers/type_vlan.py @@ -18,14 +18,14 @@ import sys from oslo.config import cfg import sqlalchemy as sa -from quantum.common import constants as q_const -from quantum.common import exceptions as exc -from quantum.common import utils -from quantum.db import api as db_api -from quantum.db import model_base -from quantum.openstack.common import log -from quantum.plugins.common import utils as plugin_utils -from quantum.plugins.ml2 import driver_api as api +from neutron.common import constants as q_const +from neutron.common import exceptions as exc +from neutron.common import utils +from neutron.db import api as db_api +from neutron.db import model_base +from neutron.openstack.common import log +from neutron.plugins.common import utils as plugin_utils +from neutron.plugins.ml2 import driver_api as api LOG = log.getLogger(__name__) diff --git a/quantum/plugins/ml2/managers.py b/neutron/plugins/ml2/managers.py similarity index 94% rename from quantum/plugins/ml2/managers.py rename to neutron/plugins/ml2/managers.py index 239de48596..5832aacd3b 100644 --- a/quantum/plugins/ml2/managers.py +++ b/neutron/plugins/ml2/managers.py @@ -18,9 +18,9 @@ import sys from oslo.config import cfg import stevedore -from quantum.common import exceptions as exc -from quantum.openstack.common import log -from quantum.plugins.ml2 import driver_api as api +from neutron.common import exceptions as exc +from neutron.openstack.common import log +from neutron.plugins.ml2 import driver_api as api LOG = log.getLogger(__name__) @@ -39,7 +39,7 @@ class TypeManager(stevedore.named.NamedExtensionManager): LOG.info(_("Configured type driver names: %s"), cfg.CONF.ml2.type_drivers) - super(TypeManager, self).__init__('quantum.ml2.type_drivers', + super(TypeManager, self).__init__('neutron.ml2.type_drivers', cfg.CONF.ml2.type_drivers, invoke_on_load=True) LOG.info(_("Loaded type driver names: %s"), self.names()) @@ -121,7 +121,7 @@ class MechanismManager(stevedore.named.NamedExtensionManager): LOG.info(_("Configured mechanism driver names: %s"), cfg.CONF.ml2.mechanism_drivers) - super(MechanismManager, self).__init__('quantum.ml2.mechanism_drivers', + super(MechanismManager, self).__init__('neutron.ml2.mechanism_drivers', cfg.CONF.ml2.mechanism_drivers, invoke_on_load=True) LOG.info(_("Loaded mechanism driver names: %s"), self.names()) diff --git a/quantum/plugins/ml2/models.py b/neutron/plugins/ml2/models.py similarity index 85% rename from quantum/plugins/ml2/models.py rename to neutron/plugins/ml2/models.py index 9252e0ed56..ba5650940c 100644 --- a/quantum/plugins/ml2/models.py +++ b/neutron/plugins/ml2/models.py @@ -15,15 +15,15 @@ import sqlalchemy as sa -from quantum.db import model_base -from quantum.db import models_v2 +from neutron.db import model_base +from neutron.db import models_v2 class NetworkSegment(model_base.BASEV2, models_v2.HasId): """Represent persistent state of a network segment. - A network segment is a portion of a quantum network with a - specific physical realization. A quantum network can consist of + A network segment is a portion of a neutron network with a + specific physical realization. A neutron network can consist of one or more segments. """ diff --git a/quantum/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py similarity index 90% rename from quantum/plugins/ml2/plugin.py rename to neutron/plugins/ml2/plugin.py index f375f464be..c30dbff63f 100644 --- a/quantum/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -15,29 +15,29 @@ from oslo.config import cfg -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api -from quantum.api.v2 import attributes -from quantum.common import constants as const -from quantum.common import exceptions as exc -from quantum.common import topics -from quantum.db import agentschedulers_db -from quantum.db import db_base_plugin_v2 -from quantum.db import extraroute_db -from quantum.db import portbindings_db -from quantum.db import quota_db # noqa -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.extensions import portbindings -from quantum.extensions import providernet as provider -from quantum.openstack.common import importutils -from quantum.openstack.common import log -from quantum.openstack.common import rpc as c_rpc -from quantum.plugins.ml2 import config # noqa -from quantum.plugins.ml2 import db -from quantum.plugins.ml2 import driver_api as api -from quantum.plugins.ml2 import managers -from quantum.plugins.ml2 import rpc +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api +from neutron.api.v2 import attributes +from neutron.common import constants as const +from neutron.common import exceptions as exc +from neutron.common import topics +from neutron.db import agentschedulers_db +from neutron.db import db_base_plugin_v2 +from neutron.db import extraroute_db +from neutron.db import portbindings_db +from neutron.db import quota_db # noqa +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.extensions import portbindings +from neutron.extensions import providernet as provider +from neutron.openstack.common import importutils +from neutron.openstack.common import log +from neutron.openstack.common import rpc as c_rpc +from neutron.plugins.ml2 import config # noqa +from neutron.plugins.ml2 import db +from neutron.plugins.ml2 import driver_api as api +from neutron.plugins.ml2 import managers +from neutron.plugins.ml2 import rpc LOG = log.getLogger(__name__) @@ -46,14 +46,14 @@ LOG = log.getLogger(__name__) TYPE_MULTI_SEGMENT = 'multi-segment' -class Ml2Plugin(db_base_plugin_v2.QuantumDbPluginV2, +class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, extraroute_db.ExtraRoute_db_mixin, sg_db_rpc.SecurityGroupServerRpcMixin, agentschedulers_db.AgentSchedulerDbMixin, portbindings_db.PortBindingMixin): - """Implement the Quantum L2 abstractions using modules. + """Implement the Neutron L2 abstractions using modules. - Ml2Plugin is a Quantum plugin based on separately extensible sets + Ml2Plugin is a Neutron plugin based on separately extensible sets of network types and mechanisms for connecting to networks of those types. The network types and mechanisms are implemented as drivers loaded via Python entry points. Networks can be made up of @@ -92,9 +92,11 @@ class Ml2Plugin(db_base_plugin_v2.QuantumDbPluginV2, # REVISIT(rkukura): Use stevedore for these? self.network_scheduler = importutils.import_object( - cfg.CONF.network_scheduler_driver) + cfg.CONF.network_scheduler_driver + ) self.router_scheduler = importutils.import_object( - cfg.CONF.router_scheduler_driver) + cfg.CONF.router_scheduler_driver + ) LOG.info(_("Modular L2 Plugin initialization complete")) diff --git a/quantum/plugins/ml2/rpc.py b/neutron/plugins/ml2/rpc.py similarity index 93% rename from quantum/plugins/ml2/rpc.py rename to neutron/plugins/ml2/rpc.py index c4394c55b3..0413da6479 100644 --- a/quantum/plugins/ml2/rpc.py +++ b/neutron/plugins/ml2/rpc.py @@ -13,19 +13,19 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.common import constants as q_const -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.db import agents_db -from quantum.db import api as db_api -from quantum.db import dhcp_rpc_base -from quantum.db import l3_rpc_base -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.openstack.common import log -from quantum.openstack.common.rpc import proxy -from quantum.plugins.ml2 import db -from quantum.plugins.ml2 import driver_api as api +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.common import constants as q_const +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.db import agents_db +from neutron.db import api as db_api +from neutron.db import dhcp_rpc_base +from neutron.db import l3_rpc_base +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.openstack.common import log +from neutron.openstack.common.rpc import proxy +from neutron.plugins.ml2 import db +from neutron.plugins.ml2 import driver_api as api LOG = log.getLogger(__name__) diff --git a/quantum/plugins/mlnx/README b/neutron/plugins/mlnx/README similarity index 54% rename from quantum/plugins/mlnx/README rename to neutron/plugins/mlnx/README index b61ad47883..97c24ce0b6 100644 --- a/quantum/plugins/mlnx/README +++ b/neutron/plugins/mlnx/README @@ -1,8 +1,8 @@ -Mellanox Quantum Plugin +Mellanox Neutron Plugin -This plugin implements Quantum v2 APIs with support for +This plugin implements Neutron v2 APIs with support for Mellanox embedded switch functionality as part of the VPI (Ethernet/InfiniBand) HCA. For more details on the plugin, please refer to the following link: -https://wiki.openstack.org/wiki/Mellanox-Quantum \ No newline at end of file +https://wiki.openstack.org/wiki/Mellanox-Quantum diff --git a/quantum/plugins/mlnx/__init__.py b/neutron/plugins/mlnx/__init__.py similarity index 100% rename from quantum/plugins/mlnx/__init__.py rename to neutron/plugins/mlnx/__init__.py diff --git a/quantum/plugins/mlnx/agent/__init__.py b/neutron/plugins/mlnx/agent/__init__.py similarity index 100% rename from quantum/plugins/mlnx/agent/__init__.py rename to neutron/plugins/mlnx/agent/__init__.py diff --git a/quantum/plugins/mlnx/agent/eswitch_quantum_agent.py b/neutron/plugins/mlnx/agent/eswitch_neutron_agent.py similarity index 94% rename from quantum/plugins/mlnx/agent/eswitch_quantum_agent.py rename to neutron/plugins/mlnx/agent/eswitch_neutron_agent.py index b58072f823..436bec34f1 100644 --- a/quantum/plugins/mlnx/agent/eswitch_quantum_agent.py +++ b/neutron/plugins/mlnx/agent/eswitch_neutron_agent.py @@ -23,19 +23,19 @@ import time import eventlet from oslo.config import cfg -from quantum.agent import rpc as agent_rpc -from quantum.common import config as logging_config -from quantum.common import constants as q_constants -from quantum.common import topics -from quantum.common import utils as q_utils -from quantum import context -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall -from quantum.openstack.common.rpc import dispatcher -from quantum.plugins.mlnx.agent import utils -from quantum.plugins.mlnx.common import config # noqa -from quantum.plugins.mlnx.common import constants -from quantum.plugins.mlnx.common import exceptions +from neutron.agent import rpc as agent_rpc +from neutron.common import config as logging_config +from neutron.common import constants as q_constants +from neutron.common import topics +from neutron.common import utils as q_utils +from neutron import context +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall +from neutron.openstack.common.rpc import dispatcher +from neutron.plugins.mlnx.agent import utils +from neutron.plugins.mlnx.common import config # noqa +from neutron.plugins.mlnx.common import constants +from neutron.plugins.mlnx.common import exceptions LOG = logging.getLogger(__name__) @@ -196,7 +196,7 @@ class MlnxEswitchRpcCallbacks(): return dispatcher.RpcDispatcher([self]) -class MlnxEswitchQuantumAgent(object): +class MlnxEswitchNeutronAgent(object): # Set RPC API version to 1.0 by default. RPC_API_VERSION = '1.0' @@ -204,7 +204,7 @@ class MlnxEswitchQuantumAgent(object): self._polling_interval = cfg.CONF.AGENT.polling_interval self._setup_eswitches(interface_mapping) self.agent_state = { - 'binary': 'quantum-mlnx-agent', + 'binary': 'neutron-mlnx-agent', 'host': cfg.CONF.host, 'topic': q_constants.L2_AGENT_TOPIC, 'configurations': interface_mapping, @@ -315,7 +315,7 @@ class MlnxEswitchQuantumAgent(object): dev_details['admin_state_up']) else: LOG.debug(_("Device with mac_address %s not defined " - "on Quantum Plugin"), device) + "on Neutron Plugin"), device) return resync def treat_devices_removed(self, devices): @@ -376,7 +376,7 @@ class MlnxEswitchQuantumAgent(object): def main(): eventlet.monkey_patch() - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') logging_config.setup_logging(cfg.CONF) try: @@ -389,7 +389,7 @@ def main(): LOG.info(_("Interface mappings: %s"), interface_mappings) try: - agent = MlnxEswitchQuantumAgent(interface_mappings) + agent = MlnxEswitchNeutronAgent(interface_mappings) except Exception as e: LOG.error(_("Failed on Agent initialisation : %s." " Agent terminated!"), e) diff --git a/quantum/plugins/mlnx/agent/utils.py b/neutron/plugins/mlnx/agent/utils.py similarity index 97% rename from quantum/plugins/mlnx/agent/utils.py rename to neutron/plugins/mlnx/agent/utils.py index 8e3adbb8b2..de05455c0d 100644 --- a/quantum/plugins/mlnx/agent/utils.py +++ b/neutron/plugins/mlnx/agent/utils.py @@ -17,9 +17,9 @@ import zmq -from quantum.openstack.common import jsonutils -from quantum.openstack.common import log as logging -from quantum.plugins.mlnx.common import exceptions +from neutron.openstack.common import jsonutils +from neutron.openstack.common import log as logging +from neutron.plugins.mlnx.common import exceptions LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/mlnx/agent_notify_api.py b/neutron/plugins/mlnx/agent_notify_api.py similarity index 94% rename from quantum/plugins/mlnx/agent_notify_api.py rename to neutron/plugins/mlnx/agent_notify_api.py index 29d7c2311c..2a37d9abe8 100644 --- a/quantum/plugins/mlnx/agent_notify_api.py +++ b/neutron/plugins/mlnx/agent_notify_api.py @@ -15,9 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.common import topics -from quantum.openstack.common import log as logging -from quantum.openstack.common.rpc import proxy +from neutron.common import topics +from neutron.openstack.common import log as logging +from neutron.openstack.common.rpc import proxy LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/mlnx/common/__init__.py b/neutron/plugins/mlnx/common/__init__.py similarity index 100% rename from quantum/plugins/mlnx/common/__init__.py rename to neutron/plugins/mlnx/common/__init__.py diff --git a/quantum/plugins/mlnx/common/config.py b/neutron/plugins/mlnx/common/config.py similarity index 96% rename from quantum/plugins/mlnx/common/config.py rename to neutron/plugins/mlnx/common/config.py index 672e256e3b..fdf1ca417b 100644 --- a/quantum/plugins/mlnx/common/config.py +++ b/neutron/plugins/mlnx/common/config.py @@ -17,8 +17,8 @@ from oslo.config import cfg -from quantum.agent.common import config -from quantum.plugins.mlnx.common import constants +from neutron.agent.common import config +from neutron.plugins.mlnx.common import constants DEFAULT_VLAN_RANGES = ['default:1:1000'] DEFAULT_INTERFACE_MAPPINGS = [] diff --git a/quantum/plugins/mlnx/common/constants.py b/neutron/plugins/mlnx/common/constants.py similarity index 100% rename from quantum/plugins/mlnx/common/constants.py rename to neutron/plugins/mlnx/common/constants.py diff --git a/quantum/plugins/mlnx/common/exceptions.py b/neutron/plugins/mlnx/common/exceptions.py similarity index 88% rename from quantum/plugins/mlnx/common/exceptions.py rename to neutron/plugins/mlnx/common/exceptions.py index e4c45b2b15..54355a0011 100644 --- a/quantum/plugins/mlnx/common/exceptions.py +++ b/neutron/plugins/mlnx/common/exceptions.py @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.common import exceptions as qexc +from neutron.common import exceptions as qexc -class MlnxException(qexc.QuantumException): +class MlnxException(qexc.NeutronException): message = _("Mlnx Exception: %(err_msg)s") diff --git a/quantum/plugins/mlnx/db/__init__.py b/neutron/plugins/mlnx/db/__init__.py similarity index 100% rename from quantum/plugins/mlnx/db/__init__.py rename to neutron/plugins/mlnx/db/__init__.py diff --git a/quantum/plugins/mlnx/db/mlnx_db_v2.py b/neutron/plugins/mlnx/db/mlnx_db_v2.py similarity index 97% rename from quantum/plugins/mlnx/db/mlnx_db_v2.py rename to neutron/plugins/mlnx/db/mlnx_db_v2.py index e2c4a74904..dca8c8ae68 100644 --- a/quantum/plugins/mlnx/db/mlnx_db_v2.py +++ b/neutron/plugins/mlnx/db/mlnx_db_v2.py @@ -17,12 +17,12 @@ from sqlalchemy.orm import exc -from quantum.common import exceptions as q_exc -import quantum.db.api as db -from quantum.db import models_v2 -from quantum.openstack.common import log as logging -from quantum.plugins.mlnx.common import config # noqa -from quantum.plugins.mlnx.db import mlnx_models_v2 +from neutron.common import exceptions as q_exc +import neutron.db.api as db +from neutron.db import models_v2 +from neutron.openstack.common import log as logging +from neutron.plugins.mlnx.common import config # noqa +from neutron.plugins.mlnx.db import mlnx_models_v2 LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/mlnx/db/mlnx_models_v2.py b/neutron/plugins/mlnx/db/mlnx_models_v2.py similarity index 98% rename from quantum/plugins/mlnx/db/mlnx_models_v2.py rename to neutron/plugins/mlnx/db/mlnx_models_v2.py index 9c026a4a33..5610861575 100644 --- a/quantum/plugins/mlnx/db/mlnx_models_v2.py +++ b/neutron/plugins/mlnx/db/mlnx_models_v2.py @@ -17,7 +17,7 @@ import sqlalchemy as sa -from quantum.db import model_base +from neutron.db import model_base class SegmentationIdAllocation(model_base.BASEV2): diff --git a/quantum/plugins/mlnx/mlnx_plugin.py b/neutron/plugins/mlnx/mlnx_plugin.py similarity index 93% rename from quantum/plugins/mlnx/mlnx_plugin.py rename to neutron/plugins/mlnx/mlnx_plugin.py index 8ebf3248e9..facc0d926b 100644 --- a/quantum/plugins/mlnx/mlnx_plugin.py +++ b/neutron/plugins/mlnx/mlnx_plugin.py @@ -19,35 +19,35 @@ import sys from oslo.config import cfg -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.api.v2 import attributes -from quantum.common import constants as q_const -from quantum.common import exceptions as q_exc -from quantum.common import topics -from quantum.common import utils -from quantum.db import agents_db -from quantum.db import db_base_plugin_v2 -from quantum.db import l3_db -from quantum.db import quota_db # noqa -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.extensions import portbindings -from quantum.extensions import providernet as provider -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.plugins.common import utils as plugin_utils -from quantum.plugins.mlnx import agent_notify_api -from quantum.plugins.mlnx.common import constants -from quantum.plugins.mlnx.db import mlnx_db_v2 as db -from quantum.plugins.mlnx import rpc_callbacks +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.api.v2 import attributes +from neutron.common import constants as q_const +from neutron.common import exceptions as q_exc +from neutron.common import topics +from neutron.common import utils +from neutron.db import agents_db +from neutron.db import db_base_plugin_v2 +from neutron.db import l3_db +from neutron.db import quota_db # noqa +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.extensions import portbindings +from neutron.extensions import providernet as provider +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.plugins.common import utils as plugin_utils +from neutron.plugins.mlnx import agent_notify_api +from neutron.plugins.mlnx.common import constants +from neutron.plugins.mlnx.db import mlnx_db_v2 as db +from neutron.plugins.mlnx import rpc_callbacks LOG = logging.getLogger(__name__) -class MellanoxEswitchPlugin(db_base_plugin_v2.QuantumDbPluginV2, +class MellanoxEswitchPlugin(db_base_plugin_v2.NeutronDbPluginV2, l3_db.L3_NAT_db_mixin, agents_db.AgentDbMixin, sg_db_rpc.SecurityGroupServerRpcMixin): - """Realization of Quantum API on Mellanox HCA embedded switch technology. + """Realization of Neutron API on Mellanox HCA embedded switch technology. Current plugin provides embedded HCA Switch connectivity. Code is based on the Linux Bridge plugin content to @@ -76,7 +76,7 @@ class MellanoxEswitchPlugin(db_base_plugin_v2.QuantumDbPluginV2, binding_set = "extension:port_binding:set" def __init__(self): - """Start Mellanox Quantum Plugin.""" + """Start Mellanox Neutron Plugin.""" db.initialize() self._parse_network_vlan_ranges() db.sync_network_states(self.network_vlan_ranges) diff --git a/quantum/plugins/mlnx/rpc_callbacks.py b/neutron/plugins/mlnx/rpc_callbacks.py similarity index 91% rename from quantum/plugins/mlnx/rpc_callbacks.py rename to neutron/plugins/mlnx/rpc_callbacks.py index 1d8623b331..ebbb028cc5 100644 --- a/quantum/plugins/mlnx/rpc_callbacks.py +++ b/neutron/plugins/mlnx/rpc_callbacks.py @@ -15,15 +15,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.common import constants as q_const -from quantum.common import rpc as q_rpc -from quantum.db import agents_db -from quantum.db import api as db_api -from quantum.db import dhcp_rpc_base -from quantum.db import l3_rpc_base -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.openstack.common import log as logging -from quantum.plugins.mlnx.db import mlnx_db_v2 as db +from neutron.common import constants as q_const +from neutron.common import rpc as q_rpc +from neutron.db import agents_db +from neutron.db import api as db_api +from neutron.db import dhcp_rpc_base +from neutron.db import l3_rpc_base +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.openstack.common import log as logging +from neutron.plugins.mlnx.db import mlnx_db_v2 as db LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/nec/README b/neutron/plugins/nec/README similarity index 86% rename from quantum/plugins/nec/README rename to neutron/plugins/nec/README index 624fdbef8d..c6205afb80 100644 --- a/quantum/plugins/nec/README +++ b/neutron/plugins/nec/README @@ -9,5 +9,5 @@ http://wiki.openstack.org/Quantum-NEC-OpenFlow-Plugin # -- Installation Use QuickStart Script for this plugin. This provides you auto installation and -configuration of Nova, Quantum and Trema. +configuration of Nova, Neutron and Trema. https://github.com/nec-openstack/quantum-openflow-plugin/tree/folsom diff --git a/quantum/plugins/nec/__init__.py b/neutron/plugins/nec/__init__.py similarity index 100% rename from quantum/plugins/nec/__init__.py rename to neutron/plugins/nec/__init__.py diff --git a/quantum/plugins/nec/agent/__init__.py b/neutron/plugins/nec/agent/__init__.py similarity index 100% rename from quantum/plugins/nec/agent/__init__.py rename to neutron/plugins/nec/agent/__init__.py diff --git a/quantum/plugins/nec/agent/nec_quantum_agent.py b/neutron/plugins/nec/agent/nec_neutron_agent.py similarity index 90% rename from quantum/plugins/nec/agent/nec_quantum_agent.py rename to neutron/plugins/nec/agent/nec_neutron_agent.py index ab34062ada..57d6257594 100755 --- a/quantum/plugins/nec/agent/nec_quantum_agent.py +++ b/neutron/plugins/nec/agent/nec_neutron_agent.py @@ -27,19 +27,19 @@ import time import eventlet -from quantum.agent.linux import ovs_lib -from quantum.agent import rpc as agent_rpc -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.common import config as logging_config -from quantum.common import constants as q_const -from quantum.common import topics -from quantum import context as q_context -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall -from quantum.openstack.common.rpc import dispatcher -from quantum.openstack.common.rpc import proxy -from quantum.plugins.nec.common import config +from neutron.agent.linux import ovs_lib +from neutron.agent import rpc as agent_rpc +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.common import config as logging_config +from neutron.common import constants as q_const +from neutron.common import topics +from neutron import context as q_context +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall +from neutron.openstack.common.rpc import dispatcher +from neutron.openstack.common.rpc import proxy +from neutron.plugins.nec.common import config LOG = logging.getLogger(__name__) @@ -50,7 +50,7 @@ class NECPluginApi(agent_rpc.PluginApi): def update_ports(self, context, agent_id, datapath_id, port_added, port_removed): - """RPC to update information of ports on Quantum Server.""" + """RPC to update information of ports on Neutron Server.""" LOG.info(_("Update ports: added=%(added)s, " "removed=%(removed)s"), {'added': port_added, 'removed': port_removed}) @@ -114,7 +114,7 @@ class SecurityGroupAgentRpc(sg_rpc.SecurityGroupAgentRpcMixin): self.init_firewall() -class NECQuantumAgent(object): +class NECNeutronAgent(object): def __init__(self, integ_br, root_helper, polling_interval): '''Constructor. @@ -130,7 +130,7 @@ class NECQuantumAgent(object): self.datapath_id = "0x%s" % self.int_br.get_datapath_id() self.agent_state = { - 'binary': 'quantum-nec-agent', + 'binary': 'neutron-nec-agent', 'host': config.CONF.host, 'topic': q_const.L2_AGENT_TOPIC, 'configurations': {}, @@ -227,7 +227,7 @@ class NECQuantumAgent(object): def main(): eventlet.monkey_patch() - config.CONF(project='quantum') + config.CONF(project='neutron') logging_config.setup_logging(config.CONF) @@ -236,7 +236,7 @@ def main(): root_helper = config.AGENT.root_helper polling_interval = config.AGENT.polling_interval - agent = NECQuantumAgent(integ_br, root_helper, polling_interval) + agent = NECNeutronAgent(integ_br, root_helper, polling_interval) # Start everything. agent.daemon_loop() diff --git a/quantum/plugins/nec/common/__init__.py b/neutron/plugins/nec/common/__init__.py similarity index 100% rename from quantum/plugins/nec/common/__init__.py rename to neutron/plugins/nec/common/__init__.py diff --git a/quantum/plugins/nec/common/config.py b/neutron/plugins/nec/common/config.py similarity index 94% rename from quantum/plugins/nec/common/config.py rename to neutron/plugins/nec/common/config.py index 8229a9f511..fb5ad2b8ca 100644 --- a/quantum/plugins/nec/common/config.py +++ b/neutron/plugins/nec/common/config.py @@ -17,9 +17,9 @@ from oslo.config import cfg -from quantum.agent.common import config -from quantum.openstack.common import rpc # noqa -from quantum import scheduler +from neutron.agent.common import config +from neutron.openstack.common import rpc # noqa +from neutron import scheduler ovs_opts = [ diff --git a/quantum/plugins/nec/common/exceptions.py b/neutron/plugins/nec/common/exceptions.py similarity index 81% rename from quantum/plugins/nec/common/exceptions.py rename to neutron/plugins/nec/common/exceptions.py index 407dab2069..a5f09a4cab 100644 --- a/quantum/plugins/nec/common/exceptions.py +++ b/neutron/plugins/nec/common/exceptions.py @@ -15,19 +15,19 @@ # under the License. # @author: Ryota MIBU -from quantum.common import exceptions as qexc +from neutron.common import exceptions as qexc -class OFCException(qexc.QuantumException): +class OFCException(qexc.NeutronException): message = _("An OFC exception has occurred: %(reason)s") -class NECDBException(qexc.QuantumException): +class NECDBException(qexc.NeutronException): message = _("An exception occurred in NECPluginV2 DB: %(reason)s") -class OFCConsistencyBroken(qexc.QuantumException): - message = _("Consistency of Quantum-OFC resource map is broken: " +class OFCConsistencyBroken(qexc.NeutronException): + message = _("Consistency of neutron-OFC resource map is broken: " "%(reason)s") diff --git a/quantum/plugins/nec/common/ofc_client.py b/neutron/plugins/nec/common/ofc_client.py similarity index 97% rename from quantum/plugins/nec/common/ofc_client.py rename to neutron/plugins/nec/common/ofc_client.py index ae2896c084..44ba4dfd92 100644 --- a/quantum/plugins/nec/common/ofc_client.py +++ b/neutron/plugins/nec/common/ofc_client.py @@ -19,8 +19,8 @@ import httplib import json import socket -from quantum.openstack.common import log as logging -from quantum.plugins.nec.common import exceptions as nexc +from neutron.openstack.common import log as logging +from neutron.plugins.nec.common import exceptions as nexc LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/nec/db/__init__.py b/neutron/plugins/nec/db/__init__.py similarity index 100% rename from quantum/plugins/nec/db/__init__.py rename to neutron/plugins/nec/db/__init__.py diff --git a/quantum/plugins/nec/db/api.py b/neutron/plugins/nec/db/api.py similarity index 74% rename from quantum/plugins/nec/db/api.py rename to neutron/plugins/nec/db/api.py index 1c74024be3..333065122d 100644 --- a/quantum/plugins/nec/db/api.py +++ b/neutron/plugins/nec/db/api.py @@ -17,16 +17,16 @@ import sqlalchemy as sa -from quantum.db import api as db -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.db import securitygroups_db as sg_db -from quantum.extensions import securitygroup as ext_sg -from quantum import manager -from quantum.openstack.common import log as logging -from quantum.plugins.nec.common import config # noqa -from quantum.plugins.nec.common import exceptions as nexc -from quantum.plugins.nec.db import models as nmodels +from neutron.db import api as db +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.db import securitygroups_db as sg_db +from neutron.extensions import securitygroup as ext_sg +from neutron import manager +from neutron.openstack.common import log as logging +from neutron.plugins.nec.common import config # noqa +from neutron.plugins.nec.common import exceptions as nexc +from neutron.plugins.nec.db import models as nmodels LOG = logging.getLogger(__name__) @@ -61,16 +61,16 @@ def clear_db(base=model_base.BASEV2): db.clear_db(base) -def get_ofc_item(session, resource, quantum_id, old_style=False): +def get_ofc_item(session, resource, neutron_id, old_style=False): try: model = _get_resource_model(resource, old_style) - return session.query(model).filter_by(quantum_id=quantum_id).one() + return session.query(model).filter_by(quantum_id=neutron_id).one() except sa.orm.exc.NoResultFound: return None -def get_ofc_id(session, resource, quantum_id, old_style=False): - ofc_item = get_ofc_item(session, resource, quantum_id, old_style) +def get_ofc_id(session, resource, neutron_id, old_style=False): + ofc_item = get_ofc_item(session, resource, neutron_id, old_style) if ofc_item: if old_style: return ofc_item.id @@ -80,8 +80,8 @@ def get_ofc_id(session, resource, quantum_id, old_style=False): return None -def exists_ofc_item(session, resource, quantum_id, old_style=False): - if get_ofc_item(session, resource, quantum_id, old_style): +def exists_ofc_item(session, resource, neutron_id, old_style=False): + if get_ofc_item(session, resource, neutron_id, old_style): return True else: return False @@ -99,13 +99,13 @@ def find_ofc_item(session, resource, ofc_id, old_style=False): return None -def add_ofc_item(session, resource, quantum_id, ofc_id, old_style=False): +def add_ofc_item(session, resource, neutron_id, ofc_id, old_style=False): try: model = _get_resource_model(resource, old_style) if old_style: - params = dict(quantum_id=quantum_id, id=ofc_id) + params = dict(quantum_id=neutron_id, id=ofc_id) else: - params = dict(quantum_id=quantum_id, ofc_id=ofc_id) + params = dict(quantum_id=neutron_id, ofc_id=ofc_id) item = model(**params) with session.begin(subtransactions=True): session.add(item) @@ -116,58 +116,58 @@ def add_ofc_item(session, resource, quantum_id, ofc_id, old_style=False): return item -def del_ofc_item(session, resource, quantum_id, old_style=False, +def del_ofc_item(session, resource, neutron_id, old_style=False, warning=True): try: model = _get_resource_model(resource, old_style) with session.begin(subtransactions=True): - item = session.query(model).filter_by(quantum_id=quantum_id).one() + item = session.query(model).filter_by(quantum_id=neutron_id).one() session.delete(item) return True except sa.orm.exc.NoResultFound: if warning: LOG.warning(_("_del_ofc_item(): NotFound item " "(model=%(model)s, id=%(id)s) "), - {'model': model, 'id': quantum_id}) + {'model': model, 'id': neutron_id}) return False -def get_ofc_id_lookup_both(session, resource, quantum_id): - ofc_id = get_ofc_id(session, resource, quantum_id) +def get_ofc_id_lookup_both(session, resource, neutron_id): + ofc_id = get_ofc_id(session, resource, neutron_id) # Lookup old style of OFC mapping table if not ofc_id: - ofc_id = get_ofc_id(session, resource, quantum_id, + ofc_id = get_ofc_id(session, resource, neutron_id, old_style=True) if not ofc_id: - reason = (_("NotFound %(resource)s for quantum_id=%(id)s.") - % {'resource': resource, 'id': quantum_id}) + reason = (_("NotFound %(resource)s for neutron_id=%(id)s.") + % {'resource': resource, 'id': neutron_id}) raise nexc.OFCConsistencyBroken(reason=reason) return ofc_id -def exists_ofc_item_lookup_both(session, resource, quantum_id): - if exists_ofc_item(session, resource, quantum_id): +def exists_ofc_item_lookup_both(session, resource, neutron_id): + if exists_ofc_item(session, resource, neutron_id): return True # Check old style of OFC mapping table - if exists_ofc_item(session, resource, quantum_id, + if exists_ofc_item(session, resource, neutron_id, old_style=True): return True return False -def del_ofc_item_lookup_both(session, resource, quantum_id): +def del_ofc_item_lookup_both(session, resource, neutron_id): # Delete the mapping from new style of OFC mapping table - if del_ofc_item(session, resource, quantum_id, + if del_ofc_item(session, resource, neutron_id, old_style=False, warning=False): return # Delete old style of OFC mapping table - if del_ofc_item(session, resource, quantum_id, + if del_ofc_item(session, resource, neutron_id, old_style=True, warning=False): return # The specified resource not found LOG.warning(_("_del_ofc_item(): NotFound item " "(resource=%(resource)s, id=%(id)s) "), - {'resource': resource, 'id': quantum_id}) + {'resource': resource, 'id': neutron_id}) def get_portinfo(session, id): @@ -217,7 +217,7 @@ def get_port_from_device(port_id): if not port_and_sgs: return None port = port_and_sgs[0][0] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin._make_port_dict(port) port_dict[ext_sg.SECURITYGROUPS] = [ sg_id for port_, sg_id in port_and_sgs if sg_id] diff --git a/quantum/plugins/nec/db/models.py b/neutron/plugins/nec/db/models.py similarity index 82% rename from quantum/plugins/nec/db/models.py rename to neutron/plugins/nec/db/models.py index 614570c872..7c5d79f22b 100644 --- a/quantum/plugins/nec/db/models.py +++ b/neutron/plugins/nec/db/models.py @@ -17,8 +17,8 @@ import sqlalchemy as sa -from quantum.db import model_base -from quantum.db import models_v2 +from neutron.db import model_base +from neutron.db import models_v2 """New mapping tables.""" @@ -29,48 +29,48 @@ class OFCId(object): ofc_id = sa.Column(sa.String(255), unique=True, nullable=False) -class QuantumId(object): +class NeutronId(object): """Logical ID on Quantum.""" quantum_id = sa.Column(sa.String(36), primary_key=True) -class OFCTenantMapping(model_base.BASEV2, QuantumId, OFCId): +class OFCTenantMapping(model_base.BASEV2, NeutronId, OFCId): """Represents a Tenant on OpenFlow Network/Controller.""" -class OFCNetworkMapping(model_base.BASEV2, QuantumId, OFCId): +class OFCNetworkMapping(model_base.BASEV2, NeutronId, OFCId): """Represents a Network on OpenFlow Network/Controller.""" -class OFCPortMapping(model_base.BASEV2, QuantumId, OFCId): +class OFCPortMapping(model_base.BASEV2, NeutronId, OFCId): """Represents a Port on OpenFlow Network/Controller.""" -class OFCFilterMapping(model_base.BASEV2, QuantumId, OFCId): +class OFCFilterMapping(model_base.BASEV2, NeutronId, OFCId): """Represents a Filter on OpenFlow Network/Controller.""" """Old mapping tables.""" -class HasQuantumId(object): +class HasNeutronId(object): """Logical ID on Quantum.""" quantum_id = sa.Column(sa.String(36), nullable=False) -class OFCTenant(model_base.BASEV2, models_v2.HasId, HasQuantumId): +class OFCTenant(model_base.BASEV2, models_v2.HasId, HasNeutronId): """Represents a Tenant on OpenFlow Network/Controller.""" -class OFCNetwork(model_base.BASEV2, models_v2.HasId, HasQuantumId): +class OFCNetwork(model_base.BASEV2, models_v2.HasId, HasNeutronId): """Represents a Network on OpenFlow Network/Controller.""" -class OFCPort(model_base.BASEV2, models_v2.HasId, HasQuantumId): +class OFCPort(model_base.BASEV2, models_v2.HasId, HasNeutronId): """Represents a Port on OpenFlow Network/Controller.""" -class OFCFilter(model_base.BASEV2, models_v2.HasId, HasQuantumId): +class OFCFilter(model_base.BASEV2, models_v2.HasId, HasNeutronId): """Represents a Filter on OpenFlow Network/Controller.""" diff --git a/quantum/plugins/nec/db/nec_plugin_base.py b/neutron/plugins/nec/db/nec_plugin_base.py similarity index 93% rename from quantum/plugins/nec/db/nec_plugin_base.py rename to neutron/plugins/nec/db/nec_plugin_base.py index fedf81c9f4..befc595194 100644 --- a/quantum/plugins/nec/db/nec_plugin_base.py +++ b/neutron/plugins/nec/db/nec_plugin_base.py @@ -17,18 +17,18 @@ from sqlalchemy.orm import exc -from quantum.api.v2 import attributes -from quantum.db import db_base_plugin_v2 -from quantum.openstack.common import log as logging -from quantum.openstack.common import uuidutils -from quantum.plugins.nec.common import exceptions as q_exc -from quantum.plugins.nec.db import models as nmodels +from neutron.api.v2 import attributes +from neutron.db import db_base_plugin_v2 +from neutron.openstack.common import log as logging +from neutron.openstack.common import uuidutils +from neutron.plugins.nec.common import exceptions as q_exc +from neutron.plugins.nec.db import models as nmodels LOG = logging.getLogger(__name__) -class NECPluginV2Base(db_base_plugin_v2.QuantumDbPluginV2): +class NECPluginV2Base(db_base_plugin_v2.NeutronDbPluginV2): """Base class of plugins that handle packet filters.""" diff --git a/quantum/plugins/nec/drivers/__init__.py b/neutron/plugins/nec/drivers/__init__.py similarity index 89% rename from quantum/plugins/nec/drivers/__init__.py rename to neutron/plugins/nec/drivers/__init__.py index 98f69c4a94..178b34d343 100644 --- a/quantum/plugins/nec/drivers/__init__.py +++ b/neutron/plugins/nec/drivers/__init__.py @@ -15,12 +15,12 @@ # under the License. # @author: Ryota MIBU -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) -DRIVER_PATH = "quantum.plugins.nec.drivers.%s" +DRIVER_PATH = "neutron.plugins.nec.drivers.%s" DRIVER_LIST = { 'trema': DRIVER_PATH % "trema.TremaPortBaseDriver", 'trema_port': DRIVER_PATH % "trema.TremaPortBaseDriver", diff --git a/quantum/plugins/nec/drivers/pfc.py b/neutron/plugins/nec/drivers/pfc.py similarity index 97% rename from quantum/plugins/nec/drivers/pfc.py rename to neutron/plugins/nec/drivers/pfc.py index 26805bf59a..e60bb89073 100644 --- a/quantum/plugins/nec/drivers/pfc.py +++ b/neutron/plugins/nec/drivers/pfc.py @@ -19,9 +19,9 @@ import re import uuid -from quantum.plugins.nec.common import ofc_client -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec import ofc_driver_base +from neutron.plugins.nec.common import ofc_client +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec import ofc_driver_base class PFCDriverBase(ofc_driver_base.OFCDriverBase): diff --git a/quantum/plugins/nec/drivers/trema.py b/neutron/plugins/nec/drivers/trema.py similarity index 98% rename from quantum/plugins/nec/drivers/trema.py rename to neutron/plugins/nec/drivers/trema.py index 22b10ed6c8..e4081e1d2a 100644 --- a/quantum/plugins/nec/drivers/trema.py +++ b/neutron/plugins/nec/drivers/trema.py @@ -16,10 +16,10 @@ # @author: Ryota MIBU # @author: Akihiro MOTOKI -from quantum.openstack.common import uuidutils -from quantum.plugins.nec.common import ofc_client -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec import ofc_driver_base +from neutron.openstack.common import uuidutils +from neutron.plugins.nec.common import ofc_client +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec import ofc_driver_base class TremaDriverBase(ofc_driver_base.OFCDriverBase): diff --git a/quantum/plugins/nec/extensions/__init__.py b/neutron/plugins/nec/extensions/__init__.py similarity index 100% rename from quantum/plugins/nec/extensions/__init__.py rename to neutron/plugins/nec/extensions/__init__.py diff --git a/quantum/plugins/nec/extensions/packetfilter.py b/neutron/plugins/nec/extensions/packetfilter.py similarity index 95% rename from quantum/plugins/nec/extensions/packetfilter.py rename to neutron/plugins/nec/extensions/packetfilter.py index fe3bb6f92a..ce485eb16f 100644 --- a/quantum/plugins/nec/extensions/packetfilter.py +++ b/neutron/plugins/nec/extensions/packetfilter.py @@ -20,11 +20,11 @@ from oslo.config import cfg -from quantum.api import extensions -from quantum.api.v2 import attributes -from quantum.api.v2 import base -from quantum.manager import QuantumManager -from quantum import quota +from neutron.api import extensions +from neutron.api.v2 import attributes +from neutron.api.v2 import base +from neutron.manager import NeutronManager +from neutron import quota quota_packet_filter_opts = [ @@ -122,7 +122,7 @@ class Packetfilter(extensions.ExtensionDescriptor): def get_resources(self): resource = base.create_resource('packet_filters', 'packet_filter', - QuantumManager.get_plugin(), + NeutronManager.get_plugin(), PACKET_FILTER_ATTR_MAP) qresource = quota.CountableResource('packet_filter', quota._count_resource, diff --git a/quantum/plugins/nec/nec_plugin.py b/neutron/plugins/nec/nec_plugin.py similarity index 95% rename from quantum/plugins/nec/nec_plugin.py rename to neutron/plugins/nec/nec_plugin.py index e3f18bedfc..d3444e4e28 100644 --- a/quantum/plugins/nec/nec_plugin.py +++ b/neutron/plugins/nec/nec_plugin.py @@ -16,31 +16,31 @@ # @author: Ryota MIBU # @author: Akihiro MOTOKI -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api -from quantum.common import exceptions as q_exc -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.db import agents_db -from quantum.db import agentschedulers_db -from quantum.db import db_base_plugin_v2 -from quantum.db import dhcp_rpc_base -from quantum.db import extraroute_db -from quantum.db import l3_gwmode_db -from quantum.db import l3_rpc_base -from quantum.db import quota_db # noqa -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.extensions import portbindings -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import proxy -from quantum.plugins.nec.common import config -from quantum.plugins.nec.common import exceptions as nexc -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec.db import nec_plugin_base -from quantum.plugins.nec import ofc_manager +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api +from neutron.common import exceptions as q_exc +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.db import agents_db +from neutron.db import agentschedulers_db +from neutron.db import db_base_plugin_v2 +from neutron.db import dhcp_rpc_base +from neutron.db import extraroute_db +from neutron.db import l3_gwmode_db +from neutron.db import l3_rpc_base +from neutron.db import quota_db # noqa +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.extensions import portbindings +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import proxy +from neutron.plugins.nec.common import config +from neutron.plugins.nec.common import exceptions as nexc +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec.db import nec_plugin_base +from neutron.plugins.nec import ofc_manager LOG = logging.getLogger(__name__) @@ -67,12 +67,12 @@ class NECPluginV2(nec_plugin_base.NECPluginV2Base, agentschedulers_db.AgentSchedulerDbMixin): """NECPluginV2 controls an OpenFlow Controller. - The Quantum NECPluginV2 maps L2 logical networks to L2 virtualized networks + The Neutron NECPluginV2 maps L2 logical networks to L2 virtualized networks on an OpenFlow enabled network. An OpenFlow Controller (OFC) provides L2 network isolation without VLAN and this plugin controls the OFC. - NOTE: This is for Quantum API V2. Codes for V1.0 and V1.1 are available - at https://github.com/nec-openstack/quantum-openflow-plugin . + NOTE: This is for Neutron API V2. Codes for V1.0 and V1.1 are available + at https://github.com/nec-openstack/neutron-openflow-plugin . The port binding extension enables an external application relay information to and from the plugin. @@ -102,14 +102,16 @@ class NECPluginV2(nec_plugin_base.NECPluginV2Base, # if no api_extensions_path is specified. if not config.CONF.api_extensions_path: config.CONF.set_override('api_extensions_path', - 'quantum/plugins/nec/extensions') + 'neutron/plugins/nec/extensions') self.setup_rpc() self.network_scheduler = importutils.import_object( - config.CONF.network_scheduler_driver) + config.CONF.network_scheduler_driver + ) self.router_scheduler = importutils.import_object( - config.CONF.router_scheduler_driver) + config.CONF.router_scheduler_driver + ) def setup_rpc(self): self.topic = topics.PLUGIN diff --git a/quantum/plugins/nec/ofc_driver_base.py b/neutron/plugins/nec/ofc_driver_base.py similarity index 86% rename from quantum/plugins/nec/ofc_driver_base.py rename to neutron/plugins/nec/ofc_driver_base.py index 94b6152532..680286101d 100644 --- a/quantum/plugins/nec/ofc_driver_base.py +++ b/neutron/plugins/nec/ofc_driver_base.py @@ -36,7 +36,7 @@ class OFCDriverBase(object): :param tenant_id: A hint of OFC tenant ID. A driver could use this id as a OFC id or ignore it. :returns: ID of the tenant created at OpenFlow Controller. - :raises: quantum.plugin.nec.common.exceptions.OFCException + :raises: neutron.plugin.nec.common.exceptions.OFCException """ pass @@ -44,7 +44,7 @@ class OFCDriverBase(object): def delete_tenant(self, ofc_tenant_id): """Delete a tenant at OpenFlow Controller. - :raises: quantum.plugin.nec.common.exceptions.OFCException + :raises: neutron.plugin.nec.common.exceptions.OFCException """ pass @@ -59,7 +59,7 @@ class OFCDriverBase(object): ID returned must be unique in the OpenFlow Controller. If a network is identified in conjunction with other information such as a tenant ID, such information should be included in the ID. - :raises: quantum.plugin.nec.common.exceptions.OFCException + :raises: neutron.plugin.nec.common.exceptions.OFCException """ pass @@ -67,7 +67,7 @@ class OFCDriverBase(object): def delete_network(self, ofc_network_id): """Delete a netwrok at OpenFlow Controller. - :raises: quantum.plugin.nec.common.exceptions.OFCException + :raises: neutron.plugin.nec.common.exceptions.OFCException """ pass @@ -90,7 +90,7 @@ class OFCDriverBase(object): a tenant, such information should be included in the ID. :returns: ID of the port created at OpenFlow Controller. - :raises: quantum.plugin.nec.common.exceptions.OFCException + :raises: neutron.plugin.nec.common.exceptions.OFCException """ pass @@ -98,7 +98,7 @@ class OFCDriverBase(object): def delete_port(self, ofc_port_id): """Delete a port at OpenFlow Controller. - :raises: quantum.plugin.nec.common.exceptions.OFCException + :raises: neutron.plugin.nec.common.exceptions.OFCException """ pass @@ -106,7 +106,7 @@ class OFCDriverBase(object): def convert_ofc_tenant_id(self, context, ofc_tenant_id): """Convert old-style ofc tenand id to new-style one. - :param context: quantum context object + :param context: neutron context object :param ofc_tenant_id: ofc_tenant_id to be converted """ pass @@ -116,9 +116,9 @@ class OFCDriverBase(object): tenant_id): """Convert old-style ofc network id to new-style one. - :param context: quantum context object + :param context: neutron context object :param ofc_network_id: ofc_network_id to be converted - :param tenant_id: quantum tenant_id of the network + :param tenant_id: neutron tenant_id of the network """ pass @@ -127,9 +127,9 @@ class OFCDriverBase(object): tenant_id, network_id): """Convert old-style ofc port id to new-style one. - :param context: quantum context object + :param context: neutron context object :param ofc_port_id: ofc_port_id to be converted - :param tenant_id: quantum tenant_id of the port - :param network_id: quantum network_id of the port + :param tenant_id: neutron tenant_id of the port + :param network_id: neutron network_id of the port """ pass diff --git a/quantum/plugins/nec/ofc_manager.py b/neutron/plugins/nec/ofc_manager.py similarity index 88% rename from quantum/plugins/nec/ofc_manager.py rename to neutron/plugins/nec/ofc_manager.py index 91e3cff334..fd80a00f79 100644 --- a/quantum/plugins/nec/ofc_manager.py +++ b/neutron/plugins/nec/ofc_manager.py @@ -16,17 +16,17 @@ # @author: Ryota MIBU # @author: Akihiro MOTOKI -from quantum.plugins.nec.common import config -from quantum.plugins.nec.common import exceptions as nexc -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec import drivers +from neutron.plugins.nec.common import config +from neutron.plugins.nec.common import exceptions as nexc +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec import drivers class OFCManager(object): """This class manages an OpenFlow Controller and map resources. This class manage an OpenFlow Controller (OFC) with a driver specified in - a configuration of this plugin. This keeps mappings between IDs on Quantum + a configuration of this plugin. This keeps mappings between IDs on Neutron and OFC for various entities such as Tenant, Network and Filter. A Port on OFC is identified by a switch ID 'datapath_id' and a port number 'port_no' of the switch. An ID named as 'ofc_*' is used to identify resource on OFC. @@ -35,20 +35,20 @@ class OFCManager(object): def __init__(self): self.driver = drivers.get_driver(config.OFC.driver)(config.OFC) - def _get_ofc_id(self, context, resource, quantum_id): + def _get_ofc_id(self, context, resource, neutron_id): return ndb.get_ofc_id_lookup_both(context.session, - resource, quantum_id) + resource, neutron_id) - def _exists_ofc_item(self, context, resource, quantum_id): + def _exists_ofc_item(self, context, resource, neutron_id): return ndb.exists_ofc_item_lookup_both(context.session, - resource, quantum_id) + resource, neutron_id) - def _add_ofc_item(self, context, resource, quantum_id, ofc_id): + def _add_ofc_item(self, context, resource, neutron_id, ofc_id): # Ensure a new item is added to the new mapping table - ndb.add_ofc_item(context.session, resource, quantum_id, ofc_id) + ndb.add_ofc_item(context.session, resource, neutron_id, ofc_id) - def _del_ofc_item(self, context, resource, quantum_id): - ndb.del_ofc_item_lookup_both(context.session, resource, quantum_id) + def _del_ofc_item(self, context, resource, neutron_id): + ndb.del_ofc_item_lookup_both(context.session, resource, neutron_id) def create_ofc_tenant(self, context, tenant_id): desc = "ID=%s at OpenStack." % tenant_id @@ -72,7 +72,7 @@ class OFCManager(object): ofc_tenant_id = self.driver.convert_ofc_tenant_id( context, ofc_tenant_id) - desc = "ID=%s Name=%s at Quantum." % (network_id, network_name) + desc = "ID=%s Name=%s at Neutron." % (network_id, network_name) ofc_net_id = self.driver.create_network(ofc_tenant_id, desc, network_id) self._add_ofc_item(context, "ofc_network", network_id, ofc_net_id) diff --git a/quantum/plugins/nicira/QuantumPlugin.py b/neutron/plugins/nicira/NeutronPlugin.py similarity index 92% rename from quantum/plugins/nicira/QuantumPlugin.py rename to neutron/plugins/nicira/NeutronPlugin.py index 82fcc673a3..acb933e047 100644 --- a/quantum/plugins/nicira/QuantumPlugin.py +++ b/neutron/plugins/nicira/NeutronPlugin.py @@ -28,49 +28,49 @@ from oslo.config import cfg from sqlalchemy.orm import exc as sa_exc import webob.exc -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.v2 import attributes as attr -from quantum.api.v2 import base -from quantum.common import constants -from quantum.common import exceptions as q_exc -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.common import utils -from quantum import context as q_context -from quantum.db import agents_db -from quantum.db import agentschedulers_db -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import dhcp_rpc_base -from quantum.db import l3_db -from quantum.db import models_v2 -from quantum.db import portsecurity_db -from quantum.db import quota_db # noqa -from quantum.db import securitygroups_db -from quantum.extensions import l3 -from quantum.extensions import portsecurity as psec -from quantum.extensions import providernet as pnet -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import excutils -from quantum.openstack.common import importutils -from quantum.openstack.common import rpc -from quantum.plugins.nicira.common import config # noqa -from quantum.plugins.nicira.common import exceptions as nvp_exc -from quantum.plugins.nicira.common import metadata_access as nvp_meta -from quantum.plugins.nicira.common import securitygroups as nvp_sec -from quantum.plugins.nicira.dbexts import maclearning as mac_db -from quantum.plugins.nicira.dbexts import nicira_db -from quantum.plugins.nicira.dbexts import nicira_networkgw_db as networkgw_db -from quantum.plugins.nicira.dbexts import nicira_qos_db as qos_db -from quantum.plugins.nicira.extensions import maclearning as mac_ext -from quantum.plugins.nicira.extensions import nvp_networkgw as networkgw -from quantum.plugins.nicira.extensions import nvp_qos as ext_qos -from quantum.plugins.nicira import nvp_cluster -from quantum.plugins.nicira import NvpApiClient -from quantum.plugins.nicira import nvplib +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.v2 import attributes as attr +from neutron.api.v2 import base +from neutron.common import constants +from neutron.common import exceptions as q_exc +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.common import utils +from neutron import context as q_context +from neutron.db import agents_db +from neutron.db import agentschedulers_db +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import dhcp_rpc_base +from neutron.db import l3_db +from neutron.db import models_v2 +from neutron.db import portsecurity_db +from neutron.db import quota_db # noqa +from neutron.db import securitygroups_db +from neutron.extensions import l3 +from neutron.extensions import portsecurity as psec +from neutron.extensions import providernet as pnet +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import excutils +from neutron.openstack.common import importutils +from neutron.openstack.common import rpc +from neutron.plugins.nicira.common import config # noqa +from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira.common import metadata_access as nvp_meta +from neutron.plugins.nicira.common import securitygroups as nvp_sec +from neutron.plugins.nicira.dbexts import maclearning as mac_db +from neutron.plugins.nicira.dbexts import nicira_db +from neutron.plugins.nicira.dbexts import nicira_networkgw_db as networkgw_db +from neutron.plugins.nicira.dbexts import nicira_qos_db as qos_db +from neutron.plugins.nicira.extensions import maclearning as mac_ext +from neutron.plugins.nicira.extensions import nvp_networkgw as networkgw +from neutron.plugins.nicira.extensions import nvp_qos as ext_qos +from neutron.plugins.nicira import nvp_cluster +from neutron.plugins.nicira import NvpApiClient +from neutron.plugins.nicira import nvplib -LOG = logging.getLogger("QuantumPlugin") +LOG = logging.getLogger("NeutronPlugin") NVP_NOSNAT_RULES_ORDER = 10 NVP_FLOATINGIP_NAT_RULES_ORDER = 224 NVP_EXTGW_NAT_RULES_ORDER = 255 @@ -123,7 +123,7 @@ class NVPRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin): agents_db.AgentExtRpcCallback()]) -class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class NvpPluginV2(db_base_plugin_v2.NeutronDbPluginV2, l3_db.L3_NAT_db_mixin, portsecurity_db.PortSecurityDbMixin, securitygroups_db.SecurityGroupDbMixin, @@ -135,7 +135,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, agentschedulers_db.AgentSchedulerDbMixin): """L2 Virtual network plugin. - NvpPluginV2 is a Quantum plugin that provides L2 Virtual Network + NvpPluginV2 is a Neutron plugin that provides L2 Virtual Network functionality using NVP. """ @@ -193,7 +193,8 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, # Set up RPC interface for DHCP agent self.setup_rpc() self.network_scheduler = importutils.import_object( - cfg.CONF.network_scheduler_driver) + cfg.CONF.network_scheduler_driver + ) # Set this flag to false as the default gateway has not # been yet updated from the config file self._is_default_net_gw_in_sync = False @@ -265,7 +266,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, LOG.exception(_("Unable to create port on NVP logical router %s"), router_id) raise nvp_exc.NvpPluginException( - err_msg=_("Unable to create logical router port for quantum " + err_msg=_("Unable to create logical router port for neutron " "port id %(port_id)s on router %(router_id)s") % {'port_id': port_data.get('id'), 'router_id': router_id}) self._update_router_port_attachment(cluster, context, router_id, @@ -296,12 +297,12 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, nvp_router_port_id) LOG.exception(_("Unable to plug attachment in NVP logical " "router port %(r_port_id)s, associated with " - "Quantum %(q_port_id)s"), + "Neutron %(q_port_id)s"), {'r_port_id': nvp_router_port_id, 'q_port_id': port_data.get('id')}) raise nvp_exc.NvpPluginException( err_msg=(_("Unable to plug attachment in router port " - "%(r_port_id)s for quantum port id %(q_port_id)s " + "%(r_port_id)s for neutron port id %(q_port_id)s " "on router %(router_id)s") % {'r_port_id': nvp_router_port_id, 'q_port_id': port_data.get('id'), @@ -310,7 +311,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, def _get_port_by_device_id(self, context, device_id, device_owner): """Retrieve ports associated with a specific device id. - Used for retrieving all quantum ports attached to a given router. + Used for retrieving all neutron ports attached to a given router. """ port_qry = context.session.query(models_v2.Port) return port_qry.filter_by( @@ -383,7 +384,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, selected_lswitch['uuid'], port_data, True) - nicira_db.add_quantum_nvp_port_mapping( + nicira_db.add_neutron_nvp_port_mapping( context.session, port_data['id'], lport['uuid']) if (not port_data['device_owner'] in (l3_db.DEVICE_OWNER_ROUTER_GW, @@ -398,7 +399,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, msg = (_("An exception occured while plugging the interface " "into network:%s") % port_data['network_id']) LOG.exception(msg) - raise q_exc.QuantumException(message=msg) + raise q_exc.NeutronException(message=msg) def _nvp_delete_port(self, context, port_data): # FIXME(salvatore-orlando): On the NVP platform we do not really have @@ -469,7 +470,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, selected_lswitch['uuid'], port_data, False) - nicira_db.add_quantum_nvp_port_mapping( + nicira_db.add_neutron_nvp_port_mapping( context.session, port_data['id'], lport['uuid']) LOG.debug(_("_nvp_create_port completed for port %(name)s on " "network %(network_id)s. The new port id is %(id)s."), @@ -503,7 +504,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, # is created at the same time as the NVP logical router, otherwise # the fabric status of the NVP router will be down. # admin_status should always be up for the gateway port - # regardless of what the user specifies in quantum + # regardless of what the user specifies in neutron router_id = port_data['device_id'] nvplib.update_router_lport(self.cluster, router_id, @@ -601,7 +602,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, selected_lswitch['uuid'], port_data, True) - nicira_db.add_quantum_nvp_port_mapping( + nicira_db.add_neutron_nvp_port_mapping( context.session, port_data['id'], lport['uuid']) nvplib.plug_l2_gw_service( self.cluster, @@ -623,35 +624,35 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, # this is a no-op driver pass - def _nvp_get_port_id(self, context, cluster, quantum_port): - """Return the NVP port uuid for a given quantum port. + def _nvp_get_port_id(self, context, cluster, neutron_port): + """Return the NVP port uuid for a given neutron port. - First, look up the Quantum database. If not found, execute + First, look up the Neutron database. If not found, execute a query on NVP platform as the mapping might be missing because the port was created before upgrading to grizzly. """ nvp_port_id = nicira_db.get_nvp_port_id(context.session, - quantum_port['id']) + neutron_port['id']) if nvp_port_id: return nvp_port_id # Perform a query to NVP and then update the DB try: - nvp_port = nvplib.get_port_by_quantum_tag( + nvp_port = nvplib.get_port_by_neutron_tag( cluster, - quantum_port['network_id'], - quantum_port['id']) + neutron_port['network_id'], + neutron_port['id']) if nvp_port: - nicira_db.add_quantum_nvp_port_mapping( + nicira_db.add_neutron_nvp_port_mapping( context.session, - quantum_port['id'], + neutron_port['id'], nvp_port['uuid']) return nvp_port['uuid'] except Exception: - LOG.exception(_("Unable to find NVP uuid for Quantum port %s"), - quantum_port['id']) + LOG.exception(_("Unable to find NVP uuid for Neutron port %s"), + neutron_port['id']) def _extend_fault_map(self): - """Extends the Quantum Fault Map. + """Extends the Neutron Fault Map. Exceptions specific to the NVP Plugin are mapped to standard HTTP Exceptions. @@ -848,7 +849,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, port['nvp_port_id'] = nvp_port_id else: LOG.warning(_("A nvp lport identifier was not found for " - "quantum port '%s'"), port['id']) + "neutron port '%s'"), port['id']) super(NvpPluginV2, self).delete_network(context, id) # clean up network owned ports @@ -891,7 +892,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, try: lswitches = nvplib.get_lswitches(self.cluster, id) nvp_net_status = constants.NET_STATUS_ACTIVE - quantum_status = network.status + neutron_status = network.status for lswitch in lswitches: relations = lswitch.get('_relations') if relations: @@ -905,9 +906,9 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, nvp_net_status = constants.NET_STATUS_DOWN break LOG.debug(_("Current network status:%(nvp_net_status)s; " - "Status in Quantum DB:%(quantum_status)s"), + "Status in Neutron DB:%(neutron_status)s"), {'nvp_net_status': nvp_net_status, - 'quantum_status': quantum_status}) + 'neutron_status': neutron_status}) if nvp_net_status != network.status: # update the network status network.status = nvp_net_status @@ -929,9 +930,9 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, nvp_lswitches = {} filters = filters or {} with context.session.begin(subtransactions=True): - quantum_lswitches = ( + neutron_lswitches = ( super(NvpPluginV2, self).get_networks(context, filters)) - for net in quantum_lswitches: + for net in neutron_lswitches: self._extend_network_dict_provider(context, net) self._extend_network_port_security_dict(context, net) self._extend_network_qos_queue(context, net) @@ -971,28 +972,28 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, (uuid, ls) for (uuid, ls) in nvp_lswitches.iteritems() if uuid in set(filters['id'])) - for quantum_lswitch in quantum_lswitches: + for neutron_lswitch in neutron_lswitches: # Skip external networks as they do not exist in NVP - if quantum_lswitch[l3.EXTERNAL]: + if neutron_lswitch[l3.EXTERNAL]: continue - elif quantum_lswitch['id'] not in nvp_lswitches: - LOG.warning(_("Logical Switch %s found in quantum database " - "but not in NVP."), quantum_lswitch["id"]) - quantum_lswitch["status"] = constants.NET_STATUS_ERROR + elif neutron_lswitch['id'] not in nvp_lswitches: + LOG.warning(_("Logical Switch %s found in neutron database " + "but not in NVP."), neutron_lswitch["id"]) + neutron_lswitch["status"] = constants.NET_STATUS_ERROR else: # TODO(salvatore-orlando): be careful about "extended" # logical switches - ls = nvp_lswitches.pop(quantum_lswitch['id']) + ls = nvp_lswitches.pop(neutron_lswitch['id']) if (ls["_relations"]["LogicalSwitchStatus"]["fabric_status"]): - quantum_lswitch["status"] = constants.NET_STATUS_ACTIVE + neutron_lswitch["status"] = constants.NET_STATUS_ACTIVE else: - quantum_lswitch["status"] = constants.NET_STATUS_DOWN + neutron_lswitch["status"] = constants.NET_STATUS_DOWN # do not make the case in which switches are found in NVP - # but not in Quantum catastrophic. + # but not in Neutron catastrophic. if nvp_lswitches: LOG.warning(_("Found %s logical switches not bound " - "to Quantum networks. Quantum and NVP are " + "to Neutron networks. Neutron and NVP are " "potentially out of sync"), len(nvp_lswitches)) LOG.debug(_("get_networks() completed for tenant %s"), @@ -1000,14 +1001,14 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, if fields: ret_fields = [] - for quantum_lswitch in quantum_lswitches: + for neutron_lswitch in neutron_lswitches: row = {} for field in fields: - row[field] = quantum_lswitch[field] + row[field] = neutron_lswitch[field] ret_fields.append(row) return ret_fields - return quantum_lswitches + return neutron_lswitches def update_network(self, context, id, network): pnet._raise_if_updates_provider_attributes(network['network']) @@ -1033,19 +1034,19 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, def get_ports(self, context, filters=None, fields=None): with context.session.begin(subtransactions=True): - quantum_lports = super(NvpPluginV2, self).get_ports( + neutron_lports = super(NvpPluginV2, self).get_ports( context, filters) - for quantum_lport in quantum_lports: - self._extend_port_port_security_dict(context, quantum_lport) - self._extend_port_mac_learning_state(context, quantum_lport) + for neutron_lport in neutron_lports: + self._extend_port_port_security_dict(context, neutron_lport) + self._extend_port_mac_learning_state(context, neutron_lport) if (filters.get('network_id') and len(filters.get('network_id')) and self._network_is_external(context, filters['network_id'][0])): # Do not perform check on NVP platform - return quantum_lports + return neutron_lports vm_filter = "" tenant_filter = "" - # This is used when calling delete_network. Quantum checks to see if + # This is used when calling delete_network. Neutron checks to see if # the network has any ports. if filters.get("network_id"): # FIXME (Aaron) If we get more than one network_id this won't work @@ -1093,37 +1094,37 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, raise nvp_exc.NvpPluginException(err_msg=err_msg) lports = [] - for quantum_lport in quantum_lports: - # if a quantum port is not found in NVP, this migth be because + for neutron_lport in neutron_lports: + # if a neutron port is not found in NVP, this migth be because # such port is not mapped to a logical switch - ie: floating ip - if quantum_lport['device_owner'] in (l3_db.DEVICE_OWNER_FLOATINGIP, + if neutron_lport['device_owner'] in (l3_db.DEVICE_OWNER_FLOATINGIP, l3_db.DEVICE_OWNER_ROUTER_GW): - lports.append(quantum_lport) + lports.append(neutron_lport) continue try: - quantum_lport["admin_state_up"] = ( - nvp_lports[quantum_lport["id"]]["admin_status_enabled"]) + neutron_lport["admin_state_up"] = ( + nvp_lports[neutron_lport["id"]]["admin_status_enabled"]) - if (nvp_lports[quantum_lport["id"]] + if (nvp_lports[neutron_lport["id"]] ["_relations"] ["LogicalPortStatus"] ["fabric_status_up"]): - quantum_lport["status"] = constants.PORT_STATUS_ACTIVE + neutron_lport["status"] = constants.PORT_STATUS_ACTIVE else: - quantum_lport["status"] = constants.PORT_STATUS_DOWN + neutron_lport["status"] = constants.PORT_STATUS_DOWN - del nvp_lports[quantum_lport["id"]] + del nvp_lports[neutron_lport["id"]] except KeyError: - quantum_lport["status"] = constants.PORT_STATUS_ERROR - LOG.debug(_("Quantum logical port %s was not found on NVP"), - quantum_lport['id']) + neutron_lport["status"] = constants.PORT_STATUS_ERROR + LOG.debug(_("Neutron logical port %s was not found on NVP"), + neutron_lport['id']) - lports.append(quantum_lport) + lports.append(neutron_lport) # do not make the case in which ports are found in NVP - # but not in Quantum catastrophic. + # but not in Neutron catastrophic. if nvp_lports: LOG.warning(_("Found %s logical ports not bound " - "to Quantum ports. Quantum and NVP are " + "to Neutron ports. Neutron and NVP are " "potentially out of sync"), len(nvp_lports)) if fields: @@ -1145,17 +1146,17 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, port_data = port['port'] notify_dhcp_agent = False with context.session.begin(subtransactions=True): - # First we allocate port in quantum database - quantum_db = super(NvpPluginV2, self).create_port(context, port) - # Update fields obtained from quantum db (eg: MAC address) - port["port"].update(quantum_db) + # First we allocate port in neutron database + neutron_db = super(NvpPluginV2, self).create_port(context, port) + # Update fields obtained from neutron db (eg: MAC address) + port["port"].update(neutron_db) # metadata_dhcp_host_route if (cfg.CONF.NVP.metadata_mode == "dhcp_host_route" and - quantum_db.get('device_owner') == constants.DEVICE_OWNER_DHCP): - if (quantum_db.get('fixed_ips') and - len(quantum_db['fixed_ips'])): + neutron_db.get('device_owner') == constants.DEVICE_OWNER_DHCP): + if (neutron_db.get('fixed_ips') and + len(neutron_db['fixed_ips'])): notify_dhcp_agent = self._ensure_metadata_host_route( - context, quantum_db['fixed_ips'][0]) + context, neutron_db['fixed_ips'][0]) # port security extension checks (port_security, has_ip) = self._determine_port_security_and_has_ip( context, port_data) @@ -1179,7 +1180,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, elif mac_ext.MAC_LEARNING in port_data: port_data.pop(mac_ext.MAC_LEARNING) # provider networking extension checks - # Fetch the network and network binding from Quantum db + # Fetch the network and network binding from neutron db try: port_data = port['port'].copy() port_create_func = self._port_drivers['create'].get( @@ -1211,7 +1212,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, self.schedule_network(context, net) if notify_dhcp_agent: self._send_subnet_update_end( - context, quantum_db['fixed_ips'][0]['subnet_id']) + context, neutron_db['fixed_ips'][0]['subnet_id']) return port_data def update_port(self, context, id, port): @@ -1329,26 +1330,26 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, # a l3 router. If so, we should prevent deletion here if l3_port_check: self.prevent_l3_port_deletion(context, id) - quantum_db_port = self.get_port(context, id) + neutron_db_port = self.get_port(context, id) # Perform the same check for ports owned by layer-2 gateways if nw_gw_port_check: self.prevent_network_gateway_port_deletion(context, - quantum_db_port) + neutron_db_port) port_delete_func = self._port_drivers['delete'].get( - quantum_db_port['device_owner'], + neutron_db_port['device_owner'], self._port_drivers['delete']['default']) - port_delete_func(context, quantum_db_port) + port_delete_func(context, neutron_db_port) self.disassociate_floatingips(context, id) notify_dhcp_agent = False with context.session.begin(subtransactions=True): queue = self._get_port_queue_bindings(context, {'port_id': [id]}) # metadata_dhcp_host_route - port_device_owner = quantum_db_port['device_owner'] + port_device_owner = neutron_db_port['device_owner'] if (cfg.CONF.NVP.metadata_mode == "dhcp_host_route" and port_device_owner == constants.DEVICE_OWNER_DHCP): notify_dhcp_agent = self._ensure_metadata_host_route( - context, quantum_db_port['fixed_ips'][0], + context, neutron_db_port['fixed_ips'][0], is_delete=True) super(NvpPluginV2, self).delete_port(context, id) # Delete qos queue if possible @@ -1356,25 +1357,25 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, self.delete_qos_queue(context, queue[0]['queue_id'], False) if notify_dhcp_agent: self._send_subnet_update_end( - context, quantum_db_port['fixed_ips'][0]['subnet_id']) + context, neutron_db_port['fixed_ips'][0]['subnet_id']) def get_port(self, context, id, fields=None): with context.session.begin(subtransactions=True): - quantum_db_port = super(NvpPluginV2, self).get_port(context, + neutron_db_port = super(NvpPluginV2, self).get_port(context, id, fields) - self._extend_port_port_security_dict(context, quantum_db_port) - self._extend_port_qos_queue(context, quantum_db_port) - self._extend_port_mac_learning_state(context, quantum_db_port) + self._extend_port_port_security_dict(context, neutron_db_port) + self._extend_port_qos_queue(context, neutron_db_port) + self._extend_port_mac_learning_state(context, neutron_db_port) if self._network_is_external(context, - quantum_db_port['network_id']): - return quantum_db_port + neutron_db_port['network_id']): + return neutron_db_port nvp_id = self._nvp_get_port_id(context, self.cluster, - quantum_db_port) + neutron_db_port) # If there's no nvp IP do not bother going to NVP and put # the port in error state if nvp_id: - # Find the NVP port corresponding to quantum port_id + # Find the NVP port corresponding to neutron port_id # Do not query by nvp id as the port might be on # an extended switch and we do not store the extended # switch uuid @@ -1385,24 +1386,24 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, if results: port = results[0] port_status = port["_relations"]["LogicalPortStatus"] - quantum_db_port["admin_state_up"] = ( + neutron_db_port["admin_state_up"] = ( port["admin_status_enabled"]) if port_status["fabric_status_up"]: - quantum_db_port["status"] = ( + neutron_db_port["status"] = ( constants.PORT_STATUS_ACTIVE) else: - quantum_db_port["status"] = ( + neutron_db_port["status"] = ( constants.PORT_STATUS_DOWN) else: - quantum_db_port["status"] = ( + neutron_db_port["status"] = ( constants.PORT_STATUS_ERROR) else: - quantum_db_port["status"] = constants.PORT_STATUS_ERROR - return quantum_db_port + neutron_db_port["status"] = constants.PORT_STATUS_ERROR + return neutron_db_port def create_router(self, context, router): # NOTE(salvatore-orlando): We completely override this method in - # order to be able to use the NVP ID as Quantum ID + # order to be able to use the NVP ID as Neutron ID # TODO(salvatore-orlando): Propose upstream patch for allowing # 3rd parties to specify IDs as we do with l2 plugin r = router['router'] @@ -1434,7 +1435,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, lrouter = nvplib.create_lrouter(self.cluster, tenant_id, router['router']['name'], nexthop) - # Use NVP identfier for Quantum resource + # Use NVP identfier for Neutron resource router['router']['id'] = lrouter['uuid'] except NvpApiClient.NvpApiException: raise nvp_exc.NvpPluginException( @@ -1479,7 +1480,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, nvplib.update_lrouter(self.cluster, id, router['router'].get('name'), nexthop) # NOTE(salv-orlando): The exception handling below is not correct, but - # unfortunately nvplib raises a quantum notfound exception when an + # unfortunately nvplib raises a neutron notfound exception when an # object is not found in the underlying backend except q_exc.NotFound: # Put the router in ERROR status @@ -1501,7 +1502,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, # cause the router delete operation to fail too. self._handle_metadata_access_network(context, id, do_create=False) super(NvpPluginV2, self).delete_router(context, id) - # If removal is successful in Quantum it should be so on + # If removal is successful in Neutron it should be so on # the NVP platform too - otherwise the transaction should # be automatically aborted # TODO(salvatore-orlando): Extend the object models in order to @@ -1535,7 +1536,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, router_op_status = constants.NET_STATUS_ERROR if router_op_status != router.status: LOG.debug(_("Current router status:%(router_status)s;" - "Status in Quantum DB:%(db_router_status)s"), + "Status in Neutron DB:%(db_router_status)s"), {'router_status': router_op_status, 'db_router_status': router.status}) # update the router status @@ -1581,10 +1582,10 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, router.status = constants.NET_STATUS_ERROR # do not make the case in which routers are found in NVP - # but not in Quantum catastrophic. + # but not in Neutron catastrophic. if nvp_lrouters: LOG.warning(_("Found %s logical routers not bound " - "to Quantum routers. Quantum and NVP are " + "to Neutron routers. Neutron and NVP are " "potentially out of sync"), len(nvp_lrouters)) return [self._make_router_dict(router, fields) @@ -1600,8 +1601,8 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, # Add port to the logical router as well # The owner of the router port is always the same as the owner of the # router. Use tenant_id from the port instead of fetching more records - # from the Quantum database - # Find the NVP port corresponding to quantum port_id + # from the Neutron database + # Find the NVP port corresponding to neutron port_id results = nvplib.query_lswitch_lports( self.cluster, '*', filters={'tag': port_id, 'tag_scope': 'q_port_id'}) @@ -1692,17 +1693,17 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, LOG.warning(_("The port %(port_id)s, connected to the router " "%(router_id)s was not found on the NVP backend"), {'port_id': port_id, 'router_id': router_id}) - # Finally remove the data from the Quantum DB + # Finally remove the data from the Neutron DB # This will also destroy the port on the logical switch info = super(NvpPluginV2, self).remove_router_interface( context, router_id, interface_info) # Destroy router port (no need to unplug the attachment) - # FIXME(salvatore-orlando): In case of failures in the Quantum plugin + # FIXME(salvatore-orlando): In case of failures in the Neutron plugin # this migth leave a dangling port. We perform the operation here # to leverage validation performed in the base class if not lrouter_port_id: LOG.warning(_("Unable to find NVP logical router port for " - "Quantum port id:%s. Was this port ever paired " + "Neutron port id:%s. Was this port ever paired " "with a logical router?"), port_id) return info @@ -1771,10 +1772,10 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, router_id = fip_db.router_id nvp_gw_port_id = nvplib.find_router_gw_port( context, self.cluster, router_id)['uuid'] - ext_quantum_port_db = self._get_port(context.elevated(), + ext_neutron_port_db = self._get_port(context.elevated(), fip_db.floating_port_id) nvp_floating_ips = self._build_ip_address_list( - context.elevated(), ext_quantum_port_db['fixed_ips']) + context.elevated(), ext_neutron_port_db['fixed_ips']) nvplib.update_lrouter_port_ips(self.cluster, router_id, nvp_gw_port_id, @@ -1906,7 +1907,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, """Create a layer-2 network gateway. Create the gateway service on NVP platform and corresponding data - structures in Quantum datase. + structures in Neutron datase. """ # Ensure the default gateway in the config file is in sync with the db self._ensure_default_network_gateway() @@ -1935,7 +1936,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2, """Remove a layer-2 network gateway. Remove the gateway service from NVP platform and corresponding data - structures in Quantum datase. + structures in Neutron datase. """ # Ensure the default gateway in the config file is in sync with the db self._ensure_default_network_gateway() diff --git a/quantum/plugins/nicira/NvpApiClient.py b/neutron/plugins/nicira/NvpApiClient.py similarity index 99% rename from quantum/plugins/nicira/NvpApiClient.py rename to neutron/plugins/nicira/NvpApiClient.py index caec4811c2..08cad9e920 100644 --- a/quantum/plugins/nicira/NvpApiClient.py +++ b/neutron/plugins/nicira/NvpApiClient.py @@ -19,7 +19,7 @@ import httplib # basic HTTP library for HTTPS connections import logging -from quantum.plugins.nicira.api_client import ( +from neutron.plugins.nicira.api_client import ( client_eventlet, request_eventlet) LOG = logging.getLogger("NVPApiHelper") diff --git a/quantum/plugins/nicira/README b/neutron/plugins/nicira/README similarity index 66% rename from quantum/plugins/nicira/README rename to neutron/plugins/nicira/README index f09b60b408..a5695451bf 100644 --- a/quantum/plugins/nicira/README +++ b/neutron/plugins/nicira/README @@ -3,15 +3,15 @@ nvp-plugin Overview and pre-requisites - This is a Quantum plugin that can talk to a set of NVP controllers and - implements the core Quantum v2 api. In order to use it you must have - Nicira NVP running and configured. You must also have Quantum installed + This is a Neutron plugin that can talk to a set of NVP controllers and + implements the core Neutron v2 api. In order to use it you must have + Nicira NVP running and configured. You must also have Neutron installed and configured. NVP Plugin configuration 1) Database configuration - The NVP plugin leverages the Quantum database. The following connection + The NVP plugin leverages the Neutron database. The following connection parameters should be specified: - connection: Database connection string - max_retries: Maximum number of connection attempts (default 10) @@ -24,22 +24,22 @@ NVP Plugin configuration - nvp_gen_timout: Number of seconds a generation id should be valid for (default -1 meaning do not time out) 3) NVP cluster - By default the Quantum NVP plugin can talk to multiple controllers in a + By default the Neutron NVP plugin can talk to multiple controllers in a single cluster. In the future (Havana+) support for multiple clusters will be added. The following parameters can be configured: - default_tz_uuid: This is uuid of the default NVP Transport zone that - will be used for creating tunneled isolated "Quantum" networks. It - needs to be created in NVP before starting Quantum with the nvp plugin. + will be used for creating tunneled isolated "Neutron" networks. It + needs to be created in NVP before starting Neutron with the nvp plugin. - nvp_cluster_uuid: Optional paramter identifying the UUID of the cluster in NVP. This can be retrieved from NVP management console "admin" section. - nvp_controllers: describes the list of controllers - More details can be found in etc/quantum/plugins/nicira/nvp.ini + More details can be found in etc/neutron/plugins/nicira/nvp.ini -Quantum Configuration +Neutron Configuration - Modify your Quantum configuration for using the NVP Plugin: + Modify your Neutron configuration for using the NVP Plugin: core_plugin = - quantum.plugins.nicira.QuantumPlugin.NvpPluginV2 + neutron.plugins.nicira.neutronPlugin.NvpPluginV2 diff --git a/quantum/plugins/nicira/__init__.py b/neutron/plugins/nicira/__init__.py similarity index 100% rename from quantum/plugins/nicira/__init__.py rename to neutron/plugins/nicira/__init__.py diff --git a/quantum/plugins/nicira/api_client/__init__.py b/neutron/plugins/nicira/api_client/__init__.py similarity index 100% rename from quantum/plugins/nicira/api_client/__init__.py rename to neutron/plugins/nicira/api_client/__init__.py diff --git a/quantum/plugins/nicira/api_client/client.py b/neutron/plugins/nicira/api_client/client.py similarity index 99% rename from quantum/plugins/nicira/api_client/client.py rename to neutron/plugins/nicira/api_client/client.py index 9ce9943a7b..d1f478d5ae 100644 --- a/quantum/plugins/nicira/api_client/client.py +++ b/neutron/plugins/nicira/api_client/client.py @@ -25,7 +25,7 @@ import logging import time -from quantum.plugins.nicira.api_client.common import ( +from neutron.plugins.nicira.api_client.common import ( _conn_str) diff --git a/quantum/plugins/nicira/api_client/client_eventlet.py b/neutron/plugins/nicira/api_client/client_eventlet.py similarity index 98% rename from quantum/plugins/nicira/api_client/client_eventlet.py rename to neutron/plugins/nicira/api_client/client_eventlet.py index da55356c88..25243e4392 100644 --- a/quantum/plugins/nicira/api_client/client_eventlet.py +++ b/neutron/plugins/nicira/api_client/client_eventlet.py @@ -22,8 +22,8 @@ import eventlet import logging import time -from quantum.plugins.nicira.api_client import client -from quantum.plugins.nicira.api_client import request_eventlet +from neutron.plugins.nicira.api_client import client +from neutron.plugins.nicira.api_client import request_eventlet eventlet.monkey_patch() diff --git a/quantum/plugins/nicira/api_client/common.py b/neutron/plugins/nicira/api_client/common.py similarity index 100% rename from quantum/plugins/nicira/api_client/common.py rename to neutron/plugins/nicira/api_client/common.py diff --git a/quantum/plugins/nicira/api_client/request.py b/neutron/plugins/nicira/api_client/request.py similarity index 99% rename from quantum/plugins/nicira/api_client/request.py rename to neutron/plugins/nicira/api_client/request.py index d7bd03bfce..01d08bfda8 100644 --- a/quantum/plugins/nicira/api_client/request.py +++ b/neutron/plugins/nicira/api_client/request.py @@ -26,8 +26,8 @@ import logging import time import urlparse -from quantum.openstack.common import excutils -from quantum.plugins.nicira.api_client.common import ( +from neutron.openstack.common import excutils +from neutron.plugins.nicira.api_client.common import ( _conn_str) diff --git a/quantum/plugins/nicira/api_client/request_eventlet.py b/neutron/plugins/nicira/api_client/request_eventlet.py similarity index 98% rename from quantum/plugins/nicira/api_client/request_eventlet.py rename to neutron/plugins/nicira/api_client/request_eventlet.py index a7ffcbb9e3..0902feb68c 100644 --- a/quantum/plugins/nicira/api_client/request_eventlet.py +++ b/neutron/plugins/nicira/api_client/request_eventlet.py @@ -24,19 +24,19 @@ import json import logging import urllib -from quantum.plugins.nicira.api_client import request +from neutron.plugins.nicira.api_client import request eventlet.monkey_patch() logging.basicConfig(level=logging.INFO) LOG = logging.getLogger(__name__) -USER_AGENT = "NVP Quantum eventlet client/2.0" +USER_AGENT = "NVP Neutron eventlet client/2.0" class NvpApiRequestEventlet(request.NvpApiRequest): '''Eventlet-based ApiRequest class. This class will form the basis for eventlet-based ApiRequest classes - (e.g. those used by the Quantum NVP Plugin). + (e.g. those used by the Neutron NVP Plugin). ''' # Maximum number of green threads present in the system at one time. diff --git a/quantum/plugins/nicira/check_nvp_config.py b/neutron/plugins/nicira/check_nvp_config.py similarity index 94% rename from quantum/plugins/nicira/check_nvp_config.py rename to neutron/plugins/nicira/check_nvp_config.py index 492cd1702d..ef8d2609bb 100644 --- a/quantum/plugins/nicira/check_nvp_config.py +++ b/neutron/plugins/nicira/check_nvp_config.py @@ -22,10 +22,10 @@ import sys from oslo.config import cfg -from quantum.common import config -from quantum.plugins.nicira.common import config as nvp_cfg # noqa -from quantum.plugins.nicira import nvplib -from quantum.plugins.nicira import QuantumPlugin +from neutron.common import config +from neutron.plugins.nicira.common import config as nvp_cfg # noqa +from neutron.plugins.nicira import NeutronPlugin +from neutron.plugins.nicira import nvplib config.setup_logging(cfg.CONF) @@ -72,7 +72,7 @@ def main(argv): print "\tretries: %s" % cfg.CONF.retries print "\tredirects: %s" % cfg.CONF.redirects print "\thttp_timeout: %s" % cfg.CONF.http_timeout - cluster = QuantumPlugin.create_nvp_cluster( + cluster = NeutronPlugin.create_nvp_cluster( cfg.CONF, cfg.CONF.NVP.concurrent_connections, cfg.CONF.NVP.nvp_gen_timeout) diff --git a/quantum/plugins/nicira/common/__init__.py b/neutron/plugins/nicira/common/__init__.py similarity index 100% rename from quantum/plugins/nicira/common/__init__.py rename to neutron/plugins/nicira/common/__init__.py diff --git a/quantum/plugins/nicira/common/config.py b/neutron/plugins/nicira/common/config.py similarity index 95% rename from quantum/plugins/nicira/common/config.py rename to neutron/plugins/nicira/common/config.py index 8a7e40ae83..17017f74a6 100644 --- a/quantum/plugins/nicira/common/config.py +++ b/neutron/plugins/nicira/common/config.py @@ -16,7 +16,7 @@ from oslo.config import cfg -from quantum import scheduler +from neutron import scheduler nvp_opts = [ cfg.IntOpt('max_lp_per_bridged_ls', default=64, @@ -33,14 +33,14 @@ nvp_opts = [ cfg.StrOpt('metadata_mode', default='access_network', help=_("If set to access_network this enables a dedicated " "connection to the metadata proxy for metadata server " - "access via Quantum router. If set to dhcp_host_route " + "access via Neutron router. If set to dhcp_host_route " "this enables host route injection via the dhcp agent. " "This option is only useful if running on a host that " "does not support namespaces otherwise access_network " "should be used.")), cfg.BoolOpt('enable_metadata_access_network', default=True, help=_("Enables dedicated connection to the metadata proxy " - "for metadata server access via Quantum router")), + "for metadata server access via Neutron router")), cfg.StrOpt('default_transport_type', default='stt', help=_("The default network tranport type to use (stt, gre, " "bridge, ipsec_gre, or ipsec_stt)")), @@ -74,8 +74,8 @@ cluster_opts = [ cfg.StrOpt('default_tz_uuid', help=_("This is uuid of the default NVP Transport zone that " "will be used for creating tunneled isolated " - "\"Quantum\" networks. It needs to be created in NVP " - "before starting Quantum with the nvp plugin.")), + "\"Neutron\" networks. It needs to be created in NVP " + "before starting Neutron with the nvp plugin.")), cfg.StrOpt('nvp_cluster_uuid', help=_("Optional paramter identifying the UUID of the cluster " "in NVP. This can be retrieved from NVP management " diff --git a/quantum/plugins/nicira/common/exceptions.py b/neutron/plugins/nicira/common/exceptions.py similarity index 95% rename from quantum/plugins/nicira/common/exceptions.py rename to neutron/plugins/nicira/common/exceptions.py index 9d62aa336f..62acbf8386 100644 --- a/quantum/plugins/nicira/common/exceptions.py +++ b/neutron/plugins/nicira/common/exceptions.py @@ -17,10 +17,10 @@ """NVP Plugin exceptions""" -from quantum.common import exceptions as q_exc +from neutron.common import exceptions as q_exc -class NvpPluginException(q_exc.QuantumException): +class NvpPluginException(q_exc.NeutronException): message = _("An unexpected error occurred in the NVP Plugin:%(err_msg)s") diff --git a/quantum/plugins/nicira/common/metadata_access.py b/neutron/plugins/nicira/common/metadata_access.py similarity index 93% rename from quantum/plugins/nicira/common/metadata_access.py rename to neutron/plugins/nicira/common/metadata_access.py index 2204344be2..e54434bdf6 100644 --- a/quantum/plugins/nicira/common/metadata_access.py +++ b/neutron/plugins/nicira/common/metadata_access.py @@ -20,15 +20,15 @@ import netaddr from oslo.config import cfg -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.v2 import attributes -from quantum.common import constants -from quantum.common import exceptions as q_exc -from quantum.db import l3_db -from quantum.db import models_v2 -from quantum.openstack.common import log as logging -from quantum.plugins.nicira.common import exceptions as nvp_exc -from quantum.plugins.nicira import NvpApiClient +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.v2 import attributes +from neutron.common import constants +from neutron.common import exceptions as q_exc +from neutron.db import l3_db +from neutron.db import models_v2 +from neutron.openstack.common import log as logging +from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira import NvpApiClient LOG = logging.getLogger(__name__) @@ -50,7 +50,7 @@ class NvpMetadataAccess(object): return port def _create_metadata_access_network(self, context, router_id): - # This will still ensure atomicity on Quantum DB + # This will still ensure atomicity on Neutron DB with context.session.begin(subtransactions=True): # Add network # Network name is likely to be truncated on NVP @@ -87,7 +87,7 @@ class NvpMetadataAccess(object): 'network.create.end') def _destroy_metadata_access_network(self, context, router_id, ports): - # This will still ensure atomicity on Quantum DB + # This will still ensure atomicity on Neutron DB with context.session.begin(subtransactions=True): if ports: meta_port = self._find_metadata_port(context, ports) @@ -143,7 +143,7 @@ class NvpMetadataAccess(object): "created or destroyed"), router_id) # TODO(salvatore-orlando): A better exception handling in the # NVP plugin would allow us to improve error handling here - except (q_exc.QuantumException, nvp_exc.NvpPluginException, + except (q_exc.NeutronException, nvp_exc.NvpPluginException, NvpApiClient.NvpApiException): # Any exception here should be regarded as non-fatal LOG.exception(_("An error occurred while operating on the " diff --git a/quantum/plugins/nicira/common/securitygroups.py b/neutron/plugins/nicira/common/securitygroups.py similarity index 95% rename from quantum/plugins/nicira/common/securitygroups.py rename to neutron/plugins/nicira/common/securitygroups.py index 6e0cbc6609..2e43c41797 100644 --- a/quantum/plugins/nicira/common/securitygroups.py +++ b/neutron/plugins/nicira/common/securitygroups.py @@ -17,7 +17,7 @@ # # @author: Aaron Rosen, Nicira Networks, Inc. -from quantum.extensions import securitygroup as ext_sg +from neutron.extensions import securitygroup as ext_sg # Protocol number look up for supported protocols protocol_num_look_up = {'tcp': 6, 'icmp': 1, 'udp': 17} @@ -26,7 +26,7 @@ protocol_num_look_up = {'tcp': 6, 'icmp': 1, 'udp': 17} class NVPSecurityGroups(object): def _convert_to_nvp_rule(self, rule, with_id=False): - """Converts Quantum API security group rule to NVP API.""" + """Converts Neutron API security group rule to NVP API.""" nvp_rule = {} params = ['remote_ip_prefix', 'protocol', 'remote_group_id', 'port_range_min', @@ -55,7 +55,7 @@ class NVPSecurityGroups(object): return nvp_rule def _convert_to_nvp_rules(self, rules, with_id=False): - """Converts a list of Quantum API security group rules to NVP API.""" + """Converts a list of Neutron API security group rules to NVP API.""" nvp_rules = {'logical_port_ingress_rules': [], 'logical_port_egress_rules': []} for direction in ['logical_port_ingress_rules', @@ -67,7 +67,7 @@ class NVPSecurityGroups(object): def _get_security_group_rules_nvp_format(self, context, security_group_id, with_id=False): - """Query quantum db for security group rules.""" + """Query neutron db for security group rules.""" fields = ['remote_ip_prefix', 'remote_group_id', 'protocol', 'port_range_min', 'port_range_max', 'protocol', 'ethertype'] if with_id: diff --git a/quantum/plugins/openvswitch/__init__.py b/neutron/plugins/nicira/dbexts/__init__.py similarity index 100% rename from quantum/plugins/openvswitch/__init__.py rename to neutron/plugins/nicira/dbexts/__init__.py diff --git a/quantum/plugins/nicira/dbexts/maclearning.py b/neutron/plugins/nicira/dbexts/maclearning.py similarity index 94% rename from quantum/plugins/nicira/dbexts/maclearning.py rename to neutron/plugins/nicira/dbexts/maclearning.py index 44af13e1ba..909fc56dd9 100644 --- a/quantum/plugins/nicira/dbexts/maclearning.py +++ b/neutron/plugins/nicira/dbexts/maclearning.py @@ -18,9 +18,9 @@ import sqlalchemy as sa from sqlalchemy.orm import exc -from quantum.db import model_base -from quantum.openstack.common import log as logging -from quantum.plugins.nicira.extensions import maclearning as mac +from neutron.db import model_base +from neutron.openstack.common import log as logging +from neutron.plugins.nicira.extensions import maclearning as mac LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/nicira/dbexts/nicira_db.py b/neutron/plugins/nicira/dbexts/nicira_db.py similarity index 83% rename from quantum/plugins/nicira/dbexts/nicira_db.py rename to neutron/plugins/nicira/dbexts/nicira_db.py index 04821f8606..86b546231d 100644 --- a/quantum/plugins/nicira/dbexts/nicira_db.py +++ b/neutron/plugins/nicira/dbexts/nicira_db.py @@ -17,10 +17,10 @@ from sqlalchemy.orm import exc -import quantum.db.api as db -from quantum.openstack.common import log as logging -from quantum.plugins.nicira.dbexts import nicira_models -from quantum.plugins.nicira.dbexts import nicira_networkgw_db +import neutron.db.api as db +from neutron.openstack.common import log as logging +from neutron.plugins.nicira.dbexts import nicira_models +from neutron.plugins.nicira.dbexts import nicira_networkgw_db LOG = logging.getLogger(__name__) @@ -55,17 +55,17 @@ def add_network_binding(session, network_id, binding_type, phy_uuid, vlan_id): return binding -def add_quantum_nvp_port_mapping(session, quantum_id, nvp_id): +def add_neutron_nvp_port_mapping(session, neutron_id, nvp_id): with session.begin(subtransactions=True): - mapping = nicira_models.QuantumNvpPortMapping(quantum_id, nvp_id) + mapping = nicira_models.NeutronNvpPortMapping(neutron_id, nvp_id) session.add(mapping) return mapping -def get_nvp_port_id(session, quantum_id): +def get_nvp_port_id(session, neutron_id): try: - mapping = (session.query(nicira_models.QuantumNvpPortMapping). - filter_by(quantum_id=quantum_id). + mapping = (session.query(nicira_models.NeutronNvpPortMapping). + filter_by(quantum_id=neutron_id). one()) return mapping['nvp_id'] except exc.NoResultFound: diff --git a/quantum/plugins/nicira/dbexts/nicira_models.py b/neutron/plugins/nicira/dbexts/nicira_models.py similarity index 91% rename from quantum/plugins/nicira/dbexts/nicira_models.py rename to neutron/plugins/nicira/dbexts/nicira_models.py index 1c879c9f5e..86bf5213b9 100644 --- a/quantum/plugins/nicira/dbexts/nicira_models.py +++ b/neutron/plugins/nicira/dbexts/nicira_models.py @@ -18,13 +18,13 @@ from sqlalchemy import Column, Enum, ForeignKey, Integer, String -from quantum.db.models_v2 import model_base +from neutron.db.models_v2 import model_base class NvpNetworkBinding(model_base.BASEV2): """Represents a binding of a virtual network with a transport zone. - This model class associates a Quantum network with a transport zone; + This model class associates a Neutron network with a transport zone; optionally a vlan ID might be used if the binding type is 'bridge' """ __tablename__ = 'nvp_network_bindings' @@ -52,8 +52,8 @@ class NvpNetworkBinding(model_base.BASEV2): self.vlan_id) -class QuantumNvpPortMapping(model_base.BASEV2): - """Represents the mapping between quantum and nvp port uuids.""" +class NeutronNvpPortMapping(model_base.BASEV2): + """Represents the mapping between neutron and nvp port uuids.""" __tablename__ = 'quantum_nvp_port_mapping' quantum_id = Column(String(36), diff --git a/quantum/plugins/nicira/dbexts/nicira_networkgw_db.py b/neutron/plugins/nicira/dbexts/nicira_networkgw_db.py similarity index 97% rename from quantum/plugins/nicira/dbexts/nicira_networkgw_db.py rename to neutron/plugins/nicira/dbexts/nicira_networkgw_db.py index 1cca562a1e..6829df1629 100644 --- a/quantum/plugins/nicira/dbexts/nicira_networkgw_db.py +++ b/neutron/plugins/nicira/dbexts/nicira_networkgw_db.py @@ -23,14 +23,14 @@ from sqlalchemy import orm from sqlalchemy.orm import exc as sa_orm_exc from webob import exc as web_exc -from quantum.api.v2 import attributes -from quantum.api.v2 import base -from quantum.common import exceptions -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.openstack.common import log as logging -from quantum.openstack.common import uuidutils -from quantum.plugins.nicira.extensions import nvp_networkgw +from neutron.api.v2 import attributes +from neutron.api.v2 import base +from neutron.common import exceptions +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.openstack.common import log as logging +from neutron.openstack.common import uuidutils +from neutron.plugins.nicira.extensions import nvp_networkgw LOG = logging.getLogger(__name__) @@ -45,7 +45,7 @@ ALLOWED_CONNECTION_ATTRIBUTES = set((NETWORK_ID, class GatewayInUse(exceptions.InUse): message = _("Network Gateway '%(gateway_id)s' still has active mappings " - "with one or more quantum networks.") + "with one or more neutron networks.") class NetworkGatewayPortInUse(exceptions.InUse): @@ -58,7 +58,7 @@ class GatewayConnectionInUse(exceptions.InUse): "network gateway '%(gateway_id)s'.") -class MultipleGatewayConnections(exceptions.QuantumException): +class MultipleGatewayConnections(exceptions.NeutronException): message = _("Multiple network connections found on '%(gateway_id)s' " "with provided criteria.") diff --git a/quantum/plugins/nicira/dbexts/nicira_qos_db.py b/neutron/plugins/nicira/dbexts/nicira_qos_db.py similarity index 97% rename from quantum/plugins/nicira/dbexts/nicira_qos_db.py rename to neutron/plugins/nicira/dbexts/nicira_qos_db.py index d1a6b33dfd..757343d4b5 100644 --- a/quantum/plugins/nicira/dbexts/nicira_qos_db.py +++ b/neutron/plugins/nicira/dbexts/nicira_qos_db.py @@ -19,12 +19,12 @@ import sqlalchemy as sa from sqlalchemy.orm import exc -from quantum.api.v2 import attributes as attr -from quantum.db import model_base -from quantum.db import models_v2 -from quantum.openstack.common import uuidutils -from quantum.plugins.nicira.extensions import nvp_qos as ext_qos -from quantum.plugins.nicira import nvplib +from neutron.api.v2 import attributes as attr +from neutron.db import model_base +from neutron.db import models_v2 +from neutron.openstack.common import uuidutils +from neutron.plugins.nicira.extensions import nvp_qos as ext_qos +from neutron.plugins.nicira import nvplib class QoSQueue(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant): diff --git a/quantum/plugins/nicira/extensions/__init__.py b/neutron/plugins/nicira/extensions/__init__.py similarity index 100% rename from quantum/plugins/nicira/extensions/__init__.py rename to neutron/plugins/nicira/extensions/__init__.py diff --git a/quantum/plugins/nicira/extensions/maclearning.py b/neutron/plugins/nicira/extensions/maclearning.py similarity index 97% rename from quantum/plugins/nicira/extensions/maclearning.py rename to neutron/plugins/nicira/extensions/maclearning.py index 7fa1034083..ebd047da39 100644 --- a/quantum/plugins/nicira/extensions/maclearning.py +++ b/neutron/plugins/nicira/extensions/maclearning.py @@ -16,7 +16,7 @@ # -from quantum.api.v2 import attributes +from neutron.api.v2 import attributes MAC_LEARNING = 'mac_learning_enabled' diff --git a/quantum/plugins/nicira/extensions/nvp_networkgw.py b/neutron/plugins/nicira/extensions/nvp_networkgw.py similarity index 91% rename from quantum/plugins/nicira/extensions/nvp_networkgw.py rename to neutron/plugins/nicira/extensions/nvp_networkgw.py index 97c88f60f8..cd9e45fd04 100644 --- a/quantum/plugins/nicira/extensions/nvp_networkgw.py +++ b/neutron/plugins/nicira/extensions/nvp_networkgw.py @@ -20,11 +20,11 @@ from abc import abstractmethod from oslo.config import cfg -from quantum.api import extensions -from quantum.api.v2 import attributes -from quantum.api.v2 import base -from quantum import manager -from quantum import quota +from neutron.api import extensions +from neutron.api.v2 import attributes +from neutron.api.v2 import base +from neutron import manager +from neutron import quota RESOURCE_NAME = "network_gateway" @@ -35,7 +35,7 @@ DEVICE_ID_ATTR = 'id' IFACE_NAME_ATTR = 'interface_name' # Attribute Map for Network Gateway Resource -# TODO(salvatore-orlando): add admin state as other quantum resources +# TODO(salvatore-orlando): add admin state as other neutron resources RESOURCE_ATTRIBUTE_MAP = { COLLECTION_NAME: { 'id': {'allow_post': False, 'allow_put': False, @@ -101,18 +101,18 @@ attributes.validators['type:device_list'] = _validate_device_list class Nvp_networkgw(object): """API extension for Layer-2 Gateway support. - The Layer-2 gateway feature allows for connecting quantum networks + The Layer-2 gateway feature allows for connecting neutron networks with external networks at the layer-2 level. No assumption is made on the location of the external network, which might not even be directly reachable from the hosts where the VMs are deployed. This is achieved by instantiating 'network gateways', and then connecting - Quantum network to them. + Neutron network to them. """ @classmethod def get_name(cls): - return "Quantum-NVP Network Gateway" + return "Neutron-NVP Network Gateway" @classmethod def get_alias(cls): @@ -120,11 +120,11 @@ class Nvp_networkgw(object): @classmethod def get_description(cls): - return "Connects Quantum networks with external networks at layer 2" + return "Connects Neutron networks with external networks at layer 2" @classmethod def get_namespace(cls): - return "http://docs.openstack.org/ext/quantum/network-gateway/api/v1.0" + return "http://docs.openstack.org/ext/neutron/network-gateway/api/v1.0" @classmethod def get_updated(cls): @@ -133,7 +133,7 @@ class Nvp_networkgw(object): @classmethod def get_resources(cls): """Returns Ext Resources.""" - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() params = RESOURCE_ATTRIBUTE_MAP.get(COLLECTION_NAME, dict()) member_actions = {'connect_network': 'PUT', diff --git a/quantum/plugins/nicira/extensions/nvp_qos.py b/neutron/plugins/nicira/extensions/nvp_qos.py similarity index 96% rename from quantum/plugins/nicira/extensions/nvp_qos.py rename to neutron/plugins/nicira/extensions/nvp_qos.py index 41c1c916af..a9c2565147 100644 --- a/quantum/plugins/nicira/extensions/nvp_qos.py +++ b/neutron/plugins/nicira/extensions/nvp_qos.py @@ -20,11 +20,11 @@ from abc import abstractmethod -from quantum.api import extensions -from quantum.api.v2 import attributes as attr -from quantum.api.v2 import base -from quantum.common import exceptions as qexception -from quantum import manager +from neutron.api import extensions +from neutron.api.v2 import attributes as attr +from neutron.api.v2 import base +from neutron.common import exceptions as qexception +from neutron import manager # For policy.json/Auth @@ -166,7 +166,7 @@ class Nvp_qos(object): def get_resources(cls): """Returns Ext Resources.""" exts = [] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() resource_name = 'qos_queue' collection_name = resource_name.replace('_', '-') + "s" params = RESOURCE_ATTRIBUTE_MAP.get(resource_name + "s", dict()) diff --git a/quantum/plugins/nicira/nvp_cluster.py b/neutron/plugins/nicira/nvp_cluster.py similarity index 98% rename from quantum/plugins/nicira/nvp_cluster.py rename to neutron/plugins/nicira/nvp_cluster.py index 947385191a..a862f2ae68 100644 --- a/quantum/plugins/nicira/nvp_cluster.py +++ b/neutron/plugins/nicira/nvp_cluster.py @@ -20,8 +20,8 @@ from oslo.config import cfg -from quantum.openstack.common import log as logging -from quantum.plugins.nicira.common import exceptions +from neutron.openstack.common import log as logging +from neutron.plugins.nicira.common import exceptions LOG = logging.getLogger(__name__) DEFAULT_PORT = 443 diff --git a/quantum/plugins/nicira/nvplib.py b/neutron/plugins/nicira/nvplib.py similarity index 93% rename from quantum/plugins/nicira/nvplib.py rename to neutron/plugins/nicira/nvplib.py index e4ff59a238..6f3780383f 100644 --- a/quantum/plugins/nicira/nvplib.py +++ b/neutron/plugins/nicira/nvplib.py @@ -27,13 +27,13 @@ import json from oslo.config import cfg #FIXME(danwent): I'd like this file to get to the point where it has -# no quantum-specific logic in it -from quantum.common import constants -from quantum.common import exceptions as exception -from quantum.openstack.common import log -from quantum.plugins.nicira.common import ( +# no neutron-specific logic in it +from neutron.common import constants +from neutron.common import exceptions as exception +from neutron.openstack.common import log +from neutron.plugins.nicira.common import ( exceptions as nvp_exc) -from quantum.plugins.nicira import NvpApiClient +from neutron.plugins.nicira import NvpApiClient LOG = log.getLogger(__name__) @@ -48,12 +48,12 @@ URI_PREFIX = "/ws.v1" LSWITCH_RESOURCE = "lswitch" LSWITCHPORT_RESOURCE = "lport/%s" % LSWITCH_RESOURCE LROUTER_RESOURCE = "lrouter" -# Current quantum version +# Current neutron version LROUTERPORT_RESOURCE = "lport/%s" % LROUTER_RESOURCE LROUTERNAT_RESOURCE = "nat/lrouter" LQUEUE_RESOURCE = "lqueue" GWSERVICE_RESOURCE = "gateway-service" -QUANTUM_VERSION = "2013.1" +NEUTRON_VERSION = "2013.1" # Other constants for NVP resource MAX_DISPLAY_NAME_LEN = 40 # Constants for NAT rules @@ -175,8 +175,8 @@ def get_all_query_pages(path, c): # ------------------------------------------------------------------- # Network functions # ------------------------------------------------------------------- -def get_lswitches(cluster, quantum_net_id): - lswitch_uri_path = _build_uri_path(LSWITCH_RESOURCE, quantum_net_id, +def get_lswitches(cluster, neutron_net_id): + lswitch_uri_path = _build_uri_path(LSWITCH_RESOURCE, neutron_net_id, relations="LogicalSwitchStatus") results = [] try: @@ -190,21 +190,21 @@ def get_lswitches(cluster, quantum_net_id): LSWITCH_RESOURCE, fields="uuid,display_name,tags,lport_count", relations="LogicalSwitchStatus", - filters={'tag': quantum_net_id, + filters={'tag': neutron_net_id, 'tag_scope': 'quantum_net_id'}) extra_switches = get_all_query_pages(extra_lswitch_uri_path, cluster) results.extend(extra_switches) return results except exception.NotFound: - raise exception.NetworkNotFound(net_id=quantum_net_id) + raise exception.NetworkNotFound(net_id=neutron_net_id) def create_lswitch(cluster, tenant_id, display_name, transport_type=None, transport_zone_uuid=None, vlan_id=None, - quantum_net_id=None, + neutron_net_id=None, shared=None, **kwargs): nvp_binding_type = transport_type @@ -218,12 +218,12 @@ def create_lswitch(cluster, tenant_id, display_name, lswitch_obj = {"display_name": _check_and_truncate_name(display_name), "transport_zones": [transport_zone_config], "tags": [{"tag": tenant_id, "scope": "os_tid"}, - {"tag": QUANTUM_VERSION, "scope": "quantum"}]} + {"tag": NEUTRON_VERSION, "scope": "quantum"}]} if nvp_binding_type == 'bridge' and vlan_id: transport_zone_config["binding_config"] = {"vlan_translation": [{"transport": vlan_id}]} - if quantum_net_id: - lswitch_obj["tags"].append({"tag": quantum_net_id, + if neutron_net_id: + lswitch_obj["tags"].append({"tag": neutron_net_id, "scope": "quantum_net_id"}) if shared: lswitch_obj["tags"].append({"tag": "true", @@ -242,7 +242,7 @@ def update_lswitch(cluster, lswitch_id, display_name, uri = _build_uri_path(LSWITCH_RESOURCE, resource_id=lswitch_id) lswitch_obj = {"display_name": _check_and_truncate_name(display_name), "tags": [{"tag": tenant_id, "scope": "os_tid"}, - {"tag": QUANTUM_VERSION, "scope": "quantum"}]} + {"tag": NEUTRON_VERSION, "scope": "quantum"}]} if "tags" in kwargs: lswitch_obj["tags"].extend(kwargs["tags"]) try: @@ -266,10 +266,10 @@ def create_l2_gw_service(cluster, tenant_id, display_name, devices): with the NVP controller """ tags = [{"tag": tenant_id, "scope": "os_tid"}, - {"tag": QUANTUM_VERSION, "scope": "quantum"}] + {"tag": NEUTRON_VERSION, "scope": "quantum"}] # NOTE(salvatore-orlando): This is a little confusing, but device_id in # NVP is actually the identifier a physical interface on the gateway - # device, which in the Quantum API is referred as interface_name + # device, which in the Neutron API is referred as interface_name gateways = [{"transport_node_uuid": device['id'], "device_id": device['interface_name'], "type": "L2Gateway"} for device in devices] @@ -297,7 +297,7 @@ def create_lrouter(cluster, tenant_id, display_name, nexthop): """ display_name = _check_and_truncate_name(display_name) tags = [{"tag": tenant_id, "scope": "os_tid"}, - {"tag": QUANTUM_VERSION, "scope": "quantum"}] + {"tag": NEUTRON_VERSION, "scope": "quantum"}] lrouter_obj = { "display_name": display_name, "tags": tags, @@ -442,33 +442,33 @@ def delete_port(cluster, switch, port): raise exception.PortNotFound(net_id=switch, port_id=port) except NvpApiClient.NvpApiException: - raise exception.QuantumException() + raise exception.NeutronException() -def get_port_by_quantum_tag(cluster, lswitch_uuid, quantum_port_id): - """Get port by quantum tag. +def get_port_by_neutron_tag(cluster, lswitch_uuid, neutron_port_id): + """Get port by neutron tag. Returns the NVP UUID of the logical port with tag q_port_id equal to - quantum_port_id or None if the port is not Found. + neutron_port_id or None if the port is not Found. """ uri = _build_uri_path(LSWITCHPORT_RESOURCE, parent_resource_id=lswitch_uuid, fields='uuid', - filters={'tag': quantum_port_id, + filters={'tag': neutron_port_id, 'tag_scope': 'q_port_id'}) - LOG.debug(_("Looking for port with q_port_id tag '%(quantum_port_id)s' " + LOG.debug(_("Looking for port with q_port_id tag '%(neutron_port_id)s' " "on: '%(lswitch_uuid)s'") % - {'quantum_port_id': quantum_port_id, + {'neutron_port_id': neutron_port_id, 'lswitch_uuid': lswitch_uuid}) res = do_request(HTTP_GET, uri, cluster=cluster) num_results = len(res["results"]) if num_results >= 1: if num_results > 1: LOG.warn(_("Found '%(num_ports)d' ports with " - "q_port_id tag: '%(quantum_port_id)s'. " + "q_port_id tag: '%(neutron_port_id)s'. " "Only 1 was expected.") % {'num_ports': num_results, - 'quantum_port_id': quantum_port_id}) + 'neutron_port_id': neutron_port_id}) return res["results"][0] @@ -507,7 +507,7 @@ def _configure_extensions(lport_obj, mac_address, fixed_ips, lport_obj["type"] = "LogicalSwitchPortConfig" -def update_port(cluster, lswitch_uuid, lport_uuid, quantum_port_id, tenant_id, +def update_port(cluster, lswitch_uuid, lport_uuid, neutron_port_id, tenant_id, display_name, device_id, admin_status_enabled, mac_address=None, fixed_ips=None, port_security_enabled=None, security_profiles=None, queue_id=None, @@ -518,9 +518,9 @@ def update_port(cluster, lswitch_uuid, lport_uuid, quantum_port_id, tenant_id, admin_status_enabled=admin_status_enabled, display_name=_check_and_truncate_name(display_name), tags=[dict(scope='os_tid', tag=tenant_id), - dict(scope='q_port_id', tag=quantum_port_id), + dict(scope='q_port_id', tag=neutron_port_id), dict(scope='vm_id', tag=hashed_device_id), - dict(scope='quantum', tag=QUANTUM_VERSION)]) + dict(scope='quantum', tag=NEUTRON_VERSION)]) _configure_extensions(lport_obj, mac_address, fixed_ips, port_security_enabled, security_profiles, @@ -539,7 +539,7 @@ def update_port(cluster, lswitch_uuid, lport_uuid, quantum_port_id, tenant_id, raise exception.PortNotFound(port_id=lport_uuid, net_id=lswitch_uuid) -def create_lport(cluster, lswitch_uuid, tenant_id, quantum_port_id, +def create_lport(cluster, lswitch_uuid, tenant_id, neutron_port_id, display_name, device_id, admin_status_enabled, mac_address=None, fixed_ips=None, port_security_enabled=None, security_profiles=None, queue_id=None, @@ -552,9 +552,9 @@ def create_lport(cluster, lswitch_uuid, tenant_id, quantum_port_id, admin_status_enabled=admin_status_enabled, display_name=display_name, tags=[dict(scope='os_tid', tag=tenant_id), - dict(scope='q_port_id', tag=quantum_port_id), + dict(scope='q_port_id', tag=neutron_port_id), dict(scope='vm_id', tag=hashed_device_id), - dict(scope='quantum', tag=QUANTUM_VERSION)], + dict(scope='quantum', tag=NEUTRON_VERSION)], ) _configure_extensions(lport_obj, mac_address, fixed_ips, @@ -571,12 +571,12 @@ def create_lport(cluster, lswitch_uuid, tenant_id, quantum_port_id, return result -def create_router_lport(cluster, lrouter_uuid, tenant_id, quantum_port_id, +def create_router_lport(cluster, lrouter_uuid, tenant_id, neutron_port_id, display_name, admin_status_enabled, ip_addresses): """Creates a logical port on the assigned logical router.""" tags = [dict(scope='os_tid', tag=tenant_id), - dict(scope='q_port_id', tag=quantum_port_id), - dict(scope='quantum', tag=QUANTUM_VERSION)] + dict(scope='q_port_id', tag=neutron_port_id), + dict(scope='quantum', tag=NEUTRON_VERSION)] lport_obj = dict( admin_status_enabled=admin_status_enabled, @@ -598,15 +598,15 @@ def create_router_lport(cluster, lrouter_uuid, tenant_id, quantum_port_id, def update_router_lport(cluster, lrouter_uuid, lrouter_port_uuid, - tenant_id, quantum_port_id, display_name, + tenant_id, neutron_port_id, display_name, admin_status_enabled, ip_addresses): """Updates a logical port on the assigned logical router.""" lport_obj = dict( admin_status_enabled=admin_status_enabled, display_name=display_name, tags=[dict(scope='os_tid', tag=tenant_id), - dict(scope='q_port_id', tag=quantum_port_id), - dict(scope='quantum', tag=QUANTUM_VERSION)], + dict(scope='q_port_id', tag=neutron_port_id), + dict(scope='quantum', tag=NEUTRON_VERSION)], ip_addresses=ip_addresses, type="LogicalRouterPortConfig" ) @@ -652,7 +652,7 @@ def find_router_gw_port(context, cluster, router_id): """Retrieves the external gateway port for a NVP logical router.""" # Find the uuid of nvp ext gw logical router port - # TODO(salvatore-orlando): Consider storing it in Quantum DB + # TODO(salvatore-orlando): Consider storing it in Neutron DB results = query_lrouter_lports( cluster, router_id, relations="LogicalPortAttachment") @@ -795,7 +795,7 @@ def create_security_profile(cluster, tenant_id, security_profile): [{'ethertype': 'IPv4'}, {'ethertype': 'IPv6'}]} tags = [dict(scope='os_tid', tag=tenant_id), - dict(scope='quantum', tag=QUANTUM_VERSION)] + dict(scope='quantum', tag=NEUTRON_VERSION)] display_name = _check_and_truncate_name(security_profile.get('name')) body = mk_body( tags=tags, display_name=display_name, @@ -840,8 +840,8 @@ def update_security_group_rules(cluster, spid, rules): rsp = do_request(HTTP_PUT, path, body, cluster=cluster) except exception.NotFound as e: LOG.error(format_exception("Unknown", e, locals())) - #FIXME(salvatore-orlando): This should not raise QuantumException - raise exception.QuantumException() + #FIXME(salvatore-orlando): This should not raise NeutronException + raise exception.NeutronException() LOG.debug(_("Updated Security Profile: %s"), rsp) return rsp @@ -852,9 +852,9 @@ def delete_security_profile(cluster, spid): try: do_request(HTTP_DELETE, path, cluster=cluster) except exception.NotFound as e: - # FIXME(salv-orlando): should not raise QuantumException + # FIXME(salv-orlando): should not raise NeutronException LOG.error(format_exception("Unknown", e, locals())) - raise exception.QuantumException() + raise exception.NeutronException() def _create_nat_match_obj(**kwargs): @@ -1043,14 +1043,14 @@ NVPLIB_FUNC_DICT = { # ----------------------------------------------------------------------------- def create_lqueue(cluster, lqueue): uri = _build_uri_path(LQUEUE_RESOURCE) - lqueue['tags'] = [{'tag': QUANTUM_VERSION, 'scope': 'quantum'}] + lqueue['tags'] = [{'tag': NEUTRON_VERSION, 'scope': 'quantum'}] try: return do_request(HTTP_POST, uri, json.dumps(lqueue), cluster=cluster)['uuid'] except NvpApiClient.NvpApiException: # FIXME(salv-orlando): This should not raise QauntumException LOG.exception(_("Failed to create logical queue")) - raise exception.QuantumException() + raise exception.NeutronException() def delete_lqueue(cluster, id): @@ -1061,7 +1061,7 @@ def delete_lqueue(cluster, id): except Exception: # FIXME(salv-orlando): This should not raise QauntumException LOG.exception(_("Failed to delete logical queue")) - raise exception.QuantumException() + raise exception.NeutronException() # ----------------------------------------------------------------------------- diff --git a/quantum/plugins/openvswitch/README b/neutron/plugins/openvswitch/README similarity index 72% rename from quantum/plugins/openvswitch/README rename to neutron/plugins/openvswitch/README index 82efd05e94..b8991ad0a2 100644 --- a/quantum/plugins/openvswitch/README +++ b/neutron/plugins/openvswitch/README @@ -1,4 +1,4 @@ -The Open vSwitch (OVS) Quantum plugin is a simple plugin to manage OVS +The Open vSwitch (OVS) Neutron plugin is a simple plugin to manage OVS features using a local agent running on each hypervisor. For details on how to configure and use the plugin, see: diff --git a/quantum/plugins/openvswitch/agent/__init__.py b/neutron/plugins/openvswitch/__init__.py similarity index 100% rename from quantum/plugins/openvswitch/agent/__init__.py rename to neutron/plugins/openvswitch/__init__.py diff --git a/quantum/plugins/ryu/__init__.py b/neutron/plugins/openvswitch/agent/__init__.py similarity index 100% rename from quantum/plugins/ryu/__init__.py rename to neutron/plugins/openvswitch/agent/__init__.py diff --git a/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py similarity index 97% rename from quantum/plugins/openvswitch/agent/ovs_quantum_agent.py rename to neutron/plugins/openvswitch/agent/ovs_neutron_agent.py index 377b444088..2e54dbcb7b 100644 --- a/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py @@ -29,22 +29,23 @@ import time import eventlet from oslo.config import cfg -from quantum.agent.linux import ip_lib -from quantum.agent.linux import ovs_lib -from quantum.agent import rpc as agent_rpc -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.common import config as logging_config -from quantum.common import constants as q_const -from quantum.common import topics -from quantum.common import utils as q_utils -from quantum import context -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall -from quantum.openstack.common.rpc import common as rpc_common -from quantum.openstack.common.rpc import dispatcher -from quantum.plugins.openvswitch.common import config # noqa -from quantum.plugins.openvswitch.common import constants +from neutron.agent.linux import ip_lib +from neutron.agent.linux import ovs_lib +from neutron.agent import rpc as agent_rpc +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.common import config as logging_config +from neutron.common import constants as q_const +from neutron.common import legacy +from neutron.common import topics +from neutron.common import utils as q_utils +from neutron import context +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall +from neutron.openstack.common.rpc import common as rpc_common +from neutron.openstack.common.rpc import dispatcher +from neutron.plugins.openvswitch.common import config # noqa +from neutron.plugins.openvswitch.common import constants LOG = logging.getLogger(__name__) @@ -73,7 +74,7 @@ class LocalVLANMapping: class Port(object): - """Represents a quantum port. + """Represents a neutron port. Class stores port data in a ORM-free way, so attributres are still available even if a row has been deleted. @@ -115,7 +116,7 @@ class OVSSecurityGroupAgent(sg_rpc.SecurityGroupAgentRpcMixin): self.init_firewall() -class OVSQuantumAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin): +class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin): '''Implements OVS-based tunneling, VLANs and flat networks. Two local bridges are created: an integration bridge (defaults to @@ -182,7 +183,7 @@ class OVSQuantumAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin): if self.enable_tunneling: self.setup_tunnel_br(tun_br) self.agent_state = { - 'binary': 'quantum-openvswitch-agent', + 'binary': 'neutron-openvswitch-agent', 'host': cfg.CONF.host, 'topic': q_const.L2_AGENT_TOPIC, 'configurations': bridge_mappings, @@ -824,9 +825,10 @@ def create_agent_config_map(config): def main(): eventlet.monkey_patch() - cfg.CONF(project='quantum') cfg.CONF.register_opts(ip_lib.OPTS) + cfg.CONF(project='neutron') logging_config.setup_logging(cfg.CONF) + legacy.modernize_quantum_config(cfg.CONF) try: agent_config = create_agent_config_map(cfg.CONF) @@ -840,7 +842,7 @@ def main(): # commands target xen dom0 rather than domU. cfg.CONF.set_default('ip_lib_force_root', True) - plugin = OVSQuantumAgent(**agent_config) + plugin = OVSNeutronAgent(**agent_config) # Start everything. LOG.info(_("Agent initialized successfully, now running... ")) diff --git a/quantum/plugins/openvswitch/agent/xenapi/README b/neutron/plugins/openvswitch/agent/xenapi/README similarity index 91% rename from quantum/plugins/openvswitch/agent/xenapi/README rename to neutron/plugins/openvswitch/agent/xenapi/README index 321a7fccdd..0a02c99e1b 100644 --- a/quantum/plugins/openvswitch/agent/xenapi/README +++ b/neutron/plugins/openvswitch/agent/xenapi/README @@ -13,4 +13,4 @@ Otherwise, you can build an rpm by running the following command: and install the rpm by running the following command (from dom0): - rpm -i openstack-quantum-xen-plugins.rpm + rpm -i openstack-neutron-xen-plugins.rpm diff --git a/quantum/plugins/openvswitch/agent/xenapi/contrib/build-rpm.sh b/neutron/plugins/openvswitch/agent/xenapi/contrib/build-rpm.sh similarity index 67% rename from quantum/plugins/openvswitch/agent/xenapi/contrib/build-rpm.sh rename to neutron/plugins/openvswitch/agent/xenapi/contrib/build-rpm.sh index e2bca9704d..5499c6036c 100755 --- a/quantum/plugins/openvswitch/agent/xenapi/contrib/build-rpm.sh +++ b/neutron/plugins/openvswitch/agent/xenapi/contrib/build-rpm.sh @@ -3,16 +3,16 @@ set -eux thisdir=$(dirname $(readlink -f "$0")) -export QUANTUM_ROOT="$thisdir/../../../../../../" -export PYTHONPATH=$QUANTUM_ROOT +export NEUTRON_ROOT="$thisdir/../../../../../../" +export PYTHONPATH=$NEUTRON_ROOT -cd $QUANTUM_ROOT -VERSION=$(sh -c "(cat $QUANTUM_ROOT/quantum/version.py; \ - echo 'print common_version.VersionInfo(\"quantum\").release_string()') | \ +cd $NEUTRON_ROOT +VERSION=$(sh -c "(cat $NEUTRON_ROOT/neutron/version.py; \ + echo 'print common_version.VersionInfo(\"neutron\").release_string()') | \ python") cd - -PACKAGE=openstack-quantum-xen-plugins +PACKAGE=openstack-neutron-xen-plugins RPMBUILD_DIR=$PWD/rpmbuild if [ ! -d $RPMBUILD_DIR ]; then echo $RPMBUILD_DIR is missing diff --git a/quantum/plugins/openvswitch/agent/xenapi/contrib/rpmbuild/SPECS/openstack-quantum-xen-plugins.spec b/neutron/plugins/openvswitch/agent/xenapi/contrib/rpmbuild/SPECS/openstack-quantum-xen-plugins.spec similarity index 79% rename from quantum/plugins/openvswitch/agent/xenapi/contrib/rpmbuild/SPECS/openstack-quantum-xen-plugins.spec rename to neutron/plugins/openvswitch/agent/xenapi/contrib/rpmbuild/SPECS/openstack-quantum-xen-plugins.spec index abca7b6c7f..8ba03eaf14 100644 --- a/quantum/plugins/openvswitch/agent/xenapi/contrib/rpmbuild/SPECS/openstack-quantum-xen-plugins.spec +++ b/neutron/plugins/openvswitch/agent/xenapi/contrib/rpmbuild/SPECS/openstack-quantum-xen-plugins.spec @@ -1,20 +1,20 @@ -Name: openstack-quantum-xen-plugins +Name: openstack-neutron-xen-plugins Version: %{version} Release: 1 Summary: Files for XenAPI support. License: ASL 2.0 Group: Applications/Utilities -Source0: openstack-quantum-xen-plugins.tar.gz +Source0: openstack-neutron-xen-plugins.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %define debug_package %{nil} %description -This package contains files that are required for XenAPI support for Quantum. +This package contains files that are required for XenAPI support for Neutron. %prep -%setup -q -n openstack-quantum-xen-plugins +%setup -q -n openstack-neutron-xen-plugins %install rm -rf $RPM_BUILD_ROOT diff --git a/quantum/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap b/neutron/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap similarity index 98% rename from quantum/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap rename to neutron/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap index 57fcb9ae17..befe61f98a 100644 --- a/quantum/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap +++ b/neutron/plugins/openvswitch/agent/xenapi/etc/xapi.d/plugins/netwrap @@ -22,7 +22,7 @@ # import gettext -gettext.install('quantum', unicode=1) +gettext.install('neutron', unicode=1) try: import json except ImportError: diff --git a/quantum/plugins/openvswitch/common/__init__.py b/neutron/plugins/openvswitch/common/__init__.py similarity index 100% rename from quantum/plugins/openvswitch/common/__init__.py rename to neutron/plugins/openvswitch/common/__init__.py diff --git a/quantum/plugins/openvswitch/common/config.py b/neutron/plugins/openvswitch/common/config.py similarity index 95% rename from quantum/plugins/openvswitch/common/config.py rename to neutron/plugins/openvswitch/common/config.py index 3e45320ed4..90578aeb35 100644 --- a/quantum/plugins/openvswitch/common/config.py +++ b/neutron/plugins/openvswitch/common/config.py @@ -16,9 +16,9 @@ from oslo.config import cfg -from quantum.agent.common import config -from quantum.plugins.openvswitch.common import constants -from quantum import scheduler +from neutron.agent.common import config +from neutron.plugins.openvswitch.common import constants +from neutron import scheduler DEFAULT_BRIDGE_MAPPINGS = [] diff --git a/quantum/plugins/openvswitch/common/constants.py b/neutron/plugins/openvswitch/common/constants.py similarity index 100% rename from quantum/plugins/openvswitch/common/constants.py rename to neutron/plugins/openvswitch/common/constants.py diff --git a/quantum/plugins/openvswitch/ovs_db_v2.py b/neutron/plugins/openvswitch/ovs_db_v2.py similarity index 96% rename from quantum/plugins/openvswitch/ovs_db_v2.py rename to neutron/plugins/openvswitch/ovs_db_v2.py index 457650cbf7..27b9032e40 100644 --- a/quantum/plugins/openvswitch/ovs_db_v2.py +++ b/neutron/plugins/openvswitch/ovs_db_v2.py @@ -19,15 +19,15 @@ from sqlalchemy.orm import exc from sqlalchemy.sql import func -from quantum.common import exceptions as q_exc -import quantum.db.api as db -from quantum.db import models_v2 -from quantum.db import securitygroups_db as sg_db -from quantum.extensions import securitygroup as ext_sg -from quantum import manager -from quantum.openstack.common import log as logging -from quantum.plugins.openvswitch.common import constants -from quantum.plugins.openvswitch import ovs_models_v2 +from neutron.common import exceptions as q_exc +import neutron.db.api as db +from neutron.db import models_v2 +from neutron.db import securitygroups_db as sg_db +from neutron.extensions import securitygroup as ext_sg +from neutron import manager +from neutron.openstack.common import log as logging +from neutron.plugins.openvswitch.common import constants +from neutron.plugins.openvswitch import ovs_models_v2 LOG = logging.getLogger(__name__) @@ -331,7 +331,7 @@ def get_port_from_device(port_id): if not port_and_sgs: return None port = port_and_sgs[0][0] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin._make_port_dict(port) port_dict[ext_sg.SECURITYGROUPS] = [ sg_id for port_, sg_id in port_and_sgs if sg_id] diff --git a/quantum/plugins/openvswitch/ovs_models_v2.py b/neutron/plugins/openvswitch/ovs_models_v2.py similarity index 98% rename from quantum/plugins/openvswitch/ovs_models_v2.py rename to neutron/plugins/openvswitch/ovs_models_v2.py index 36c777a245..77a40a5ed4 100644 --- a/quantum/plugins/openvswitch/ovs_models_v2.py +++ b/neutron/plugins/openvswitch/ovs_models_v2.py @@ -19,7 +19,7 @@ from sqlalchemy import Boolean, Column, ForeignKey, Integer, String -from quantum.db.models_v2 import model_base +from neutron.db.models_v2 import model_base class VlanAllocation(model_base.BASEV2): diff --git a/quantum/plugins/openvswitch/ovs_quantum_plugin.py b/neutron/plugins/openvswitch/ovs_neutron_plugin.py similarity index 91% rename from quantum/plugins/openvswitch/ovs_quantum_plugin.py rename to neutron/plugins/openvswitch/ovs_neutron_plugin.py index a7bd265bed..b98892966d 100644 --- a/quantum/plugins/openvswitch/ovs_quantum_plugin.py +++ b/neutron/plugins/openvswitch/ovs_neutron_plugin.py @@ -25,35 +25,35 @@ import sys from oslo.config import cfg -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.rpc.agentnotifiers import l3_rpc_agent_api -from quantum.api.v2 import attributes -from quantum.common import constants as q_const -from quantum.common import exceptions as q_exc -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.common import utils -from quantum.db import agents_db -from quantum.db import agentschedulers_db -from quantum.db import db_base_plugin_v2 -from quantum.db import dhcp_rpc_base -from quantum.db import extraroute_db -from quantum.db import l3_gwmode_db -from quantum.db import l3_rpc_base -from quantum.db import portbindings_db -from quantum.db import quota_db # noqa -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.extensions import portbindings -from quantum.extensions import providernet as provider -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import proxy -from quantum.plugins.common import utils as plugin_utils -from quantum.plugins.openvswitch.common import config # noqa -from quantum.plugins.openvswitch.common import constants -from quantum.plugins.openvswitch import ovs_db_v2 +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api +from neutron.api.v2 import attributes +from neutron.common import constants as q_const +from neutron.common import exceptions as q_exc +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.common import utils +from neutron.db import agents_db +from neutron.db import agentschedulers_db +from neutron.db import db_base_plugin_v2 +from neutron.db import dhcp_rpc_base +from neutron.db import extraroute_db +from neutron.db import l3_gwmode_db +from neutron.db import l3_rpc_base +from neutron.db import portbindings_db +from neutron.db import quota_db # noqa +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.extensions import portbindings +from neutron.extensions import providernet as provider +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import proxy +from neutron.plugins.common import utils as plugin_utils +from neutron.plugins.openvswitch.common import config # noqa +from neutron.plugins.openvswitch.common import constants +from neutron.plugins.openvswitch import ovs_db_v2 LOG = logging.getLogger(__name__) @@ -214,24 +214,24 @@ class AgentNotifierApi(proxy.RpcProxy, topic=self.topic_tunnel_update) -class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class OVSNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2, extraroute_db.ExtraRoute_db_mixin, l3_gwmode_db.L3_NAT_db_mixin, sg_db_rpc.SecurityGroupServerRpcMixin, agentschedulers_db.AgentSchedulerDbMixin, portbindings_db.PortBindingMixin): - """Implement the Quantum abstractions using Open vSwitch. + """Implement the Neutron abstractions using Open vSwitch. Depending on whether tunneling is enabled, either a GRE, VXLAN tunnel or a new VLAN is created for each network. An agent is relied upon to perform the actual OVS configuration on each host. The provider extension is also supported. As discussed in - https://bugs.launchpad.net/quantum/+bug/1023156, this class could + https://bugs.launchpad.net/neutron/+bug/1023156, this class could be simplified, and filtering on extended attributes could be handled, by adding support for extended attributes to the - QuantumDbPluginV2 base class. When that occurs, this class should + NeutronDbPluginV2 base class. When that occurs, this class should be updated to take advantage of it. The port binding extension enables an external application relay @@ -287,9 +287,11 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, sys.exit(1) self.setup_rpc() self.network_scheduler = importutils.import_object( - cfg.CONF.network_scheduler_driver) + cfg.CONF.network_scheduler_driver + ) self.router_scheduler = importutils.import_object( - cfg.CONF.router_scheduler_driver) + cfg.CONF.router_scheduler_driver + ) def setup_rpc(self): # RPC support @@ -451,7 +453,7 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, elif network_type in constants.TUNNEL_NETWORK_TYPES: ovs_db_v2.reserve_specific_tunnel(session, segmentation_id) # no reservation needed for TYPE_LOCAL - net = super(OVSQuantumPluginV2, self).create_network(context, + net = super(OVSNeutronPluginV2, self).create_network(context, network) ovs_db_v2.add_network_binding(session, net['id'], network_type, physical_network, segmentation_id) @@ -467,7 +469,7 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, session = context.session with session.begin(subtransactions=True): - net = super(OVSQuantumPluginV2, self).update_network(context, id, + net = super(OVSNeutronPluginV2, self).update_network(context, id, network) self._process_l3_update(context, net, network['network']) self._extend_network_dict_provider(context, net) @@ -477,7 +479,7 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, session = context.session with session.begin(subtransactions=True): binding = ovs_db_v2.get_network_binding(session, id) - super(OVSQuantumPluginV2, self).delete_network(context, id) + super(OVSNeutronPluginV2, self).delete_network(context, id) if binding.network_type in constants.TUNNEL_NETWORK_TYPES: ovs_db_v2.release_tunnel(session, binding.segmentation_id, self.tunnel_id_ranges) @@ -493,7 +495,7 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, def get_network(self, context, id, fields=None): session = context.session with session.begin(subtransactions=True): - net = super(OVSQuantumPluginV2, self).get_network(context, + net = super(OVSNeutronPluginV2, self).get_network(context, id, None) self._extend_network_dict_provider(context, net) return self._fields(net, fields) @@ -503,7 +505,7 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, limit=None, marker=None, page_reverse=False): session = context.session with session.begin(subtransactions=True): - nets = super(OVSQuantumPluginV2, + nets = super(OVSNeutronPluginV2, self).get_networks(context, filters, None, sorts, limit, marker, page_reverse) for net in nets: @@ -519,7 +521,7 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, with session.begin(subtransactions=True): self._ensure_default_security_group_on_port(context, port) sgids = self._get_security_groups_on_port(context, port) - port = super(OVSQuantumPluginV2, self).create_port(context, port) + port = super(OVSNeutronPluginV2, self).create_port(context, port) self._process_portbindings_create_and_update(context, port_data, port) self._process_port_create_security_group(context, port, sgids) @@ -530,9 +532,9 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, session = context.session need_port_update_notify = False with session.begin(subtransactions=True): - original_port = super(OVSQuantumPluginV2, self).get_port( + original_port = super(OVSNeutronPluginV2, self).get_port( context, id) - updated_port = super(OVSQuantumPluginV2, self).update_port( + updated_port = super(OVSNeutronPluginV2, self).update_port( context, id, port) need_port_update_notify = self.update_security_group_on_port( context, id, port, original_port, updated_port) @@ -565,6 +567,6 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, self.disassociate_floatingips(context, id) port = self.get_port(context, id) self._delete_port_security_group_bindings(context, id) - super(OVSQuantumPluginV2, self).delete_port(context, id) + super(OVSNeutronPluginV2, self).delete_port(context, id) self.notify_security_groups_member_updated(context, port) diff --git a/neutron/plugins/plumgrid/README b/neutron/plugins/plumgrid/README new file mode 100644 index 0000000000..df8eb9f4e4 --- /dev/null +++ b/neutron/plugins/plumgrid/README @@ -0,0 +1,7 @@ +PLUMgrid Neutron Virtual Network Plugin + +This plugin implements Neutron v2 APIs and helps configure +L2/L3 virtual networks consisting of PLUMgrid Platform. + +For more details on use please refer to: +http://wiki.openstack.org/plumgrid-neutron diff --git a/quantum/plugins/plumgrid/__init__.py b/neutron/plugins/plumgrid/__init__.py similarity index 100% rename from quantum/plugins/plumgrid/__init__.py rename to neutron/plugins/plumgrid/__init__.py diff --git a/quantum/plugins/plumgrid/common/__init__.py b/neutron/plugins/plumgrid/common/__init__.py similarity index 100% rename from quantum/plugins/plumgrid/common/__init__.py rename to neutron/plugins/plumgrid/common/__init__.py diff --git a/quantum/plugins/plumgrid/common/exceptions.py b/neutron/plugins/plumgrid/common/exceptions.py similarity index 86% rename from quantum/plugins/plumgrid/common/exceptions.py rename to neutron/plugins/plumgrid/common/exceptions.py index 015c6730e0..f54d55308e 100644 --- a/quantum/plugins/plumgrid/common/exceptions.py +++ b/neutron/plugins/plumgrid/common/exceptions.py @@ -17,12 +17,12 @@ # @author: Edgar Magana, emagana@plumgrid.com, PLUMgrid, Inc. -"""Quantum PLUMgrid Plugin exceptions""" +"""Neutron PLUMgrid Plugin exceptions""" -from quantum.common import exceptions as base_exec +from neutron.common import exceptions as base_exec -class PLUMgridException(base_exec.QuantumException): +class PLUMgridException(base_exec.NeutronException): message = _("An unexpected error occurred in the PLUMgrid Plugin: " "%(err_msg)s") diff --git a/quantum/plugins/plumgrid/plumgrid_nos_plugin/__init__.py b/neutron/plugins/plumgrid/plumgrid_nos_plugin/__init__.py similarity index 100% rename from quantum/plugins/plumgrid/plumgrid_nos_plugin/__init__.py rename to neutron/plugins/plumgrid/plumgrid_nos_plugin/__init__.py diff --git a/quantum/plugins/plumgrid/plumgrid_nos_plugin/plugin_ver.py b/neutron/plugins/plumgrid/plumgrid_nos_plugin/plugin_ver.py similarity index 100% rename from quantum/plugins/plumgrid/plumgrid_nos_plugin/plugin_ver.py rename to neutron/plugins/plumgrid/plumgrid_nos_plugin/plugin_ver.py diff --git a/quantum/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_nos_snippets.py b/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_nos_snippets.py similarity index 92% rename from quantum/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_nos_snippets.py rename to neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_nos_snippets.py index 02faa5a758..6d6b221279 100644 --- a/quantum/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_nos_snippets.py +++ b/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_nos_snippets.py @@ -20,7 +20,7 @@ Snippets needed by the PLUMgrid Plugin """ -from quantum.openstack.common import log as logging +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -31,7 +31,7 @@ class DataNOSPLUMgrid(): BASE_NOS_URL = '/0/connectivity/domain/' def __init__(self): - LOG.info(_('QuantumPluginPLUMgrid Status: NOS Body Data Creation')) + LOG.info(_('NeutronPluginPLUMgrid Status: NOS Body Data Creation')) def create_domain_body_data(self, tenant_id): body_data = {"container_group": tenant_id} diff --git a/quantum/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py b/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py similarity index 81% rename from quantum/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py rename to neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py index 108908d39e..b1ad36b265 100644 --- a/quantum/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py +++ b/neutron/plugins/plumgrid/plumgrid_nos_plugin/plumgrid_plugin.py @@ -16,20 +16,20 @@ # @author: Edgar Magana, emagana@plumgrid.com, PLUMgrid, Inc. """ -Quantum PLUMgrid Plug-in for PLUMgrid Virtual Technology +Neutron PLUMgrid Plug-in for PLUMgrid Virtual Technology This plugin will forward authenticated REST API calls to the Network Operating System by PLUMgrid called NOS """ from oslo.config import cfg -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.openstack.common import log as logging -from quantum.plugins.plumgrid.common import exceptions as plum_excep -from quantum.plugins.plumgrid.plumgrid_nos_plugin.plugin_ver import VERSION -from quantum.plugins.plumgrid.plumgrid_nos_plugin import plumgrid_nos_snippets -from quantum.plugins.plumgrid.plumgrid_nos_plugin import rest_connection +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.openstack.common import log as logging +from neutron.plugins.plumgrid.common import exceptions as plum_excep +from neutron.plugins.plumgrid.plumgrid_nos_plugin.plugin_ver import VERSION +from neutron.plugins.plumgrid.plumgrid_nos_plugin import plumgrid_nos_snippets +from neutron.plugins.plumgrid.plumgrid_nos_plugin import rest_connection LOG = logging.getLogger(__name__) @@ -53,10 +53,10 @@ nos_server_opts = [ cfg.CONF.register_opts(nos_server_opts, "PLUMgridNOS") -class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): +class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2): def __init__(self): - LOG.info(_('QuantumPluginPLUMgrid Status: Starting Plugin')) + LOG.info(_('NeutronPluginPLUMgrid Status: Starting Plugin')) # PLUMgrid NOS configuration nos_plumgrid = cfg.CONF.PLUMgridNOS.nos_server @@ -71,7 +71,7 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): self.rest_conn = rest_connection.RestConnection(nos_plumgrid, nos_port, timeout) if self.rest_conn is None: - raise SystemExit(_('QuantumPluginPLUMgrid Status: ' + raise SystemExit(_('NeutronPluginPLUMgrid Status: ' 'Aborting Plugin')) else: @@ -79,18 +79,18 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): db.configure_db() # PLUMgrid NOS info validation - LOG.info(_('QuantumPluginPLUMgrid NOS: %s'), nos_plumgrid) + LOG.info(_('NeutronPluginPLUMgrid NOS: %s'), nos_plumgrid) if not nos_plumgrid: - raise SystemExit(_('QuantumPluginPLUMgrid Status: ' + raise SystemExit(_('NeutronPluginPLUMgrid Status: ' 'NOS value is missing in config file')) - LOG.debug(_('QuantumPluginPLUMgrid Status: Quantum server with ' + LOG.debug(_('NeutronPluginPLUMgrid Status: Neutron server with ' 'PLUMgrid Plugin has started')) def create_network(self, context, network): - """Create network core Quantum API.""" + """Create network core Neutron API.""" - LOG.debug(_('QuantumPluginPLUMgrid Status: create_network() called')) + LOG.debug(_('NeutronPluginPLUMgrid Status: create_network() called')) # Plugin DB - Network Create and validation tenant_id = self._get_tenant_id_for_create(context, @@ -98,11 +98,11 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): self._network_admin_state(network) with context.session.begin(subtransactions=True): - net = super(QuantumPluginPLUMgridV2, self).create_network(context, + net = super(NeutronPluginPLUMgridV2, self).create_network(context, network) try: - LOG.debug(_('QuantumPluginPLUMgrid Status: %(tenant_id)s, ' + LOG.debug(_('NeutronPluginPLUMgrid Status: %(tenant_id)s, ' '%(network)s, %(network_id)s'), dict( tenant_id=tenant_id, @@ -124,16 +124,16 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): return net def update_network(self, context, net_id, network): - """Update network core Quantum API.""" + """Update network core Neutron API.""" - LOG.debug(_("QuantumPluginPLUMgridV2.update_network() called")) + LOG.debug(_("NeutronPluginPLUMgridV2.update_network() called")) self._network_admin_state(network) tenant_id = self._get_tenant_id_for_create(context, network["network"]) with context.session.begin(subtransactions=True): # Plugin DB - Network Update new_network = super( - QuantumPluginPLUMgridV2, self).update_network(context, + NeutronPluginPLUMgridV2, self).update_network(context, net_id, network) try: @@ -156,13 +156,13 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): return new_network def delete_network(self, context, net_id): - """Delete network core Quantum API.""" - LOG.debug(_("QuantumPluginPLUMgrid Status: delete_network() called")) - super(QuantumPluginPLUMgridV2, self).get_network(context, net_id) + """Delete network core Neutron API.""" + LOG.debug(_("NeutronPluginPLUMgrid Status: delete_network() called")) + super(NeutronPluginPLUMgridV2, self).get_network(context, net_id) with context.session.begin(subtransactions=True): # Plugin DB - Network Delete - super(QuantumPluginPLUMgridV2, self).delete_network(context, + super(NeutronPluginPLUMgridV2, self).delete_network(context, net_id) try: @@ -177,47 +177,47 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): raise plum_excep.PLUMgridException(err_message) def create_port(self, context, port): - """Create port core Quantum API.""" - LOG.debug(_("QuantumPluginPLUMgrid Status: create_port() called")) + """Create port core Neutron API.""" + LOG.debug(_("NeutronPluginPLUMgrid Status: create_port() called")) # Port operations on PLUMgrid NOS is an automatic operation from the # VIF driver operations in Nova. It requires admin_state_up to be True port["port"]["admin_state_up"] = True # Plugin DB - Port Create and Return port - return super(QuantumPluginPLUMgridV2, self).create_port(context, + return super(NeutronPluginPLUMgridV2, self).create_port(context, port) def update_port(self, context, port_id, port): - """Update port core Quantum API.""" - LOG.debug(_("QuantumPluginPLUMgrid Status: update_port() called")) + """Update port core Neutron API.""" + LOG.debug(_("NeutronPluginPLUMgrid Status: update_port() called")) # Port operations on PLUMgrid NOS is an automatic operation from the # VIF driver operations in Nova. # Plugin DB - Port Update - return super(QuantumPluginPLUMgridV2, self).update_port( + return super(NeutronPluginPLUMgridV2, self).update_port( context, port_id, port) def delete_port(self, context, port_id): - """Delete port core Quantum API.""" + """Delete port core Neutron API.""" - LOG.debug(_("QuantumPluginPLUMgrid Status: delete_port() called")) + LOG.debug(_("NeutronPluginPLUMgrid Status: delete_port() called")) # Port operations on PLUMgrid NOS is an automatic operation from the # VIF driver operations in Nova. # Plugin DB - Port Delete - super(QuantumPluginPLUMgridV2, self).delete_port(context, port_id) + super(NeutronPluginPLUMgridV2, self).delete_port(context, port_id) def create_subnet(self, context, subnet): - """Create subnet core Quantum API.""" + """Create subnet core Neutron API.""" - LOG.debug(_("QuantumPluginPLUMgrid Status: create_subnet() called")) + LOG.debug(_("NeutronPluginPLUMgrid Status: create_subnet() called")) with context.session.begin(subtransactions=True): # Plugin DB - Subnet Create - subnet = super(QuantumPluginPLUMgridV2, self).create_subnet( + subnet = super(NeutronPluginPLUMgridV2, self).create_subnet( context, subnet) subnet_details = self._get_subnet(context, subnet["id"]) net_id = subnet_details["network_id"] @@ -238,15 +238,15 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): return subnet def delete_subnet(self, context, subnet_id): - """Delete subnet core Quantum API.""" + """Delete subnet core Neutron API.""" - LOG.debug(_("QuantumPluginPLUMgrid Status: delete_subnet() called")) + LOG.debug(_("NeutronPluginPLUMgrid Status: delete_subnet() called")) #Collecting subnet info subnet_details = self._get_subnet(context, subnet_id) with context.session.begin(subtransactions=True): # Plugin DB - Subnet Delete - del_subnet = super(QuantumPluginPLUMgridV2, self).delete_subnet( + del_subnet = super(NeutronPluginPLUMgridV2, self).delete_subnet( context, subnet_id) try: headers = {} @@ -261,7 +261,7 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): return del_subnet def update_subnet(self, context, subnet_id, subnet): - """Update subnet core Quantum API.""" + """Update subnet core Neutron API.""" LOG.debug(_("update_subnet() called")) #Collecting subnet info @@ -271,7 +271,7 @@ class QuantumPluginPLUMgridV2(db_base_plugin_v2.QuantumDbPluginV2): with context.session.begin(subtransactions=True): # Plugin DB - Subnet Update - new_subnet = super(QuantumPluginPLUMgridV2, self).update_subnet( + new_subnet = super(NeutronPluginPLUMgridV2, self).update_subnet( context, subnet_id, subnet) try: diff --git a/quantum/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py b/neutron/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py similarity index 92% rename from quantum/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py rename to neutron/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py index 5d15c76272..bc8c53e7b0 100644 --- a/quantum/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py +++ b/neutron/plugins/plumgrid/plumgrid_nos_plugin/rest_connection.py @@ -17,7 +17,7 @@ # @author: Brenden Blanco, bblanco@plumgrid.com, PLUMgrid, Inc. """ -Quantum PLUMgrid Plug-in for PLUMgrid Virtual Technology +Neutron PLUMgrid Plug-in for PLUMgrid Virtual Technology This plugin will forward authenticated REST API calls to the Network Operating System by PLUMgrid called NOS """ @@ -25,9 +25,9 @@ to the Network Operating System by PLUMgrid called NOS import httplib import urllib2 -from quantum.openstack.common import jsonutils as json -from quantum.openstack.common import log as logging -from quantum.plugins.plumgrid.common import exceptions as plum_excep +from neutron.openstack.common import jsonutils as json +from neutron.openstack.common import log as logging +from neutron.plugins.plumgrid.common import exceptions as plum_excep LOG = logging.getLogger(__name__) @@ -37,7 +37,7 @@ class RestConnection(object): """REST Connection to PLUMgrid NOS Server.""" def __init__(self, server, port, timeout): - LOG.debug(_('QuantumPluginPLUMgrid Status: REST Connection Started')) + LOG.debug(_('NeutronPluginPLUMgrid Status: REST Connection Started')) self.server = server self.port = port self.timeout = timeout diff --git a/quantum/plugins/ryu/README b/neutron/plugins/ryu/README similarity index 79% rename from quantum/plugins/ryu/README rename to neutron/plugins/ryu/README index 866b2a8682..054c69a86c 100644 --- a/quantum/plugins/ryu/README +++ b/neutron/plugins/ryu/README @@ -1,5 +1,5 @@ -Quantum plugin for Ryu Network Operating System -This directory includes quantum plugin for Ryu Network Operating System. +Neutron plugin for Ryu Network Operating System +This directory includes neutron plugin for Ryu Network Operating System. # -- Installation diff --git a/quantum/plugins/ryu/agent/__init__.py b/neutron/plugins/ryu/__init__.py similarity index 100% rename from quantum/plugins/ryu/agent/__init__.py rename to neutron/plugins/ryu/__init__.py diff --git a/quantum/plugins/ryu/db/__init__.py b/neutron/plugins/ryu/agent/__init__.py similarity index 100% rename from quantum/plugins/ryu/db/__init__.py rename to neutron/plugins/ryu/agent/__init__.py diff --git a/quantum/plugins/ryu/agent/ryu_quantum_agent.py b/neutron/plugins/ryu/agent/ryu_neutron_agent.py similarity index 92% rename from quantum/plugins/ryu/agent/ryu_quantum_agent.py rename to neutron/plugins/ryu/agent/ryu_neutron_agent.py index 7b5a5a43ef..85884f921c 100755 --- a/quantum/plugins/ryu/agent/ryu_quantum_agent.py +++ b/neutron/plugins/ryu/agent/ryu_neutron_agent.py @@ -32,18 +32,18 @@ from ryu.app import client from ryu.app import conf_switch_key from ryu.app import rest_nw_id -from quantum.agent.linux import ovs_lib -from quantum.agent.linux.ovs_lib import VifPort -from quantum.agent import rpc as agent_rpc -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.common import config as logging_config -from quantum.common import exceptions as q_exc -from quantum.common import topics -from quantum import context as q_context -from quantum.extensions import securitygroup as ext_sg -from quantum.openstack.common import log -from quantum.openstack.common.rpc import dispatcher -from quantum.plugins.ryu.common import config # noqa +from neutron.agent.linux import ovs_lib +from neutron.agent.linux.ovs_lib import VifPort +from neutron.agent import rpc as agent_rpc +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.common import config as logging_config +from neutron.common import exceptions as q_exc +from neutron.common import topics +from neutron import context as q_context +from neutron.extensions import securitygroup as ext_sg +from neutron.openstack.common import log +from neutron.openstack.common.rpc import dispatcher +from neutron.plugins.ryu.common import config # noqa LOG = log.getLogger(__name__) @@ -169,13 +169,13 @@ class RyuSecurityGroupAgent(sg_rpc.SecurityGroupAgentRpcMixin): self.init_firewall() -class OVSQuantumOFPRyuAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin): +class OVSNeutronOFPRyuAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin): RPC_API_VERSION = '1.1' def __init__(self, integ_br, tunnel_ip, ovsdb_ip, ovsdb_port, polling_interval, root_helper): - super(OVSQuantumOFPRyuAgent, self).__init__() + super(OVSNeutronOFPRyuAgent, self).__init__() self.polling_interval = polling_interval self._setup_rpc() self.sg_agent = RyuSecurityGroupAgent(self.context, @@ -274,7 +274,7 @@ class OVSQuantumOFPRyuAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin): def main(): eventlet.monkey_patch() - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') logging_config.setup_logging(cfg.CONF) @@ -289,7 +289,7 @@ def main(): ovsdb_ip = _get_ovsdb_ip() LOG.debug(_('ovsdb_ip %s'), ovsdb_ip) try: - agent = OVSQuantumOFPRyuAgent(integ_br, tunnel_ip, ovsdb_ip, + agent = OVSNeutronOFPRyuAgent(integ_br, tunnel_ip, ovsdb_ip, ovsdb_port, polling_interval, root_helper) except httplib.HTTPException as e: diff --git a/quantum/plugins/ryu/common/__init__.py b/neutron/plugins/ryu/common/__init__.py similarity index 100% rename from quantum/plugins/ryu/common/__init__.py rename to neutron/plugins/ryu/common/__init__.py diff --git a/quantum/plugins/ryu/common/config.py b/neutron/plugins/ryu/common/config.py similarity index 97% rename from quantum/plugins/ryu/common/config.py rename to neutron/plugins/ryu/common/config.py index fec0ead4db..37b369df20 100644 --- a/quantum/plugins/ryu/common/config.py +++ b/neutron/plugins/ryu/common/config.py @@ -16,7 +16,7 @@ from oslo.config import cfg -from quantum.agent.common import config +from neutron.agent.common import config ovs_opts = [ diff --git a/neutron/plugins/ryu/db/__init__.py b/neutron/plugins/ryu/db/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/quantum/plugins/ryu/db/api_v2.py b/neutron/plugins/ryu/db/api_v2.py similarity index 95% rename from quantum/plugins/ryu/db/api_v2.py rename to neutron/plugins/ryu/db/api_v2.py index ab67560075..53f65d18de 100644 --- a/quantum/plugins/ryu/db/api_v2.py +++ b/neutron/plugins/ryu/db/api_v2.py @@ -18,14 +18,14 @@ from sqlalchemy import exc as sa_exc from sqlalchemy import func from sqlalchemy.orm import exc as orm_exc -from quantum.common import exceptions as q_exc -import quantum.db.api as db -from quantum.db import models_v2 -from quantum.db import securitygroups_db as sg_db -from quantum.extensions import securitygroup as ext_sg -from quantum import manager -from quantum.openstack.common import log as logging -from quantum.plugins.ryu.db import models_v2 as ryu_models_v2 +from neutron.common import exceptions as q_exc +import neutron.db.api as db +from neutron.db import models_v2 +from neutron.db import securitygroups_db as sg_db +from neutron.extensions import securitygroup as ext_sg +from neutron import manager +from neutron.openstack.common import log as logging +from neutron.plugins.ryu.db import models_v2 as ryu_models_v2 LOG = logging.getLogger(__name__) @@ -50,7 +50,7 @@ def get_port_from_device(port_id): if not port_and_sgs: return None port = port_and_sgs[0][0] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin._make_port_dict(port) port_dict[ext_sg.SECURITYGROUPS] = [ sg_id for port_, sg_id in port_and_sgs if sg_id] diff --git a/quantum/plugins/ryu/db/models_v2.py b/neutron/plugins/ryu/db/models_v2.py similarity index 97% rename from quantum/plugins/ryu/db/models_v2.py rename to neutron/plugins/ryu/db/models_v2.py index 911032c9da..cf10e17328 100644 --- a/quantum/plugins/ryu/db/models_v2.py +++ b/neutron/plugins/ryu/db/models_v2.py @@ -16,7 +16,7 @@ import sqlalchemy as sa -from quantum.db import model_base +from neutron.db import model_base class TunnelKeyLast(model_base.BASEV2): diff --git a/quantum/plugins/ryu/ryu_quantum_plugin.py b/neutron/plugins/ryu/ryu_neutron_plugin.py similarity index 85% rename from quantum/plugins/ryu/ryu_quantum_plugin.py rename to neutron/plugins/ryu/ryu_neutron_plugin.py index c487098b8c..1e10ca8b6f 100644 --- a/quantum/plugins/ryu/ryu_quantum_plugin.py +++ b/neutron/plugins/ryu/ryu_neutron_plugin.py @@ -20,24 +20,24 @@ from oslo.config import cfg from ryu.app import client from ryu.app import rest_nw_id -from quantum.agent import securitygroups_rpc as sg_rpc -from quantum.common import constants as q_const -from quantum.common import exceptions as q_exc -from quantum.common import rpc as q_rpc -from quantum.common import topics -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import dhcp_rpc_base -from quantum.db import extraroute_db -from quantum.db import l3_gwmode_db -from quantum.db import l3_rpc_base -from quantum.db import models_v2 -from quantum.db import securitygroups_rpc_base as sg_db_rpc -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import proxy -from quantum.plugins.ryu.common import config # noqa -from quantum.plugins.ryu.db import api_v2 as db_api_v2 +from neutron.agent import securitygroups_rpc as sg_rpc +from neutron.common import constants as q_const +from neutron.common import exceptions as q_exc +from neutron.common import rpc as q_rpc +from neutron.common import topics +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import dhcp_rpc_base +from neutron.db import extraroute_db +from neutron.db import l3_gwmode_db +from neutron.db import l3_rpc_base +from neutron.db import models_v2 +from neutron.db import securitygroups_rpc_base as sg_db_rpc +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import proxy +from neutron.plugins.ryu.common import config # noqa +from neutron.plugins.ryu.db import api_v2 as db_api_v2 LOG = logging.getLogger(__name__) @@ -85,7 +85,7 @@ class AgentNotifierApi(proxy.RpcProxy, topic=self.topic_port_update) -class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, +class RyuNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2, extraroute_db.ExtraRoute_db_mixin, l3_gwmode_db.L3_NAT_db_mixin, sg_db_rpc.SecurityGroupServerRpcMixin): @@ -111,7 +111,7 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, self.client = client.OFPClient(self.ofp_api_host) self.tun_client = client.TunnelClient(self.ofp_api_host) - self.iface_client = client.QuantumIfaceClient(self.ofp_api_host) + self.iface_client = client.NeutronIfaceClient(self.ofp_api_host) for nw_id in rest_nw_id.RESERVED_NETWORK_IDS: if nw_id != rest_nw_id.NW_ID_UNKNOWN: self.client.update_network(nw_id) @@ -155,7 +155,7 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, context, network['network']) self._ensure_default_security_group(context, tenant_id) - net = super(RyuQuantumPluginV2, self).create_network(context, + net = super(RyuNeutronPluginV2, self).create_network(context, network) self._process_l3_create(context, net, network['network']) @@ -171,7 +171,7 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, def update_network(self, context, id, network): session = context.session with session.begin(subtransactions=True): - net = super(RyuQuantumPluginV2, self).update_network(context, id, + net = super(RyuNeutronPluginV2, self).update_network(context, id, network) self._process_l3_update(context, net, network['network']) return net @@ -181,14 +181,14 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, session = context.session with session.begin(subtransactions=True): self.tunnel_key.delete(session, id) - super(RyuQuantumPluginV2, self).delete_network(context, id) + super(RyuNeutronPluginV2, self).delete_network(context, id) def create_port(self, context, port): session = context.session with session.begin(subtransactions=True): self._ensure_default_security_group_on_port(context, port) sgids = self._get_security_groups_on_port(context, port) - port = super(RyuQuantumPluginV2, self).create_port(context, port) + port = super(RyuNeutronPluginV2, self).create_port(context, port) self._process_port_create_security_group( context, port, sgids) self.notify_security_groups_member_updated(context, port) @@ -205,7 +205,7 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, self.disassociate_floatingips(context, id) port = self.get_port(context, id) self._delete_port_security_group_bindings(context, id) - super(RyuQuantumPluginV2, self).delete_port(context, id) + super(RyuNeutronPluginV2, self).delete_port(context, id) self.notify_security_groups_member_updated(context, port) @@ -215,9 +215,9 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, need_port_update_notify = False with session.begin(subtransactions=True): - original_port = super(RyuQuantumPluginV2, self).get_port( + original_port = super(RyuNeutronPluginV2, self).get_port( context, id) - updated_port = super(RyuQuantumPluginV2, self).update_port( + updated_port = super(RyuNeutronPluginV2, self).update_port( context, id, port) need_port_update_notify = self.update_security_group_on_port( context, id, port, original_port, updated_port) @@ -237,12 +237,12 @@ class RyuQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2, def get_port(self, context, id, fields=None): with context.session.begin(subtransactions=True): - port = super(RyuQuantumPluginV2, self).get_port(context, id, + port = super(RyuNeutronPluginV2, self).get_port(context, id, fields) return self._fields(port, fields) def get_ports(self, context, filters=None, fields=None): with context.session.begin(subtransactions=True): - ports = super(RyuQuantumPluginV2, self).get_ports( + ports = super(RyuNeutronPluginV2, self).get_ports( context, filters, fields) return [self._fields(port, fields) for port in ports] diff --git a/quantum/policy.py b/neutron/policy.py similarity index 95% rename from quantum/policy.py rename to neutron/policy.py index 15ce561642..28d8f60e99 100644 --- a/quantum/policy.py +++ b/neutron/policy.py @@ -16,20 +16,20 @@ # under the License. """ -Policy engine for quantum. Largely copied from nova. +Policy engine for neutron. Largely copied from nova. """ import itertools import re from oslo.config import cfg -from quantum.api.v2 import attributes -from quantum.common import exceptions -import quantum.common.utils as utils -from quantum import manager -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import policy +from neutron.api.v2 import attributes +from neutron.common import exceptions +import neutron.common.utils as utils +from neutron import manager +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import policy LOG = logging.getLogger(__name__) @@ -53,7 +53,7 @@ DEPRECATED_ACTION_MAP = { 'set': ['create', 'update'] } -cfg.CONF.import_opt('policy_file', 'quantum.common.config') +cfg.CONF.import_opt('policy_file', 'neutron.common.config') def reset(): @@ -228,11 +228,11 @@ class OwnerCheck(policy.Check): # resource is handled by the core plugin. It might be worth # having a way to map resources to plugins so to make this # check more general - f = getattr(manager.QuantumManager.get_instance().plugin, + f = getattr(manager.NeutronManager.get_instance().plugin, 'get_%s' % parent_res) - # f *must* exist, if not found it is better to let quantum + # f *must* exist, if not found it is better to let neutron # explode. Check will be performed with admin context - context = importutils.import_module('quantum.context') + context = importutils.import_module('neutron.context') try: data = f(context.get_admin_context(), target[parent_foreign_key], @@ -293,7 +293,7 @@ def _prepare_check(context, action, target): def check(context, action, target, plugin=None): """Verifies that the action is valid on the target in this context. - :param context: quantum context + :param context: neutron context :param action: string representing the action to be checked this should be colon separated for clarity. :param target: dictionary representing the object of the action @@ -326,7 +326,7 @@ def check_if_exists(context, action, target): def enforce(context, action, target, plugin=None): """Verifies that the action is valid on the target in this context. - :param context: quantum context + :param context: neutron context :param action: string representing the action to be checked this should be colon separated for clarity. :param target: dictionary representing the object of the action @@ -335,7 +335,7 @@ def enforce(context, action, target, plugin=None): :param plugin: currently unused and deprecated. Kept for backward compatibility. - :raises quantum.exceptions.PolicyNotAllowed: if verification fails. + :raises neutron.exceptions.PolicyNotAllowed: if verification fails. """ init() diff --git a/quantum/quota.py b/neutron/quota.py similarity index 98% rename from quantum/quota.py rename to neutron/quota.py index 5896ec401f..67e4efdc73 100644 --- a/quantum/quota.py +++ b/neutron/quota.py @@ -19,9 +19,9 @@ from oslo.config import cfg import webob -from quantum.common import exceptions -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging +from neutron.common import exceptions +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) quota_opts = [ @@ -46,7 +46,7 @@ quota_opts = [ help=_('number of ports allowed per tenant, minus for ' 'unlimited')), cfg.StrOpt('quota_driver', - default='quantum.quota.ConfDriver', + default='neutron.quota.ConfDriver', help=_('Default driver to use for quota checks')), ] # Register the configuration options @@ -58,7 +58,7 @@ class ConfDriver(object): Driver to perform necessary checks to enforce quotas and obtain quota information. The default driver utilizes the default values - in quantum.conf. + in neutron.conf. """ def _get_quotas(self, context, resources, keys): diff --git a/quantum/rootwrap/__init__.py b/neutron/rootwrap/__init__.py similarity index 100% rename from quantum/rootwrap/__init__.py rename to neutron/rootwrap/__init__.py diff --git a/quantum/rootwrap/filters.py b/neutron/rootwrap/filters.py similarity index 97% rename from quantum/rootwrap/filters.py rename to neutron/rootwrap/filters.py index 30472452ca..e14f2c8bd2 100644 --- a/quantum/rootwrap/filters.py +++ b/neutron/rootwrap/filters.py @@ -146,8 +146,8 @@ class DnsmasqFilter(CommandFilter): return False def is_dnsmasq_env_vars(self, argv): - if (argv[0].startswith("QUANTUM_RELAY_SOCKET_PATH=") and - argv[1].startswith("QUANTUM_NETWORK_ID=")): + if (argv[0].startswith("NEUTRON_RELAY_SOCKET_PATH=") and + argv[1].startswith("NEUTRON_NETWORK_ID=")): return True return False @@ -166,8 +166,8 @@ class DnsmasqFilter(CommandFilter): def get_environment(self, userargs): env = os.environ.copy() - env['QUANTUM_RELAY_SOCKET_PATH'] = userargs[0].split('=')[-1] - env['QUANTUM_NETWORK_ID'] = userargs[1].split('=')[-1] + env['NEUTRON_RELAY_SOCKET_PATH'] = userargs[0].split('=')[-1] + env['NEUTRON_NETWORK_ID'] = userargs[1].split('=')[-1] return env diff --git a/quantum/rootwrap/wrapper.py b/neutron/rootwrap/wrapper.py similarity index 99% rename from quantum/rootwrap/wrapper.py rename to neutron/rootwrap/wrapper.py index ebf10cf3bb..24977f9af6 100644 --- a/quantum/rootwrap/wrapper.py +++ b/neutron/rootwrap/wrapper.py @@ -22,7 +22,7 @@ import logging.handlers import os import string -from quantum.rootwrap import filters +from neutron.rootwrap import filters class NoFilterMatched(Exception): diff --git a/quantum/scheduler/__init__.py b/neutron/scheduler/__init__.py similarity index 93% rename from quantum/scheduler/__init__.py rename to neutron/scheduler/__init__.py index 7fc68d0669..b2660c90ff 100644 --- a/quantum/scheduler/__init__.py +++ b/neutron/scheduler/__init__.py @@ -20,11 +20,11 @@ from oslo.config import cfg AGENTS_SCHEDULER_OPTS = [ cfg.StrOpt('network_scheduler_driver', - default='quantum.scheduler.' + default='neutron.scheduler.' 'dhcp_agent_scheduler.ChanceScheduler', help=_('Driver to use for scheduling network to DHCP agent')), cfg.StrOpt('router_scheduler_driver', - default='quantum.scheduler.l3_agent_scheduler.ChanceScheduler', + default='neutron.scheduler.l3_agent_scheduler.ChanceScheduler', help=_('Driver to use for scheduling ' 'router to a default L3 agent')), cfg.BoolOpt('network_auto_schedule', default=True, diff --git a/quantum/scheduler/dhcp_agent_scheduler.py b/neutron/scheduler/dhcp_agent_scheduler.py similarity index 96% rename from quantum/scheduler/dhcp_agent_scheduler.py rename to neutron/scheduler/dhcp_agent_scheduler.py index 53496aff44..5134bca64c 100644 --- a/quantum/scheduler/dhcp_agent_scheduler.py +++ b/neutron/scheduler/dhcp_agent_scheduler.py @@ -19,10 +19,10 @@ import random from oslo.config import cfg -from quantum.common import constants -from quantum.db import agents_db -from quantum.db import agentschedulers_db -from quantum.openstack.common import log as logging +from neutron.common import constants +from neutron.db import agents_db +from neutron.db import agentschedulers_db +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/scheduler/l3_agent_scheduler.py b/neutron/scheduler/l3_agent_scheduler.py similarity index 97% rename from quantum/scheduler/l3_agent_scheduler.py rename to neutron/scheduler/l3_agent_scheduler.py index f7a477ff3f..027ee5b05f 100644 --- a/quantum/scheduler/l3_agent_scheduler.py +++ b/neutron/scheduler/l3_agent_scheduler.py @@ -20,11 +20,11 @@ import random from sqlalchemy.orm import exc from sqlalchemy.sql import exists -from quantum.common import constants -from quantum.db import agents_db -from quantum.db import agentschedulers_db -from quantum.db import l3_db -from quantum.openstack.common import log as logging +from neutron.common import constants +from neutron.db import agents_db +from neutron.db import agentschedulers_db +from neutron.db import l3_db +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/server/__init__.py b/neutron/server/__init__.py similarity index 81% rename from quantum/server/__init__.py rename to neutron/server/__init__.py index df9ba0fa6c..aedd1d428f 100755 --- a/quantum/server/__init__.py +++ b/neutron/server/__init__.py @@ -16,15 +16,15 @@ # License for the specific language governing permissions and limitations # under the License. -# If ../quantum/__init__.py exists, add ../ to Python search path, so that +# If ../neutron/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... import sys from oslo.config import cfg -from quantum.common import config -from quantum import service +from neutron.common import config +from neutron import service def main(): @@ -32,11 +32,11 @@ def main(): config.parse(sys.argv[1:]) if not cfg.CONF.config_file: sys.exit(_("ERROR: Unable to find configuration file via the default" - " search paths (~/.quantum/, ~/, /etc/quantum/, /etc/) and" + " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!")) try: - quantum_service = service.serve_wsgi(service.QuantumApiService) - quantum_service.wait() + neutron_service = service.serve_wsgi(service.NeutronApiService) + neutron_service.wait() except RuntimeError as e: sys.exit(_("ERROR: %s") % e) diff --git a/quantum/service.py b/neutron/service.py similarity index 88% rename from quantum/service.py rename to neutron/service.py index fb97cbd710..cb466fc886 100644 --- a/quantum/service.py +++ b/neutron/service.py @@ -22,17 +22,15 @@ import random from oslo.config import cfg -from quantum.common import config -from quantum import context -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import loopingcall -from quantum.openstack.common.rpc import service -from quantum import wsgi +from neutron.common import config +from neutron import context +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import loopingcall +from neutron.openstack.common.rpc import service +from neutron import wsgi -LOG = logging.getLogger(__name__) - service_opts = [ cfg.IntOpt('periodic_interval', default=40, @@ -69,12 +67,11 @@ class WsgiService(object): self.wsgi_app.wait() -class QuantumApiService(WsgiService): - """Class for quantum-api service.""" +class NeutronApiService(WsgiService): + """Class for neutron-api service.""" @classmethod - def create(cls): - app_name = "quantum" + def create(cls, app_name='neutron'): # Setup logging early, supplying both the CLI options and the # configuration mapping from the config file @@ -90,13 +87,18 @@ class QuantumApiService(WsgiService): def serve_wsgi(cls): - try: - service = cls.create() - except Exception: - LOG.exception(_('In WsgiService.create()')) - raise - service.start() + try: + try: + service = cls.create() + service.start() + except RuntimeError: + LOG.warn(_('Attempting fallback to old Quantum api-paste config')) + service = cls.create('quantum') + service.start() + except Exception: + LOG.exception(_('In serve_wsgi()')) + raise return service @@ -106,11 +108,11 @@ def _run_wsgi(app_name): if not app: LOG.error(_('No known API applications configured.')) return - server = wsgi.Server("Quantum") + server = wsgi.Server("Neutron") server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host) # Dump all option values here after all options are parsed cfg.CONF.log_opt_values(LOG, std_logging.DEBUG) - LOG.info(_("Quantum service started, listening on %(host)s:%(port)s"), + LOG.info(_("Neutron service started, listening on %(host)s:%(port)s"), {'host': cfg.CONF.bind_host, 'port': cfg.CONF.bind_port}) return server @@ -184,7 +186,7 @@ class Service(service.Service): if not binary: binary = os.path.basename(inspect.stack()[-1][1]) if not topic: - topic = binary.rpartition('quantum-')[2] + topic = binary.rpartition('neutron-')[2] topic = topic.replace("-", "_") if not manager: manager = CONF.get('%s_manager' % topic, None) @@ -231,5 +233,5 @@ class Service(service.Service): def report_state(self): """Update the state of this service.""" - # Todo(gongysh) report state to quantum server + # Todo(gongysh) report state to neutron server pass diff --git a/quantum/services/__init__.py b/neutron/services/__init__.py similarity index 100% rename from quantum/services/__init__.py rename to neutron/services/__init__.py diff --git a/quantum/services/loadbalancer/__init__.py b/neutron/services/loadbalancer/__init__.py similarity index 100% rename from quantum/services/loadbalancer/__init__.py rename to neutron/services/loadbalancer/__init__.py diff --git a/quantum/services/loadbalancer/constants.py b/neutron/services/loadbalancer/constants.py similarity index 100% rename from quantum/services/loadbalancer/constants.py rename to neutron/services/loadbalancer/constants.py diff --git a/quantum/services/loadbalancer/drivers/__init__.py b/neutron/services/loadbalancer/drivers/__init__.py similarity index 100% rename from quantum/services/loadbalancer/drivers/__init__.py rename to neutron/services/loadbalancer/drivers/__init__.py diff --git a/quantum/services/loadbalancer/drivers/abstract_driver.py b/neutron/services/loadbalancer/drivers/abstract_driver.py similarity index 100% rename from quantum/services/loadbalancer/drivers/abstract_driver.py rename to neutron/services/loadbalancer/drivers/abstract_driver.py diff --git a/quantum/services/loadbalancer/drivers/haproxy/__init__.py b/neutron/services/loadbalancer/drivers/haproxy/__init__.py similarity index 100% rename from quantum/services/loadbalancer/drivers/haproxy/__init__.py rename to neutron/services/loadbalancer/drivers/haproxy/__init__.py diff --git a/quantum/services/loadbalancer/drivers/haproxy/agent.py b/neutron/services/loadbalancer/drivers/haproxy/agent.py similarity index 82% rename from quantum/services/loadbalancer/drivers/haproxy/agent.py rename to neutron/services/loadbalancer/drivers/haproxy/agent.py index c098ef386e..9ea62b50e2 100644 --- a/quantum/services/loadbalancer/drivers/haproxy/agent.py +++ b/neutron/services/loadbalancer/drivers/haproxy/agent.py @@ -19,11 +19,12 @@ import eventlet from oslo.config import cfg -from quantum.agent.common import config -from quantum.agent.linux import interface -from quantum.openstack.common.rpc import service as rpc_service -from quantum.openstack.common import service -from quantum.services.loadbalancer.drivers.haproxy import ( +from neutron.agent.common import config +from neutron.agent.linux import interface +from neutron.common import legacy +from neutron.openstack.common.rpc import service as rpc_service +from neutron.openstack.common import service +from neutron.services.loadbalancer.drivers.haproxy import ( agent_manager as manager, plugin_driver ) @@ -56,7 +57,8 @@ def main(): cfg.CONF.register_opts(interface.OPTS) config.register_root_helper(cfg.CONF) - cfg.CONF(project='quantum') + cfg.CONF(project='neutron') + legacy.modernize_quantum_config(cfg.CONF) config.setup_logging(cfg.CONF) mgr = manager.LbaasAgentManager(cfg.CONF) diff --git a/quantum/services/loadbalancer/drivers/haproxy/agent_api.py b/neutron/services/loadbalancer/drivers/haproxy/agent_api.py similarity index 98% rename from quantum/services/loadbalancer/drivers/haproxy/agent_api.py rename to neutron/services/loadbalancer/drivers/haproxy/agent_api.py index cd4314d3dc..7990fd3ea9 100644 --- a/quantum/services/loadbalancer/drivers/haproxy/agent_api.py +++ b/neutron/services/loadbalancer/drivers/haproxy/agent_api.py @@ -16,7 +16,7 @@ # # @author: Mark McClain, DreamHost -from quantum.openstack.common.rpc import proxy +from neutron.openstack.common.rpc import proxy class LbaasAgentApi(proxy.RpcProxy): diff --git a/quantum/services/loadbalancer/drivers/haproxy/agent_manager.py b/neutron/services/loadbalancer/drivers/haproxy/agent_manager.py similarity index 95% rename from quantum/services/loadbalancer/drivers/haproxy/agent_manager.py rename to neutron/services/loadbalancer/drivers/haproxy/agent_manager.py index 626f859614..bea874dabb 100644 --- a/quantum/services/loadbalancer/drivers/haproxy/agent_manager.py +++ b/neutron/services/loadbalancer/drivers/haproxy/agent_manager.py @@ -20,12 +20,12 @@ import weakref from oslo.config import cfg -from quantum.agent.common import config -from quantum import context -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.openstack.common import periodic_task -from quantum.services.loadbalancer.drivers.haproxy import ( +from neutron.agent.common import config +from neutron import context +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.openstack.common import periodic_task +from neutron.services.loadbalancer.drivers.haproxy import ( agent_api, plugin_driver ) @@ -36,7 +36,7 @@ NS_PREFIX = 'qlbaas-' OPTS = [ cfg.StrOpt( 'device_driver', - default=('quantum.services.loadbalancer.drivers' + default=('neutron.services.loadbalancer.drivers' '.haproxy.namespace_driver.HaproxyNSDriver'), help=_('The driver used to manage the loadbalancing device'), ), diff --git a/quantum/services/loadbalancer/drivers/haproxy/cfg.py b/neutron/services/loadbalancer/drivers/haproxy/cfg.py similarity index 97% rename from quantum/services/loadbalancer/drivers/haproxy/cfg.py rename to neutron/services/loadbalancer/drivers/haproxy/cfg.py index 718a3d4f2f..18c40cff93 100644 --- a/quantum/services/loadbalancer/drivers/haproxy/cfg.py +++ b/neutron/services/loadbalancer/drivers/haproxy/cfg.py @@ -20,9 +20,9 @@ import itertools from oslo.config import cfg -from quantum.agent.linux import utils -from quantum.plugins.common import constants as qconstants -from quantum.services.loadbalancer import constants +from neutron.agent.linux import utils +from neutron.plugins.common import constants as qconstants +from neutron.services.loadbalancer import constants PROTOCOL_MAP = { diff --git a/quantum/services/loadbalancer/drivers/haproxy/namespace_driver.py b/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py similarity index 97% rename from quantum/services/loadbalancer/drivers/haproxy/namespace_driver.py rename to neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py index 30c556c504..719f5e161b 100644 --- a/quantum/services/loadbalancer/drivers/haproxy/namespace_driver.py +++ b/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py @@ -21,11 +21,11 @@ import socket import netaddr -from quantum.agent.linux import ip_lib -from quantum.agent.linux import utils -from quantum.common import exceptions -from quantum.openstack.common import log as logging -from quantum.services.loadbalancer.drivers.haproxy import cfg as hacfg +from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils +from neutron.common import exceptions +from neutron.openstack.common import log as logging +from neutron.services.loadbalancer.drivers.haproxy import cfg as hacfg LOG = logging.getLogger(__name__) NS_PREFIX = 'qlbaas-' diff --git a/quantum/services/loadbalancer/drivers/haproxy/plugin_driver.py b/neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py similarity index 95% rename from quantum/services/loadbalancer/drivers/haproxy/plugin_driver.py rename to neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py index 3a8f19cfde..cf27dfdd74 100644 --- a/quantum/services/loadbalancer/drivers/haproxy/plugin_driver.py +++ b/neutron/services/loadbalancer/drivers/haproxy/plugin_driver.py @@ -20,14 +20,14 @@ import uuid from oslo.config import cfg -from quantum.common import exceptions as q_exc -from quantum.common import rpc as q_rpc -from quantum.db.loadbalancer import loadbalancer_db -from quantum.openstack.common import log as logging -from quantum.openstack.common import rpc -from quantum.openstack.common.rpc import proxy -from quantum.plugins.common import constants -from quantum.services.loadbalancer.drivers import abstract_driver +from neutron.common import exceptions as q_exc +from neutron.common import rpc as q_rpc +from neutron.db.loadbalancer import loadbalancer_db +from neutron.openstack.common import log as logging +from neutron.openstack.common import rpc +from neutron.openstack.common.rpc import proxy +from neutron.plugins.common import constants +from neutron.services.loadbalancer.drivers import abstract_driver LOG = logging.getLogger(__name__) @@ -138,7 +138,7 @@ class LoadBalancerCallbacks(object): return port['admin_state_up'] = True - port['device_owner'] = 'quantum:' + constants.LOADBALANCER + port['device_owner'] = 'neutron:' + constants.LOADBALANCER port['device_id'] = str(uuid.uuid5(uuid.NAMESPACE_DNS, str(host))) self.plugin._core_plugin.update_port( diff --git a/quantum/services/loadbalancer/drivers/noop/__init__.py b/neutron/services/loadbalancer/drivers/noop/__init__.py similarity index 100% rename from quantum/services/loadbalancer/drivers/noop/__init__.py rename to neutron/services/loadbalancer/drivers/noop/__init__.py diff --git a/quantum/services/loadbalancer/drivers/noop/noop_driver.py b/neutron/services/loadbalancer/drivers/noop/noop_driver.py similarity index 96% rename from quantum/services/loadbalancer/drivers/noop/noop_driver.py rename to neutron/services/loadbalancer/drivers/noop/noop_driver.py index 5ce2e0a13d..baede07d74 100644 --- a/quantum/services/loadbalancer/drivers/noop/noop_driver.py +++ b/neutron/services/loadbalancer/drivers/noop/noop_driver.py @@ -17,8 +17,8 @@ # @author: Avishay Balderman, Radware -from quantum.openstack.common import log as logging -from quantum.services.loadbalancer.drivers import ( +from neutron.openstack.common import log as logging +from neutron.services.loadbalancer.drivers import ( abstract_driver ) diff --git a/quantum/services/loadbalancer/plugin.py b/neutron/services/loadbalancer/plugin.py similarity index 94% rename from quantum/services/loadbalancer/plugin.py rename to neutron/services/loadbalancer/plugin.py index 1db138d83f..a2d9301703 100644 --- a/quantum/services/loadbalancer/plugin.py +++ b/neutron/services/loadbalancer/plugin.py @@ -17,15 +17,15 @@ from oslo.config import cfg -from quantum.db import api as qdbapi -from quantum.db.loadbalancer import loadbalancer_db -from quantum.openstack.common import importutils -from quantum.openstack.common import log as logging -from quantum.plugins.common import constants +from neutron.db import api as qdbapi +from neutron.db.loadbalancer import loadbalancer_db +from neutron.openstack.common import importutils +from neutron.openstack.common import log as logging +from neutron.plugins.common import constants LOG = logging.getLogger(__name__) -DEFAULT_DRIVER = ("quantum.services.loadbalancer.drivers.haproxy" +DEFAULT_DRIVER = ("neutron.services.loadbalancer.drivers.haproxy" ".plugin_driver.HaproxyOnHostPluginDriver") lbaas_plugin_opts = [ @@ -39,7 +39,7 @@ cfg.CONF.register_opts(lbaas_plugin_opts, "LBAAS") class LoadBalancerPlugin(loadbalancer_db.LoadBalancerPluginDb): - """Implementation of the Quantum Loadbalancer Service Plugin. + """Implementation of the Neutron Loadbalancer Service Plugin. This class manages the workflow of LBaaS request/response. Most DB related works are implemented in class @@ -60,7 +60,8 @@ class LoadBalancerPlugin(loadbalancer_db.LoadBalancerPluginDb): """ try: self.driver = importutils.import_object( - cfg.CONF.LBAAS.driver_fqn, self) + cfg.CONF.LBAAS.driver_fqn, self + ) except ImportError: LOG.exception(_("Error loading LBaaS driver %s"), cfg.CONF.LBAAS.driver_fqn) @@ -69,7 +70,7 @@ class LoadBalancerPlugin(loadbalancer_db.LoadBalancerPluginDb): return constants.LOADBALANCER def get_plugin_description(self): - return "Quantum LoadBalancer Service Plugin" + return "Neutron LoadBalancer Service Plugin" def create_vip(self, context, vip): v = super(LoadBalancerPlugin, self).create_vip(context, vip) diff --git a/quantum/services/service_base.py b/neutron/services/service_base.py similarity index 94% rename from quantum/services/service_base.py rename to neutron/services/service_base.py index 998a2e8bb0..a4d113c82d 100644 --- a/quantum/services/service_base.py +++ b/neutron/services/service_base.py @@ -17,7 +17,7 @@ import abc -from quantum.api import extensions +from neutron.api import extensions class ServicePluginBase(extensions.PluginInterface): @@ -29,7 +29,7 @@ class ServicePluginBase(extensions.PluginInterface): def get_plugin_type(self): """Return one of predefined service types. - See quantum/plugins/common/constants.py + See neutron/plugins/common/constants.py """ pass diff --git a/quantum/tests/__init__.py b/neutron/tests/__init__.py similarity index 100% rename from quantum/tests/__init__.py rename to neutron/tests/__init__.py diff --git a/quantum/tests/base.py b/neutron/tests/base.py similarity index 98% rename from quantum/tests/base.py rename to neutron/tests/base.py index 90537b8f70..3829b55121 100644 --- a/quantum/tests/base.py +++ b/neutron/tests/base.py @@ -25,7 +25,7 @@ from oslo.config import cfg import stubout import testtools -from quantum.openstack.common import exception +from neutron.openstack.common import exception CONF = cfg.CONF TRUE_STRING = ['True', '1'] diff --git a/quantum/tests/etc/api-paste.ini.test b/neutron/tests/etc/api-paste.ini.test similarity index 55% rename from quantum/tests/etc/api-paste.ini.test rename to neutron/tests/etc/api-paste.ini.test index 5a17e83978..664c309499 100644 --- a/quantum/tests/etc/api-paste.ini.test +++ b/neutron/tests/etc/api-paste.ini.test @@ -2,7 +2,7 @@ pipeline = extensions extensions_test_app [filter:extensions] -paste.filter_factory = quantum.common.extensions:plugin_aware_extension_middleware_factory +paste.filter_factory = neutron.common.extensions:plugin_aware_extension_middleware_factory [app:extensions_test_app] -paste.app_factory = quantum.tests.unit.test_extensions:app_factory +paste.app_factory = neutron.tests.unit.test_extensions:app_factory diff --git a/quantum/tests/etc/quantum.conf.test b/neutron/tests/etc/neutron.conf.test similarity index 83% rename from quantum/tests/etc/quantum.conf.test rename to neutron/tests/etc/neutron.conf.test index b37a83d3ad..c91a745f63 100644 --- a/quantum/tests/etc/quantum.conf.test +++ b/neutron/tests/etc/neutron.conf.test @@ -18,7 +18,7 @@ api_extensions_path = unit/extensions api_paste_config = api-paste.ini.test # The messaging module to use, defaults to kombu. -rpc_backend = quantum.openstack.common.rpc.impl_fake +rpc_backend = neutron.openstack.common.rpc.impl_fake lock_path = $state_path/lock @@ -27,5 +27,5 @@ connection = 'sqlite://' [default_servicetype] description = "default service type" -service_definition=dummy:quantum.tests.unit.dummy_plugin.QuantumDummyPlugin +service_definition=dummy:neutron.tests.unit.dummy_plugin.NeutronDummyPlugin diff --git a/quantum/tests/etc/rootwrap.d/quantum.test.filters b/neutron/tests/etc/rootwrap.d/quantum.test.filters similarity index 66% rename from quantum/tests/etc/rootwrap.d/quantum.test.filters rename to neutron/tests/etc/rootwrap.d/quantum.test.filters index dc02011c5c..48fa6da896 100644 --- a/quantum/tests/etc/rootwrap.d/quantum.test.filters +++ b/neutron/tests/etc/rootwrap.d/quantum.test.filters @@ -1,6 +1,6 @@ -# quantum-rootwrap command filters for the unit test +# neutron-rootwrap command filters for the unit test -# this file goes with quantum/tests/unit/_test_rootwrap_exec.py. +# this file goes with neutron/tests/unit/_test_rootwrap_exec.py. # See the comments there about how to run that unit tests # format seems to be diff --git a/quantum/tests/unit/__init__.py b/neutron/tests/unit/__init__.py similarity index 100% rename from quantum/tests/unit/__init__.py rename to neutron/tests/unit/__init__.py diff --git a/quantum/tests/unit/_test_extension_portbindings.py b/neutron/tests/unit/_test_extension_portbindings.py similarity index 90% rename from quantum/tests/unit/_test_extension_portbindings.py rename to neutron/tests/unit/_test_extension_portbindings.py index 57a1afd900..ae41fdb6c5 100644 --- a/quantum/tests/unit/_test_extension_portbindings.py +++ b/neutron/tests/unit/_test_extension_portbindings.py @@ -23,13 +23,13 @@ import contextlib from oslo.config import cfg from webob import exc -from quantum import context -from quantum.extensions import portbindings -from quantum.manager import QuantumManager -from quantum.tests.unit import test_db_plugin +from neutron import context +from neutron.extensions import portbindings +from neutron.manager import NeutronManager +from neutron.tests.unit import test_db_plugin -class PortBindingsTestCase(test_db_plugin.QuantumDbPluginV2TestCase): +class PortBindingsTestCase(test_db_plugin.NeutronDbPluginV2TestCase): # VIF_TYPE must be overridden according to plugin vif_type VIF_TYPE = portbindings.VIF_TYPE_OTHER @@ -55,7 +55,7 @@ class PortBindingsTestCase(test_db_plugin.QuantumDbPluginV2TestCase): self._check_response_portbindings(port['port']) # Check a response of get_port ctx = context.get_admin_context() - port = self._show('ports', port_id, quantum_context=ctx)['port'] + port = self._show('ports', port_id, neutron_context=ctx)['port'] self._check_response_portbindings(port) # By default user is admin - now test non admin user ctx = context.Context(user_id=None, @@ -63,11 +63,11 @@ class PortBindingsTestCase(test_db_plugin.QuantumDbPluginV2TestCase): is_admin=False, read_deleted="no") non_admin_port = self._show( - 'ports', port_id, quantum_context=ctx)['port'] + 'ports', port_id, neutron_context=ctx)['port'] self._check_response_no_portbindings(non_admin_port) def test_ports_vif_details(self): - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() cfg.CONF.set_default('allow_overlapping_ips', True) with contextlib.nested(self.port(), self.port()): ctx = context.get_admin_context() @@ -80,7 +80,7 @@ class PortBindingsTestCase(test_db_plugin.QuantumDbPluginV2TestCase): tenant_id=self._tenant_id, is_admin=False, read_deleted="no") - ports = self._list('ports', quantum_context=ctx)['ports'] + ports = self._list('ports', neutron_context=ctx)['ports'] self.assertEqual(len(ports), 2) for non_admin_port in ports: self._check_response_no_portbindings(non_admin_port) @@ -122,7 +122,7 @@ class PortBindingsHostTestCaseMixin(object): self._check_response_portbindings_host(port['port']) # Check a response of get_port ctx = context.get_admin_context() - port = self._show('ports', port_id, quantum_context=ctx)['port'] + port = self._show('ports', port_id, neutron_context=ctx)['port'] self._check_response_portbindings_host(port) # By default user is admin - now test non admin user ctx = context.Context(user_id=None, @@ -130,7 +130,7 @@ class PortBindingsHostTestCaseMixin(object): is_admin=False, read_deleted="no") non_admin_port = self._show( - 'ports', port_id, quantum_context=ctx)['port'] + 'ports', port_id, neutron_context=ctx)['port'] self._check_response_no_portbindings_host(non_admin_port) def test_ports_vif_host(self): @@ -142,7 +142,7 @@ class PortBindingsHostTestCaseMixin(object): **host_arg), self.port(name='name2')): ctx = context.get_admin_context() - ports = self._list('ports', quantum_context=ctx)['ports'] + ports = self._list('ports', neutron_context=ctx)['ports'] self.assertEqual(2, len(ports)) for port in ports: if port['name'] == 'name1': @@ -154,7 +154,7 @@ class PortBindingsHostTestCaseMixin(object): tenant_id=self._tenant_id, is_admin=False, read_deleted="no") - ports = self._list('ports', quantum_context=ctx)['ports'] + ports = self._list('ports', neutron_context=ctx)['ports'] self.assertEqual(2, len(ports)) for non_admin_port in ports: self._check_response_no_portbindings_host(non_admin_port) @@ -173,7 +173,7 @@ class PortBindingsHostTestCaseMixin(object): req = self.new_update_request('ports', data, port2['port']['id']) ctx = context.get_admin_context() req.get_response(self.api) - ports = self._list('ports', quantum_context=ctx)['ports'] + ports = self._list('ports', neutron_context=ctx)['ports'] self.assertEqual(2, len(ports)) for port in ports: self.assertEqual('testhosttemp', port[portbindings.HOST_ID]) diff --git a/quantum/tests/unit/_test_rootwrap_exec.py b/neutron/tests/unit/_test_rootwrap_exec.py similarity index 92% rename from quantum/tests/unit/_test_rootwrap_exec.py rename to neutron/tests/unit/_test_rootwrap_exec.py index 165bb1f5e2..a26104e401 100644 --- a/quantum/tests/unit/_test_rootwrap_exec.py +++ b/neutron/tests/unit/_test_rootwrap_exec.py @@ -19,9 +19,9 @@ import os import fixtures -from quantum.agent.linux import utils -from quantum.openstack.common import log as logging -from quantum.tests import base +from neutron.agent.linux import utils +from neutron.openstack.common import log as logging +from neutron.tests import base LOG = logging.getLogger(__name__) @@ -63,10 +63,10 @@ to the aid of their party.\"\n") "generated by test_rootwrap.py\n") f.write("[DEFAULT]\n") f.write("filters_path=" + self.cwd + - "/quantum/tests/etc/rootwrap.d/") + "/neutron/tests/etc/rootwrap.d/") # now set the root helper to sudo our rootwrap script, # with the new conf - self.root_helper = "sudo " + self.cwd + "/bin/quantum-rootwrap " + self.root_helper = "sudo " + self.cwd + "/bin/neutron-rootwrap " self.root_helper += self.conf_file def runTest(self): diff --git a/quantum/tests/unit/bigswitch/__init__.py b/neutron/tests/unit/bigswitch/__init__.py similarity index 100% rename from quantum/tests/unit/bigswitch/__init__.py rename to neutron/tests/unit/bigswitch/__init__.py diff --git a/quantum/tests/unit/bigswitch/etc/restproxy.ini.test b/neutron/tests/unit/bigswitch/etc/restproxy.ini.test similarity index 100% rename from quantum/tests/unit/bigswitch/etc/restproxy.ini.test rename to neutron/tests/unit/bigswitch/etc/restproxy.ini.test diff --git a/quantum/tests/unit/bigswitch/test_restproxy_plugin.py b/neutron/tests/unit/bigswitch/test_restproxy_plugin.py similarity index 91% rename from quantum/tests/unit/bigswitch/test_restproxy_plugin.py rename to neutron/tests/unit/bigswitch/test_restproxy_plugin.py index f6c99c0d04..920d02a9b5 100644 --- a/quantum/tests/unit/bigswitch/test_restproxy_plugin.py +++ b/neutron/tests/unit/bigswitch/test_restproxy_plugin.py @@ -21,14 +21,14 @@ from mock import patch from oslo.config import cfg import webob.exc -import quantum.common.test_lib as test_lib -from quantum.extensions import portbindings -from quantum.manager import QuantumManager -from quantum.tests.unit import _test_extension_portbindings as test_bindings -import quantum.tests.unit.test_db_plugin as test_plugin +import neutron.common.test_lib as test_lib +from neutron.extensions import portbindings +from neutron.manager import NeutronManager +from neutron.tests.unit import _test_extension_portbindings as test_bindings +import neutron.tests.unit.test_db_plugin as test_plugin -RESTPROXY_PKG_PATH = 'quantum.plugins.bigswitch.plugin' +RESTPROXY_PKG_PATH = 'neutron.plugins.bigswitch.plugin' class HTTPResponseMock(): @@ -58,9 +58,9 @@ class HTTPConnectionMock(): pass -class BigSwitchProxyPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class BigSwitchProxyPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): - _plugin_name = ('%s.QuantumRestProxyV2' % RESTPROXY_PKG_PATH) + _plugin_name = ('%s.NeutronRestProxyV2' % RESTPROXY_PKG_PATH) def setUp(self): etc_path = os.path.join(os.path.dirname(__file__), 'etc') @@ -171,6 +171,6 @@ class TestBigSwitchProxySubnetsV2(test_plugin.TestSubnetsV2, class TestBigSwitchProxySync(BigSwitchProxyPluginV2TestCase): def test_send_data(self): - plugin_obj = QuantumManager.get_plugin() + plugin_obj = NeutronManager.get_plugin() result = plugin_obj._send_all_data() self.assertEqual(result[0], 200) diff --git a/quantum/tests/unit/bigswitch/test_router_db.py b/neutron/tests/unit/bigswitch/test_router_db.py similarity index 97% rename from quantum/tests/unit/bigswitch/test_router_db.py rename to neutron/tests/unit/bigswitch/test_router_db.py index f9a6da1863..a5d16068be 100644 --- a/quantum/tests/unit/bigswitch/test_router_db.py +++ b/neutron/tests/unit/bigswitch/test_router_db.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. # -# Adapted from quantum.tests.unit.test_l3_plugin +# Adapted from neutron.tests.unit.test_l3_plugin # @author: Sumit Naiksatam, sumitnaiksatam@gmail.com # @@ -25,18 +25,18 @@ from mock import patch from oslo.config import cfg from webob import exc -from quantum.common.test_lib import test_config -from quantum.extensions import l3 -from quantum.manager import QuantumManager -from quantum.openstack.common.notifier import api as notifier_api -from quantum.openstack.common.notifier import test_notifier -from quantum.plugins.bigswitch.extensions import routerrule -from quantum.tests.unit import test_l3_plugin +from neutron.common.test_lib import test_config +from neutron.extensions import l3 +from neutron.manager import NeutronManager +from neutron.openstack.common.notifier import api as notifier_api +from neutron.openstack.common.notifier import test_notifier +from neutron.plugins.bigswitch.extensions import routerrule +from neutron.tests.unit import test_l3_plugin def new_L3_setUp(self): test_config['plugin_name_v2'] = ( - 'quantum.plugins.bigswitch.plugin.QuantumRestProxyV2') + 'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2') etc_path = os.path.join(os.path.dirname(__file__), 'etc') rp_conf_file = os.path.join(etc_path, 'restproxy.ini.test') test_config['config_files'] = [rp_conf_file] @@ -102,7 +102,7 @@ class RouterDBTestCase(test_l3_plugin.L3NatDBTestCase): self.httpPatch.start() test_l3_plugin.L3NatDBTestCase.setUp = new_L3_setUp super(RouterDBTestCase, self).setUp() - self.plugin_obj = QuantumManager.get_plugin() + self.plugin_obj = NeutronManager.get_plugin() def tearDown(self): self.httpPatch.stop() @@ -158,7 +158,7 @@ class RouterDBTestCase(test_l3_plugin.L3NatDBTestCase): def test_floatingip_with_invalid_create_port(self): self._test_floatingip_with_invalid_create_port( - 'quantum.plugins.bigswitch.plugin.QuantumRestProxyV2') + 'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2') def test_create_floatingip_no_ext_gateway_return_404(self): with self.subnet(cidr='10.0.10.0/24') as public_sub: @@ -258,7 +258,7 @@ class RouterDBTestCase(test_l3_plugin.L3NatDBTestCase): def test_send_data(self): fmt = 'json' - plugin_obj = QuantumManager.get_plugin() + plugin_obj = NeutronManager.get_plugin() with self.router() as r: r_id = r['router']['id'] diff --git a/quantum/tests/unit/brocade/__init__.py b/neutron/tests/unit/brocade/__init__.py similarity index 100% rename from quantum/tests/unit/brocade/__init__.py rename to neutron/tests/unit/brocade/__init__.py diff --git a/quantum/tests/unit/brocade/test_brocade_db.py b/neutron/tests/unit/brocade/test_brocade_db.py similarity index 94% rename from quantum/tests/unit/brocade/test_brocade_db.py rename to neutron/tests/unit/brocade/test_brocade_db.py index 88e1e3fc1c..68702529e5 100644 --- a/quantum/tests/unit/brocade/test_brocade_db.py +++ b/neutron/tests/unit/brocade/test_brocade_db.py @@ -21,14 +21,14 @@ Unit test brocade db. """ import uuid -from quantum import context -from quantum.plugins.brocade.db import models as brocade_db -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron import context +from neutron.plugins.brocade.db import models as brocade_db +from neutron.tests.unit import test_db_plugin as test_plugin TEST_VLAN = 1000 -class TestBrocadeDb(test_plugin.QuantumDbPluginV2TestCase): +class TestBrocadeDb(test_plugin.NeutronDbPluginV2TestCase): """Test brocade db functionality.""" def test_create_network(self): diff --git a/quantum/tests/unit/brocade/test_brocade_plugin.py b/neutron/tests/unit/brocade/test_brocade_plugin.py similarity index 80% rename from quantum/tests/unit/brocade/test_brocade_plugin.py rename to neutron/tests/unit/brocade/test_brocade_plugin.py index 58d847394c..0e3a6ef69d 100644 --- a/quantum/tests/unit/brocade/test_brocade_plugin.py +++ b/neutron/tests/unit/brocade/test_brocade_plugin.py @@ -16,16 +16,16 @@ import mock -from quantum.extensions import portbindings -from quantum.openstack.common import importutils -from quantum.plugins.brocade import QuantumPlugin as brocade_plugin -from quantum.tests.unit import _test_extension_portbindings as test_bindings -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.extensions import portbindings +from neutron.openstack.common import importutils +from neutron.plugins.brocade import NeutronPlugin as brocade_plugin +from neutron.tests.unit import _test_extension_portbindings as test_bindings +from neutron.tests.unit import test_db_plugin as test_plugin -PLUGIN_NAME = ('quantum.plugins.brocade.' - 'QuantumPlugin.BrocadePluginV2') -NOS_DRIVER = ('quantum.plugins.brocade.' +PLUGIN_NAME = ('neutron.plugins.brocade.' + 'NeutronPlugin.BrocadePluginV2') +NOS_DRIVER = ('neutron.plugins.brocade.' 'nos.fake_nosdriver.NOSdriver') FAKE_IPADDRESS = '2.2.2.2' FAKE_USERNAME = 'user' @@ -33,7 +33,7 @@ FAKE_PASSWORD = 'password' FAKE_PHYSICAL_INTERFACE = 'em1' -class BrocadePluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class BrocadePluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): _plugin_name = PLUGIN_NAME def setUp(self): diff --git a/quantum/tests/unit/brocade/test_brocade_vlan.py b/neutron/tests/unit/brocade/test_brocade_vlan.py similarity index 92% rename from quantum/tests/unit/brocade/test_brocade_vlan.py rename to neutron/tests/unit/brocade/test_brocade_vlan.py index 26eaa4ec09..b5a0c33f68 100644 --- a/quantum/tests/unit/brocade/test_brocade_vlan.py +++ b/neutron/tests/unit/brocade/test_brocade_vlan.py @@ -20,10 +20,10 @@ Test vlans alloc/dealloc. """ -from quantum.db import api as db -from quantum.openstack.common import context -from quantum.plugins.brocade import vlanbm as vlan_bitmap -from quantum.tests import base +from neutron.db import api as db +from neutron.openstack.common import context +from neutron.plugins.brocade import vlanbm as vlan_bitmap +from neutron.tests import base class TestVlanBitmap(base.BaseTestCase): diff --git a/quantum/tests/unit/cisco/__init__.py b/neutron/tests/unit/cisco/__init__.py similarity index 100% rename from quantum/tests/unit/cisco/__init__.py rename to neutron/tests/unit/cisco/__init__.py diff --git a/quantum/tests/unit/cisco/test_network_plugin.py b/neutron/tests/unit/cisco/test_network_plugin.py similarity index 95% rename from quantum/tests/unit/cisco/test_network_plugin.py rename to neutron/tests/unit/cisco/test_network_plugin.py index 59168aa631..42118240bf 100644 --- a/quantum/tests/unit/cisco/test_network_plugin.py +++ b/neutron/tests/unit/cisco/test_network_plugin.py @@ -20,27 +20,27 @@ import mock import webob.exc as wexc -from quantum.api.v2 import base -from quantum.common import exceptions as q_exc -from quantum import context -from quantum.db import db_base_plugin_v2 as base_plugin -from quantum.db import l3_db -from quantum.manager import QuantumManager -from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_exceptions as c_exc -from quantum.plugins.cisco.common import config as cisco_config -from quantum.plugins.cisco.db import nexus_db_v2 -from quantum.plugins.cisco.models import virt_phy_sw_v2 -from quantum.plugins.openvswitch.common import config as ovs_config -from quantum.plugins.openvswitch import ovs_db_v2 -from quantum.tests.unit import test_db_plugin +from neutron.api.v2 import base +from neutron.common import exceptions as q_exc +from neutron import context +from neutron.db import db_base_plugin_v2 as base_plugin +from neutron.db import l3_db +from neutron.manager import NeutronManager +from neutron.plugins.cisco.common import cisco_constants as const +from neutron.plugins.cisco.common import cisco_exceptions as c_exc +from neutron.plugins.cisco.common import config as cisco_config +from neutron.plugins.cisco.db import nexus_db_v2 +from neutron.plugins.cisco.models import virt_phy_sw_v2 +from neutron.plugins.openvswitch.common import config as ovs_config +from neutron.plugins.openvswitch import ovs_db_v2 +from neutron.tests.unit import test_db_plugin LOG = logging.getLogger(__name__) -class CiscoNetworkPluginV2TestCase(test_db_plugin.QuantumDbPluginV2TestCase): +class CiscoNetworkPluginV2TestCase(test_db_plugin.NeutronDbPluginV2TestCase): - _plugin_name = 'quantum.plugins.cisco.network_plugin.PluginV2' + _plugin_name = 'neutron.plugins.cisco.network_plugin.PluginV2' def setUp(self): # Use a mock netconf client @@ -54,7 +54,7 @@ class CiscoNetworkPluginV2TestCase(test_db_plugin.QuantumDbPluginV2TestCase): self.addCleanup(self.patch_obj.stop) def _get_plugin_ref(self): - plugin_obj = QuantumManager.get_plugin() + plugin_obj = NeutronManager.get_plugin() if getattr(plugin_obj, "_master"): plugin_ref = plugin_obj else: @@ -79,7 +79,7 @@ class TestCiscoPortsV2(CiscoNetworkPluginV2TestCase, test_db_plugin.TestPortsV2): def setUp(self): - """Configure for end-to-end quantum testing using a mock ncclient. + """Configure for end-to-end neutron testing using a mock ncclient. This setup includes: - Configure the OVS plugin to use VLANs in the range of 1000-1100. @@ -94,7 +94,7 @@ class TestCiscoPortsV2(CiscoNetworkPluginV2TestCase, self.vlan_end = 1100 range_str = 'physnet1:%d:%d' % (self.vlan_start, self.vlan_end) - nexus_driver = ('quantum.plugins.cisco.nexus.' + nexus_driver = ('neutron.plugins.cisco.nexus.' 'cisco_nexus_network_driver_v2.CiscoNEXUSDriver') config = { @@ -184,7 +184,7 @@ class TestCiscoPortsV2(CiscoNetworkPluginV2TestCase, """Confirm that an HTTP status corresponds to an expected exception. Confirm that an HTTP status which has been returned for an - quantum API request matches the HTTP status corresponding + neutron API request matches the HTTP status corresponding to an expected exception. :param status: HTTP status @@ -445,7 +445,7 @@ class TestCiscoPortsV2(CiscoNetworkPluginV2TestCase, self._assertExpectedHTTP(res.status_int, inserted_exc) # Check that the port still has the original device ID - plugin = base_plugin.QuantumDbPluginV2() + plugin = base_plugin.NeutronDbPluginV2() ctx = context.get_admin_context() db_port = plugin._get_port(ctx, port_id) self.assertEqual(db_port['device_id'], diff --git a/quantum/tests/unit/cisco/test_nexus_plugin.py b/neutron/tests/unit/cisco/test_nexus_plugin.py similarity index 94% rename from quantum/tests/unit/cisco/test_nexus_plugin.py rename to neutron/tests/unit/cisco/test_nexus_plugin.py index 8c1f07d9ec..cbcbd66c62 100644 --- a/quantum/tests/unit/cisco/test_nexus_plugin.py +++ b/neutron/tests/unit/cisco/test_nexus_plugin.py @@ -15,12 +15,12 @@ import mock -from quantum.db import api as db -from quantum.openstack.common import importutils -from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_exceptions as cisco_exc -from quantum.plugins.cisco.nexus import cisco_nexus_plugin_v2 -from quantum.tests import base +from neutron.db import api as db +from neutron.openstack.common import importutils +from neutron.plugins.cisco.common import cisco_constants as const +from neutron.plugins.cisco.common import cisco_exceptions as cisco_exc +from neutron.plugins.cisco.nexus import cisco_nexus_plugin_v2 +from neutron.tests import base NEXUS_IP_ADDRESS = '1.1.1.1' @@ -30,7 +30,7 @@ HOSTNAME = 'testhost' INSTANCE = 'testvm' NEXUS_PORTS = '1/10' NEXUS_SSH_PORT = '22' -NEXUS_DRIVER = ('quantum.plugins.cisco.nexus.' +NEXUS_DRIVER = ('neutron.plugins.cisco.nexus.' 'cisco_nexus_network_driver_v2.CiscoNEXUSDriver') diff --git a/quantum/tests/unit/database_stubs.py b/neutron/tests/unit/database_stubs.py similarity index 97% rename from quantum/tests/unit/database_stubs.py rename to neutron/tests/unit/database_stubs.py index 18fa77d12f..0b2a3dc06b 100644 --- a/quantum/tests/unit/database_stubs.py +++ b/neutron/tests/unit/database_stubs.py @@ -19,15 +19,15 @@ """stubs.py provides interface methods for the database test cases""" -from quantum.db import api as db -from quantum.openstack.common import log as logging +from neutron.db import api as db +from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) -class QuantumDB(object): - """Class conisting of methods to call Quantum db methods.""" +class NeutronDB(object): + """Class conisting of methods to call Neutron db methods.""" def get_all_networks(self, tenant_id): """Get all networks.""" nets = [] diff --git a/quantum/tests/unit/db/__init__.py b/neutron/tests/unit/db/__init__.py similarity index 100% rename from quantum/tests/unit/db/__init__.py rename to neutron/tests/unit/db/__init__.py diff --git a/quantum/tests/unit/db/loadbalancer/__init__.py b/neutron/tests/unit/db/loadbalancer/__init__.py similarity index 100% rename from quantum/tests/unit/db/loadbalancer/__init__.py rename to neutron/tests/unit/db/loadbalancer/__init__.py diff --git a/quantum/tests/unit/db/loadbalancer/test_db_loadbalancer.py b/neutron/tests/unit/db/loadbalancer/test_db_loadbalancer.py similarity index 98% rename from quantum/tests/unit/db/loadbalancer/test_db_loadbalancer.py rename to neutron/tests/unit/db/loadbalancer/test_db_loadbalancer.py index cd91529208..750441f2cb 100644 --- a/quantum/tests/unit/db/loadbalancer/test_db_loadbalancer.py +++ b/neutron/tests/unit/db/loadbalancer/test_db_loadbalancer.py @@ -20,38 +20,38 @@ import testtools import webob.exc -from quantum.api.extensions import ExtensionMiddleware -from quantum.api.extensions import PluginAwareExtensionManager -from quantum.common import config -from quantum import context -from quantum.db.loadbalancer import loadbalancer_db as ldb -import quantum.extensions -from quantum.extensions import loadbalancer -from quantum.plugins.common import constants -from quantum.services.loadbalancer import ( +from neutron.api.extensions import ExtensionMiddleware +from neutron.api.extensions import PluginAwareExtensionManager +from neutron.common import config +from neutron import context +from neutron.db.loadbalancer import loadbalancer_db as ldb +import neutron.extensions +from neutron.extensions import loadbalancer +from neutron.plugins.common import constants +from neutron.services.loadbalancer import ( plugin as loadbalancer_plugin ) -from quantum.tests.unit import test_db_plugin +from neutron.tests.unit import test_db_plugin LOG = logging.getLogger(__name__) -DB_CORE_PLUGIN_KLASS = 'quantum.db.db_base_plugin_v2.QuantumDbPluginV2' +DB_CORE_PLUGIN_KLASS = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' DB_LB_PLUGIN_KLASS = ( - "quantum.services.loadbalancer." + "neutron.services.loadbalancer." "plugin.LoadBalancerPlugin" ) ROOTDIR = os.path.dirname(__file__) + '../../../..' ETCDIR = os.path.join(ROOTDIR, 'etc') -extensions_path = ':'.join(quantum.extensions.__path__) +extensions_path = ':'.join(neutron.extensions.__path__) def etcdir(*p): return os.path.join(ETCDIR, *p) -class LoadBalancerPluginDbTestCase(test_db_plugin.QuantumDbPluginV2TestCase): +class LoadBalancerPluginDbTestCase(test_db_plugin.NeutronDbPluginV2TestCase): resource_prefix_map = dict( (k, constants.COMMON_PREFIXES[constants.LOADBALANCER]) for k in loadbalancer.RESOURCE_ATTRIBUTE_MAP.keys() diff --git a/quantum/tests/unit/dummy_plugin.py b/neutron/tests/unit/dummy_plugin.py similarity index 88% rename from quantum/tests/unit/dummy_plugin.py rename to neutron/tests/unit/dummy_plugin.py index c0e8076522..8a1f4a757a 100644 --- a/quantum/tests/unit/dummy_plugin.py +++ b/neutron/tests/unit/dummy_plugin.py @@ -15,15 +15,15 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.api import extensions -from quantum.api.v2 import base -from quantum.common import exceptions -from quantum.db import servicetype_db -from quantum.extensions import servicetype -from quantum import manager -from quantum.openstack.common import uuidutils -from quantum.plugins.common import constants -from quantum.services.service_base import ServicePluginBase +from neutron.api import extensions +from neutron.api.v2 import base +from neutron.common import exceptions +from neutron.db import servicetype_db +from neutron.extensions import servicetype +from neutron import manager +from neutron.openstack.common import uuidutils +from neutron.plugins.common import constants +from neutron.services.service_base import ServicePluginBase DUMMY_PLUGIN_NAME = "dummy_plugin" @@ -68,7 +68,7 @@ class Dummy(object): @classmethod def get_namespace(cls): - return "http://docs.openstack.org/ext/quantum/dummy/api/v1.0" + return "http://docs.openstack.org/ext/neutron/dummy/api/v1.0" @classmethod def get_updated(cls): @@ -77,7 +77,7 @@ class Dummy(object): @classmethod def get_resources(cls): """Returns Extended Resource for dummy management.""" - q_mgr = manager.QuantumManager.get_instance() + q_mgr = manager.NeutronManager.get_instance() dummy_inst = q_mgr.get_service_plugins()['DUMMY'] controller = base.create_resource( COLLECTION_NAME, RESOURCE_NAME, dummy_inst, @@ -107,7 +107,7 @@ class DummyServicePlugin(ServicePluginBase): return DUMMY_PLUGIN_NAME def get_plugin_description(self): - return "Quantum Dummy Service Plugin" + return "Neutron Dummy Service Plugin" def get_dummys(self, context, filters, fields): return self.dummys.values() diff --git a/quantum/tests/unit/extension_stubs.py b/neutron/tests/unit/extension_stubs.py similarity index 96% rename from quantum/tests/unit/extension_stubs.py rename to neutron/tests/unit/extension_stubs.py index 57e2c7c21f..83aed9000c 100644 --- a/quantum/tests/unit/extension_stubs.py +++ b/neutron/tests/unit/extension_stubs.py @@ -16,8 +16,8 @@ from abc import abstractmethod -from quantum.api import extensions -from quantum import wsgi +from neutron.api import extensions +from neutron import wsgi class StubExtension(object): diff --git a/quantum/tests/unit/extensions/__init__.py b/neutron/tests/unit/extensions/__init__.py similarity index 100% rename from quantum/tests/unit/extensions/__init__.py rename to neutron/tests/unit/extensions/__init__.py diff --git a/quantum/tests/unit/extensions/extendedattribute.py b/neutron/tests/unit/extensions/extendedattribute.py similarity index 98% rename from quantum/tests/unit/extensions/extendedattribute.py rename to neutron/tests/unit/extensions/extendedattribute.py index 2451b8da4e..062acc776a 100644 --- a/quantum/tests/unit/extensions/extendedattribute.py +++ b/neutron/tests/unit/extensions/extendedattribute.py @@ -16,7 +16,7 @@ # # @author: Kaiwei Fan, VMware, Inc -from quantum.api import extensions +from neutron.api import extensions EXTENDED_ATTRIBUTE = 'extended_attribute' EXTENDED_ATTRIBUTES_2_0 = { diff --git a/quantum/tests/unit/extensions/extensionattribute.py b/neutron/tests/unit/extensions/extensionattribute.py similarity index 94% rename from quantum/tests/unit/extensions/extensionattribute.py rename to neutron/tests/unit/extensions/extensionattribute.py index 6d3355f527..f162f7fe83 100644 --- a/quantum/tests/unit/extensions/extensionattribute.py +++ b/neutron/tests/unit/extensions/extensionattribute.py @@ -20,10 +20,10 @@ from abc import abstractmethod -from quantum.api import extensions -from quantum.api.v2 import base -from quantum import manager -from quantum import quota +from neutron.api import extensions +from neutron.api.v2 import base +from neutron import manager +from neutron import quota # Attribute Map @@ -73,7 +73,7 @@ class Extensionattribute(extensions.ExtensionDescriptor): def get_resources(cls): """Returns Ext Resources.""" exts = [] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() resource_name = 'ext_test_resource' collection_name = resource_name + "s" params = RESOURCE_ATTRIBUTE_MAP.get(collection_name, dict()) diff --git a/quantum/tests/unit/extensions/foxinsocks.py b/neutron/tests/unit/extensions/foxinsocks.py similarity index 97% rename from quantum/tests/unit/extensions/foxinsocks.py rename to neutron/tests/unit/extensions/foxinsocks.py index 2828f5dc21..4247f2e705 100644 --- a/quantum/tests/unit/extensions/foxinsocks.py +++ b/neutron/tests/unit/extensions/foxinsocks.py @@ -17,9 +17,9 @@ from abc import abstractmethod -from quantum.api import extensions -from quantum.openstack.common import jsonutils -from quantum import wsgi +from neutron.api import extensions +from neutron.openstack.common import jsonutils +from neutron import wsgi class FoxInSocksController(wsgi.Controller): diff --git a/quantum/tests/unit/extensions/v2attributes.py b/neutron/tests/unit/extensions/v2attributes.py similarity index 100% rename from quantum/tests/unit/extensions/v2attributes.py rename to neutron/tests/unit/extensions/v2attributes.py diff --git a/quantum/tests/unit/hyperv/__init__.py b/neutron/tests/unit/hyperv/__init__.py similarity index 100% rename from quantum/tests/unit/hyperv/__init__.py rename to neutron/tests/unit/hyperv/__init__.py diff --git a/quantum/tests/unit/hyperv/test_hyperv_quantum_agent.py b/neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py similarity index 91% rename from quantum/tests/unit/hyperv/test_hyperv_quantum_agent.py rename to neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py index e0ef632787..2f598e8969 100644 --- a/quantum/tests/unit/hyperv/test_hyperv_quantum_agent.py +++ b/neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py @@ -17,25 +17,25 @@ # under the License. """ -Unit tests for Windows Hyper-V virtual switch quantum driver +Unit tests for Windows Hyper-V virtual switch neutron driver """ import mock from oslo.config import cfg -from quantum.plugins.hyperv.agent import hyperv_quantum_agent -from quantum.tests import base +from neutron.plugins.hyperv.agent import hyperv_neutron_agent +from neutron.tests import base -class TestHyperVQuantumAgent(base.BaseTestCase): +class TestHyperVNeutronAgent(base.BaseTestCase): def setUp(self): - super(TestHyperVQuantumAgent, self).setUp() + super(TestHyperVNeutronAgent, self).setUp() self.addCleanup(cfg.CONF.reset) # Avoid rpc initialization for unit tests cfg.CONF.set_override('rpc_backend', - 'quantum.openstack.common.rpc.impl_fake') - self.agent = hyperv_quantum_agent.HyperVQuantumAgent() + 'neutron.openstack.common.rpc.impl_fake') + self.agent = hyperv_neutron_agent.HyperVNeutronAgent() self.agent.plugin_rpc = mock.Mock() self.agent.context = mock.Mock() self.agent.agent_id = mock.Mock() diff --git a/quantum/tests/unit/hyperv/test_hyperv_quantum_plugin.py b/neutron/tests/unit/hyperv/test_hyperv_neutron_plugin.py similarity index 70% rename from quantum/tests/unit/hyperv/test_hyperv_quantum_plugin.py rename to neutron/tests/unit/hyperv/test_hyperv_neutron_plugin.py index a3a5984419..f132c40acc 100644 --- a/quantum/tests/unit/hyperv/test_hyperv_quantum_plugin.py +++ b/neutron/tests/unit/hyperv/test_hyperv_neutron_plugin.py @@ -20,33 +20,33 @@ import contextlib from oslo.config import cfg -from quantum import context -from quantum.extensions import portbindings -from quantum.manager import QuantumManager -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron import context +from neutron.extensions import portbindings +from neutron.manager import NeutronManager +from neutron.tests.unit import test_db_plugin as test_plugin -class HyperVQuantumPluginTestCase(test_plugin.QuantumDbPluginV2TestCase): +class HyperVNeutronPluginTestCase(test_plugin.NeutronDbPluginV2TestCase): - _plugin_name = ('quantum.plugins.hyperv.' - 'hyperv_quantum_plugin.HyperVQuantumPlugin') + _plugin_name = ('neutron.plugins.hyperv.' + 'hyperv_neutron_plugin.HyperVNeutronPlugin') def setUp(self): - super(HyperVQuantumPluginTestCase, self).setUp(self._plugin_name) + super(HyperVNeutronPluginTestCase, self).setUp(self._plugin_name) class TestHyperVVirtualSwitchBasicGet( - test_plugin.TestBasicGet, HyperVQuantumPluginTestCase): + test_plugin.TestBasicGet, HyperVNeutronPluginTestCase): pass class TestHyperVVirtualSwitchV2HTTPResponse( - test_plugin.TestV2HTTPResponse, HyperVQuantumPluginTestCase): + test_plugin.TestV2HTTPResponse, HyperVNeutronPluginTestCase): pass class TestHyperVVirtualSwitchPortsV2( - test_plugin.TestPortsV2, HyperVQuantumPluginTestCase): + test_plugin.TestPortsV2, HyperVNeutronPluginTestCase): def test_port_vif_details(self): with self.port(name='name') as port: self.assertEqual(port['port']['binding:vif_type'], @@ -54,7 +54,7 @@ class TestHyperVVirtualSwitchPortsV2( def test_ports_vif_details(self): cfg.CONF.set_default('allow_overlapping_ips', True) - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() with contextlib.nested(self.port(), self.port()) as (port1, port2): ctx = context.get_admin_context() ports = plugin.get_ports(ctx) @@ -65,5 +65,5 @@ class TestHyperVVirtualSwitchPortsV2( class TestHyperVVirtualSwitchNetworksV2( - test_plugin.TestNetworksV2, HyperVQuantumPluginTestCase): + test_plugin.TestNetworksV2, HyperVNeutronPluginTestCase): pass diff --git a/quantum/tests/unit/hyperv/test_hyperv_rpcapi.py b/neutron/tests/unit/hyperv/test_hyperv_rpcapi.py similarity index 85% rename from quantum/tests/unit/hyperv/test_hyperv_rpcapi.py rename to neutron/tests/unit/hyperv/test_hyperv_rpcapi.py index bf94cf31c6..68b4eec397 100644 --- a/quantum/tests/unit/hyperv/test_hyperv_rpcapi.py +++ b/neutron/tests/unit/hyperv/test_hyperv_rpcapi.py @@ -17,23 +17,23 @@ # under the License. """ -Unit Tests for hyperv quantum rpc +Unit Tests for hyperv neutron rpc """ import mock -from quantum.agent import rpc as agent_rpc -from quantum.common import topics -from quantum.openstack.common import context -from quantum.openstack.common import rpc -from quantum.plugins.hyperv import agent_notifier_api as ana -from quantum.plugins.hyperv.common import constants -from quantum.tests import base +from neutron.agent import rpc as agent_rpc +from neutron.common import topics +from neutron.openstack.common import context +from neutron.openstack.common import rpc +from neutron.plugins.hyperv import agent_notifier_api as ana +from neutron.plugins.hyperv.common import constants +from neutron.tests import base class rpcHyperVApiTestCase(base.BaseTestCase): - def _test_hyperv_quantum_api( + def _test_hyperv_neutron_api( self, rpcapi, topic, method, rpc_method, **kwargs): ctxt = context.RequestContext('fake_user', 'fake_project') expected_retval = 'foo' if method == 'call' else None @@ -57,7 +57,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def test_delete_network(self): rpcapi = ana.AgentNotifierApi(topics.AGENT) - self._test_hyperv_quantum_api( + self._test_hyperv_neutron_api( rpcapi, topics.get_topic_name( topics.AGENT, @@ -68,7 +68,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def test_port_update(self): rpcapi = ana.AgentNotifierApi(topics.AGENT) - self._test_hyperv_quantum_api( + self._test_hyperv_neutron_api( rpcapi, topics.get_topic_name( topics.AGENT, @@ -82,7 +82,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def test_port_delete(self): rpcapi = ana.AgentNotifierApi(topics.AGENT) - self._test_hyperv_quantum_api( + self._test_hyperv_neutron_api( rpcapi, topics.get_topic_name( topics.AGENT, @@ -93,7 +93,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def test_tunnel_update(self): rpcapi = ana.AgentNotifierApi(topics.AGENT) - self._test_hyperv_quantum_api( + self._test_hyperv_neutron_api( rpcapi, topics.get_topic_name( topics.AGENT, @@ -104,7 +104,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def test_device_details(self): rpcapi = agent_rpc.PluginApi(topics.PLUGIN) - self._test_hyperv_quantum_api( + self._test_hyperv_neutron_api( rpcapi, topics.PLUGIN, 'get_device_details', rpc_method='call', device='fake_device', @@ -112,7 +112,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def test_update_device_down(self): rpcapi = agent_rpc.PluginApi(topics.PLUGIN) - self._test_hyperv_quantum_api( + self._test_hyperv_neutron_api( rpcapi, topics.PLUGIN, 'update_device_down', rpc_method='call', device='fake_device', @@ -120,7 +120,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase): def test_tunnel_sync(self): rpcapi = agent_rpc.PluginApi(topics.PLUGIN) - self._test_hyperv_quantum_api( + self._test_hyperv_neutron_api( rpcapi, topics.PLUGIN, 'tunnel_sync', rpc_method='call', tunnel_ip='fake_tunnel_ip') diff --git a/quantum/tests/unit/linuxbridge/__init__.py b/neutron/tests/unit/linuxbridge/__init__.py similarity index 100% rename from quantum/tests/unit/linuxbridge/__init__.py rename to neutron/tests/unit/linuxbridge/__init__.py diff --git a/quantum/tests/unit/linuxbridge/test_agent_scheduler.py b/neutron/tests/unit/linuxbridge/test_agent_scheduler.py similarity index 88% rename from quantum/tests/unit/linuxbridge/test_agent_scheduler.py rename to neutron/tests/unit/linuxbridge/test_agent_scheduler.py index 4506f60688..b7a516e6f5 100644 --- a/quantum/tests/unit/linuxbridge/test_agent_scheduler.py +++ b/neutron/tests/unit/linuxbridge/test_agent_scheduler.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.tests.unit.linuxbridge import test_linuxbridge_plugin -from quantum.tests.unit.openvswitch import test_agent_scheduler +from neutron.tests.unit.linuxbridge import test_linuxbridge_plugin +from neutron.tests.unit.openvswitch import test_agent_scheduler class LbAgentSchedulerTestCase( diff --git a/quantum/tests/unit/linuxbridge/test_defaults.py b/neutron/tests/unit/linuxbridge/test_defaults.py similarity index 93% rename from quantum/tests/unit/linuxbridge/test_defaults.py rename to neutron/tests/unit/linuxbridge/test_defaults.py index c33e9549e8..ae41630845 100644 --- a/quantum/tests/unit/linuxbridge/test_defaults.py +++ b/neutron/tests/unit/linuxbridge/test_defaults.py @@ -15,8 +15,8 @@ from oslo.config import cfg -from quantum.plugins.linuxbridge.common import config # noqa -from quantum.tests import base +from neutron.plugins.linuxbridge.common import config # noqa +from neutron.tests import base class ConfigurationTest(base.BaseTestCase): diff --git a/quantum/tests/unit/linuxbridge/test_lb_db.py b/neutron/tests/unit/linuxbridge/test_lb_db.py similarity index 96% rename from quantum/tests/unit/linuxbridge/test_lb_db.py rename to neutron/tests/unit/linuxbridge/test_lb_db.py index 3ab8453cfc..c9f13388f5 100644 --- a/quantum/tests/unit/linuxbridge/test_lb_db.py +++ b/neutron/tests/unit/linuxbridge/test_lb_db.py @@ -16,11 +16,11 @@ import testtools from testtools import matchers -from quantum.common import exceptions as q_exc -from quantum.db import api as db -from quantum.plugins.linuxbridge.db import l2network_db_v2 as lb_db -from quantum.tests import base -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.common import exceptions as q_exc +from neutron.db import api as db +from neutron.plugins.linuxbridge.db import l2network_db_v2 as lb_db +from neutron.tests import base +from neutron.tests.unit import test_db_plugin as test_plugin PHYS_NET = 'physnet1' PHYS_NET_2 = 'physnet2' @@ -145,7 +145,7 @@ class NetworkStatesTest(base.BaseTestCase): self.assertIsNone(lb_db.get_network_state(PHYS_NET, vlan_id)) -class NetworkBindingsTest(test_plugin.QuantumDbPluginV2TestCase): +class NetworkBindingsTest(test_plugin.NeutronDbPluginV2TestCase): def setUp(self): super(NetworkBindingsTest, self).setUp() lb_db.initialize() diff --git a/quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py b/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py similarity index 95% rename from quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py rename to neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py index cb19a67c40..9b60a9b9e6 100644 --- a/quantum/tests/unit/linuxbridge/test_lb_quantum_agent.py +++ b/neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py @@ -21,12 +21,12 @@ import mock from oslo.config import cfg import testtools -from quantum.agent.linux import ip_lib -from quantum.agent.linux import utils -from quantum.openstack.common.rpc import common as rpc_common -from quantum.plugins.linuxbridge.agent import linuxbridge_quantum_agent -from quantum.plugins.linuxbridge.common import constants as lconst -from quantum.tests import base +from neutron.agent.linux import ip_lib +from neutron.agent.linux import utils +from neutron.openstack.common.rpc import common as rpc_common +from neutron.plugins.linuxbridge.agent import linuxbridge_neutron_agent +from neutron.plugins.linuxbridge.common import constants as lconst +from neutron.tests import base class TestLinuxBridge(base.BaseTestCase): @@ -37,7 +37,7 @@ class TestLinuxBridge(base.BaseTestCase): interface_mappings = {'physnet1': 'eth1'} root_helper = cfg.CONF.AGENT.root_helper - self.linux_bridge = linuxbridge_quantum_agent.LinuxBridgeManager( + self.linux_bridge = linuxbridge_neutron_agent.LinuxBridgeManager( interface_mappings, root_helper) def test_ensure_physical_in_bridge_invalid(self): @@ -75,9 +75,9 @@ class TestLinuxBridgeAgent(base.BaseTestCase): def setUp(self): super(TestLinuxBridgeAgent, self).setUp() cfg.CONF.set_override('rpc_backend', - 'quantum.openstack.common.rpc.impl_fake') - self.lbmgr_patcher = mock.patch('quantum.plugins.linuxbridge.agent.' - 'linuxbridge_quantum_agent.' + 'neutron.openstack.common.rpc.impl_fake') + self.lbmgr_patcher = mock.patch('neutron.plugins.linuxbridge.agent.' + 'linuxbridge_neutron_agent.' 'LinuxBridgeManager') self.lbmgr_mock = self.lbmgr_patcher.start() self.addCleanup(self.lbmgr_patcher.stop) @@ -85,7 +85,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): self.execute = self.execute_p.start() self.addCleanup(self.execute_p.stop) self.execute.return_value = '\n'.join(self.LINK_SAMPLE) - self.get_mac_p = mock.patch('quantum.agent.linux.utils.' + self.get_mac_p = mock.patch('neutron.agent.linux.utils.' 'get_interface_mac') self.get_mac = self.get_mac_p.start() self.addCleanup(self.get_mac_p.stop) @@ -94,7 +94,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): def test_update_devices_failed(self): lbmgr_instance = self.lbmgr_mock.return_value lbmgr_instance.update_devices.side_effect = RuntimeError - agent = linuxbridge_quantum_agent.LinuxBridgeQuantumAgentRPC({}, + agent = linuxbridge_neutron_agent.LinuxBridgeNeutronAgentRPC({}, 0, None) raise_exception = [0] @@ -105,7 +105,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): else: raise RuntimeError() - with mock.patch.object(linuxbridge_quantum_agent.LOG, 'info') as log: + with mock.patch.object(linuxbridge_neutron_agent.LOG, 'info') as log: log.side_effect = info_mock with testtools.ExpectedException(RuntimeError): agent.daemon_loop() @@ -115,7 +115,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): device_info = {'current': [1, 2, 3]} lbmgr_instance = self.lbmgr_mock.return_value lbmgr_instance.update_devices.return_value = device_info - agent = linuxbridge_quantum_agent.LinuxBridgeQuantumAgentRPC({}, + agent = linuxbridge_neutron_agent.LinuxBridgeNeutronAgentRPC({}, 0, None) raise_exception = [0] @@ -127,7 +127,7 @@ class TestLinuxBridgeAgent(base.BaseTestCase): raise RuntimeError() with contextlib.nested( - mock.patch.object(linuxbridge_quantum_agent.LOG, 'info'), + mock.patch.object(linuxbridge_neutron_agent.LOG, 'info'), mock.patch.object(agent, 'process_network_devices') ) as (log, process_network_devices): log.side_effect = info_mock @@ -143,7 +143,7 @@ class TestLinuxBridgeManager(base.BaseTestCase): self.interface_mappings = {'physnet1': 'eth1'} self.root_helper = cfg.CONF.AGENT.root_helper - self.lbm = linuxbridge_quantum_agent.LinuxBridgeManager( + self.lbm = linuxbridge_neutron_agent.LinuxBridgeManager( self.interface_mappings, self.root_helper) def test_device_exists(self): @@ -184,11 +184,11 @@ class TestLinuxBridgeManager(base.BaseTestCase): self.assertEqual(self.lbm.get_tap_device_name(if_id), "tap") - def test_get_all_quantum_bridges(self): + def test_get_all_neutron_bridges(self): br_list = ["br-int", "brq1", "brq2", "br-ex"] with mock.patch.object(os, 'listdir') as listdir_fn: listdir_fn.return_value = br_list - self.assertEqual(self.lbm.get_all_quantum_bridges(), + self.assertEqual(self.lbm.get_all_neutron_bridges(), br_list[1:3]) self.assertTrue(listdir_fn.called) @@ -203,7 +203,7 @@ class TestLinuxBridgeManager(base.BaseTestCase): def test_get_bridge_for_tap_device(self): with contextlib.nested( - mock.patch.object(self.lbm, "get_all_quantum_bridges"), + mock.patch.object(self.lbm, "get_all_neutron_bridges"), mock.patch.object(self.lbm, "get_interfaces_on_bridge") ) as (get_all_qbr_fn, get_if_fn): get_all_qbr_fn.return_value = ["br-int", "br-ex"] @@ -489,11 +489,11 @@ class TestLinuxBridgeRpcCallbacks(base.BaseTestCase): class FakeLBAgent(object): def __init__(self): self.agent_id = 1 - self.br_mgr = (linuxbridge_quantum_agent. + self.br_mgr = (linuxbridge_neutron_agent. LinuxBridgeManager({'physnet1': 'eth1'}, cfg.CONF.AGENT.root_helper)) - self.lb_rpc = linuxbridge_quantum_agent.LinuxBridgeRpcCallbacks( + self.lb_rpc = linuxbridge_neutron_agent.LinuxBridgeRpcCallbacks( object(), FakeLBAgent() ) @@ -602,7 +602,7 @@ class TestLinuxBridgeRpcCallbacks(base.BaseTestCase): "refresh_firewall", create=True), mock.patch.object(self.lb_rpc.agent, "plugin_rpc", create=True), - mock.patch.object(linuxbridge_quantum_agent.LOG, 'error'), + mock.patch.object(linuxbridge_neutron_agent.LOG, 'error'), ) as (get_tap_fn, udev_fn, _, _, _, _, plugin_rpc, log): get_tap_fn.return_value = "tap123" udev_fn.return_value = ["tap123", "tap124"] diff --git a/quantum/tests/unit/linuxbridge/test_lb_security_group.py b/neutron/tests/unit/linuxbridge/test_lb_security_group.py similarity index 86% rename from quantum/tests/unit/linuxbridge/test_lb_security_group.py rename to neutron/tests/unit/linuxbridge/test_lb_security_group.py index 24f50a0341..8268710d02 100644 --- a/quantum/tests/unit/linuxbridge/test_lb_security_group.py +++ b/neutron/tests/unit/linuxbridge/test_lb_security_group.py @@ -17,19 +17,19 @@ import mock -from quantum.api.v2 import attributes -from quantum.extensions import securitygroup as ext_sg -from quantum.plugins.linuxbridge.db import l2network_db_v2 as lb_db -from quantum.tests.unit import test_extension_security_group as test_sg -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.api.v2 import attributes +from neutron.extensions import securitygroup as ext_sg +from neutron.plugins.linuxbridge.db import l2network_db_v2 as lb_db +from neutron.tests.unit import test_extension_security_group as test_sg +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc -PLUGIN_NAME = ('quantum.plugins.linuxbridge.' - 'lb_quantum_plugin.LinuxBridgePluginV2') -AGENT_NAME = ('quantum.plugins.linuxbridge.' - 'agent.linuxbridg_quantum_agent.LinuxBridgeQuantumAgentRPC') -NOTIFIER = ('quantum.plugins.linuxbridge.' - 'lb_quantum_plugin.AgentNotifierApi') +PLUGIN_NAME = ('neutron.plugins.linuxbridge.' + 'lb_neutron_plugin.LinuxBridgePluginV2') +AGENT_NAME = ('neutron.plugins.linuxbridge.' + 'agent.linuxbridg_neutron_agent.LinuxBridgeNeutronAgentRPC') +NOTIFIER = ('neutron.plugins.linuxbridge.' + 'lb_neutron_plugin.AgentNotifierApi') class LinuxBridgeSecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase): diff --git a/quantum/tests/unit/linuxbridge/test_linuxbridge_plugin.py b/neutron/tests/unit/linuxbridge/test_linuxbridge_plugin.py similarity index 84% rename from quantum/tests/unit/linuxbridge/test_linuxbridge_plugin.py rename to neutron/tests/unit/linuxbridge/test_linuxbridge_plugin.py index 4e581949f3..91c3530916 100644 --- a/quantum/tests/unit/linuxbridge/test_linuxbridge_plugin.py +++ b/neutron/tests/unit/linuxbridge/test_linuxbridge_plugin.py @@ -13,17 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.extensions import portbindings -from quantum.tests.unit import _test_extension_portbindings as test_bindings -from quantum.tests.unit import test_db_plugin as test_plugin -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.extensions import portbindings +from neutron.tests.unit import _test_extension_portbindings as test_bindings +from neutron.tests.unit import test_db_plugin as test_plugin +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc -PLUGIN_NAME = ('quantum.plugins.linuxbridge.' - 'lb_quantum_plugin.LinuxBridgePluginV2') +PLUGIN_NAME = ('neutron.plugins.linuxbridge.' + 'lb_neutron_plugin.LinuxBridgePluginV2') -class LinuxBridgePluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class LinuxBridgePluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): _plugin_name = PLUGIN_NAME def setUp(self): diff --git a/quantum/tests/unit/linuxbridge/test_rpcapi.py b/neutron/tests/unit/linuxbridge/test_rpcapi.py similarity index 95% rename from quantum/tests/unit/linuxbridge/test_rpcapi.py rename to neutron/tests/unit/linuxbridge/test_rpcapi.py index 1a54b0f146..1db75a12bb 100644 --- a/quantum/tests/unit/linuxbridge/test_rpcapi.py +++ b/neutron/tests/unit/linuxbridge/test_rpcapi.py @@ -21,12 +21,12 @@ Unit Tests for linuxbridge rpc from oslo.config import cfg import stubout -from quantum.agent import rpc as agent_rpc -from quantum.common import topics -from quantum.openstack.common import context -from quantum.openstack.common import rpc -from quantum.plugins.linuxbridge import lb_quantum_plugin as plb -from quantum.tests import base +from neutron.agent import rpc as agent_rpc +from neutron.common import topics +from neutron.openstack.common import context +from neutron.openstack.common import rpc +from neutron.plugins.linuxbridge import lb_neutron_plugin as plb +from neutron.tests import base class rpcApiTestCase(base.BaseTestCase): diff --git a/quantum/tests/unit/metaplugin/__init__.py b/neutron/tests/unit/metaplugin/__init__.py similarity index 100% rename from quantum/tests/unit/metaplugin/__init__.py rename to neutron/tests/unit/metaplugin/__init__.py diff --git a/quantum/tests/unit/metaplugin/fake_plugin.py b/neutron/tests/unit/metaplugin/fake_plugin.py similarity index 94% rename from quantum/tests/unit/metaplugin/fake_plugin.py rename to neutron/tests/unit/metaplugin/fake_plugin.py index e8d9fcb09e..45e4cdee8a 100644 --- a/quantum/tests/unit/metaplugin/fake_plugin.py +++ b/neutron/tests/unit/metaplugin/fake_plugin.py @@ -14,11 +14,11 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.db import db_base_plugin_v2 -from quantum.db import l3_gwmode_db +from neutron.db import db_base_plugin_v2 +from neutron.db import l3_gwmode_db -class Fake1(db_base_plugin_v2.QuantumDbPluginV2, +class Fake1(db_base_plugin_v2.NeutronDbPluginV2, l3_gwmode_db.L3_NAT_db_mixin): supported_extension_aliases = ['router'] diff --git a/quantum/tests/unit/metaplugin/test_basic.py b/neutron/tests/unit/metaplugin/test_basic.py similarity index 82% rename from quantum/tests/unit/metaplugin/test_basic.py rename to neutron/tests/unit/metaplugin/test_basic.py index f627d66c91..9b4b31867a 100644 --- a/quantum/tests/unit/metaplugin/test_basic.py +++ b/neutron/tests/unit/metaplugin/test_basic.py @@ -13,16 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.common.test_lib import test_config -from quantum.tests.unit.metaplugin.test_metaplugin import setup_metaplugin_conf -from quantum.tests.unit import test_db_plugin as test_plugin -from quantum.tests.unit import test_l3_plugin +from neutron.common.test_lib import test_config +from neutron.tests.unit.metaplugin.test_metaplugin import setup_metaplugin_conf +from neutron.tests.unit import test_db_plugin as test_plugin +from neutron.tests.unit import test_l3_plugin -class MetaPluginV2DBTestCase(test_plugin.QuantumDbPluginV2TestCase): +class MetaPluginV2DBTestCase(test_plugin.NeutronDbPluginV2TestCase): - _plugin_name = ('quantum.plugins.metaplugin.' - 'meta_quantum_plugin.MetaPluginV2') + _plugin_name = ('neutron.plugins.metaplugin.' + 'meta_neutron_plugin.MetaPluginV2') def setUp(self): setup_metaplugin_conf() diff --git a/quantum/tests/unit/metaplugin/test_metaplugin.py b/neutron/tests/unit/metaplugin/test_metaplugin.py similarity index 93% rename from quantum/tests/unit/metaplugin/test_metaplugin.py rename to neutron/tests/unit/metaplugin/test_metaplugin.py index 8a1a815a52..9edff61420 100644 --- a/quantum/tests/unit/metaplugin/test_metaplugin.py +++ b/neutron/tests/unit/metaplugin/test_metaplugin.py @@ -23,20 +23,20 @@ from oslo.config import cfg import stubout import testtools -from quantum import context -from quantum.db import api as db -from quantum.extensions.flavor import (FLAVOR_NETWORK, FLAVOR_ROUTER) -from quantum.openstack.common import uuidutils -from quantum.plugins.metaplugin.meta_quantum_plugin import FlavorNotFound -from quantum.plugins.metaplugin.meta_quantum_plugin import MetaPluginV2 -from quantum.tests import base +from neutron import context +from neutron.db import api as db +from neutron.extensions.flavor import (FLAVOR_NETWORK, FLAVOR_ROUTER) +from neutron.openstack.common import uuidutils +from neutron.plugins.metaplugin.meta_neutron_plugin import FlavorNotFound +from neutron.plugins.metaplugin.meta_neutron_plugin import MetaPluginV2 +from neutron.tests import base CONF_FILE = "" ROOTDIR = os.path.dirname(os.path.dirname(__file__)) ETCDIR = os.path.join(ROOTDIR, 'etc') -META_PATH = "quantum.plugins.metaplugin" -FAKE_PATH = "quantum.tests.unit.metaplugin" -PROXY_PATH = "%s.proxy_quantum_plugin.ProxyPluginV2" % META_PATH +META_PATH = "neutron.plugins.metaplugin" +FAKE_PATH = "neutron.tests.unit.metaplugin" +PROXY_PATH = "%s.proxy_neutron_plugin.ProxyPluginV2" % META_PATH PLUGIN_LIST = """ fake1:%s.fake_plugin.Fake1,fake2:%s.fake_plugin.Fake2,proxy:%s """.strip() % (FAKE_PATH, FAKE_PATH, PROXY_PATH) @@ -53,7 +53,7 @@ def setup_metaplugin_conf(): cfg.CONF.set_override('auth_url', 'http://localhost:35357/v2.0', 'PROXY') cfg.CONF.set_override('auth_region', 'RegionOne', 'PROXY') - cfg.CONF.set_override('admin_user', 'quantum', 'PROXY') + cfg.CONF.set_override('admin_user', 'neutron', 'PROXY') cfg.CONF.set_override('admin_password', 'password', 'PROXY') cfg.CONF.set_override('admin_tenant_name', 'service', 'PROXY') cfg.CONF.set_override('plugin_list', PLUGIN_LIST, 'META') @@ -64,14 +64,14 @@ def setup_metaplugin_conf(): #TODO(nati) remove this after subnet quota change is merged cfg.CONF.set_override('max_dns_nameservers', 10) cfg.CONF.set_override('rpc_backend', - 'quantum.openstack.common.rpc.impl_fake') + 'neutron.openstack.common.rpc.impl_fake') -class MetaQuantumPluginV2Test(base.BaseTestCase): - """Class conisting of MetaQuantumPluginV2 unit tests.""" +class MetaNeutronPluginV2Test(base.BaseTestCase): + """Class conisting of MetaNeutronPluginV2 unit tests.""" def setUp(self): - super(MetaQuantumPluginV2Test, self).setUp() + super(MetaNeutronPluginV2Test, self).setUp() db._ENGINE = None db._MAKER = None self.fake_tenant_id = uuidutils.generate_uuid() @@ -83,7 +83,7 @@ class MetaQuantumPluginV2Test(base.BaseTestCase): self.mox = mox.Mox() self.stubs = stubout.StubOutForTesting() - self.client_cls_p = mock.patch('quantumclient.v2_0.client.Client') + self.client_cls_p = mock.patch('neutronclient.v2_0.client.Client') client_cls = self.client_cls_p.start() self.client_inst = mock.Mock() client_cls.return_value = self.client_inst @@ -311,4 +311,4 @@ class MetaQuantumPluginV2Test(base.BaseTestCase): self.stubs.SmartUnsetAll() self.mox.VerifyAll() db.clear_db() - super(MetaQuantumPluginV2Test, self).tearDown() + super(MetaNeutronPluginV2Test, self).tearDown() diff --git a/quantum/tests/unit/midonet/__init__.py b/neutron/tests/unit/midonet/__init__.py similarity index 100% rename from quantum/tests/unit/midonet/__init__.py rename to neutron/tests/unit/midonet/__init__.py diff --git a/quantum/tests/unit/midonet/etc/midonet.ini.test b/neutron/tests/unit/midonet/etc/midonet.ini.test similarity index 100% rename from quantum/tests/unit/midonet/etc/midonet.ini.test rename to neutron/tests/unit/midonet/etc/midonet.ini.test diff --git a/quantum/tests/unit/midonet/mock_lib.py b/neutron/tests/unit/midonet/mock_lib.py similarity index 100% rename from quantum/tests/unit/midonet/mock_lib.py rename to neutron/tests/unit/midonet/mock_lib.py diff --git a/quantum/tests/unit/midonet/test_midonet_lib.py b/neutron/tests/unit/midonet/test_midonet_lib.py similarity index 98% rename from quantum/tests/unit/midonet/test_midonet_lib.py rename to neutron/tests/unit/midonet/test_midonet_lib.py index 17e3534669..db1b461f2e 100644 --- a/quantum/tests/unit/midonet/test_midonet_lib.py +++ b/neutron/tests/unit/midonet/test_midonet_lib.py @@ -24,9 +24,9 @@ import mock import testtools import webob.exc as w_exc -from quantum.openstack.common import uuidutils -from quantum.plugins.midonet import midonet_lib -import quantum.tests.unit.midonet.mock_lib as mock_lib +from neutron.openstack.common import uuidutils +from neutron.plugins.midonet import midonet_lib +import neutron.tests.unit.midonet.mock_lib as mock_lib def _create_test_chain(id, name, tenant_id): diff --git a/quantum/tests/unit/midonet/test_midonet_plugin.py b/neutron/tests/unit/midonet/test_midonet_plugin.py similarity index 91% rename from quantum/tests/unit/midonet/test_midonet_plugin.py rename to neutron/tests/unit/midonet/test_midonet_plugin.py index b33782b145..97abe93129 100644 --- a/quantum/tests/unit/midonet/test_midonet_plugin.py +++ b/neutron/tests/unit/midonet/test_midonet_plugin.py @@ -24,25 +24,25 @@ import mock import os import sys -import quantum.common.test_lib as test_lib -import quantum.tests.unit.midonet.mock_lib as mock_lib -import quantum.tests.unit.test_db_plugin as test_plugin +import neutron.common.test_lib as test_lib +import neutron.tests.unit.midonet.mock_lib as mock_lib +import neutron.tests.unit.test_db_plugin as test_plugin -MIDOKURA_PKG_PATH = "quantum.plugins.midonet.plugin" +MIDOKURA_PKG_PATH = "neutron.plugins.midonet.plugin" # Need to mock the midonetclient module since the plugin will try to load it. sys.modules["midonetclient"] = mock.Mock() -class MidonetPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class MidonetPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): _plugin_name = ('%s.MidonetPluginV2' % MIDOKURA_PKG_PATH) def setUp(self): self.mock_api = mock.patch( - 'quantum.plugins.midonet.midonet_lib.MidoClient') + 'neutron.plugins.midonet.midonet_lib.MidoClient') etc_path = os.path.join(os.path.dirname(__file__), 'etc') test_lib.test_config['config_files'] = [os.path.join( etc_path, 'midonet.ini.test')] diff --git a/quantum/tests/unit/ml2/__init__.py b/neutron/tests/unit/ml2/__init__.py similarity index 100% rename from quantum/tests/unit/ml2/__init__.py rename to neutron/tests/unit/ml2/__init__.py diff --git a/quantum/tests/unit/ml2/test_agent_scheduler.py b/neutron/tests/unit/ml2/test_agent_scheduler.py similarity index 90% rename from quantum/tests/unit/ml2/test_agent_scheduler.py rename to neutron/tests/unit/ml2/test_agent_scheduler.py index 60f7f47648..76b62a384e 100644 --- a/quantum/tests/unit/ml2/test_agent_scheduler.py +++ b/neutron/tests/unit/ml2/test_agent_scheduler.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.tests.unit.ml2 import test_ml2_plugin -from quantum.tests.unit.openvswitch import test_agent_scheduler +from neutron.tests.unit.ml2 import test_ml2_plugin +from neutron.tests.unit.openvswitch import test_agent_scheduler class Ml2AgentSchedulerTestCase( diff --git a/quantum/tests/unit/ml2/test_ml2_plugin.py b/neutron/tests/unit/ml2/test_ml2_plugin.py similarity index 87% rename from quantum/tests/unit/ml2/test_ml2_plugin.py rename to neutron/tests/unit/ml2/test_ml2_plugin.py index 0c832e84ea..17987b43e2 100644 --- a/quantum/tests/unit/ml2/test_ml2_plugin.py +++ b/neutron/tests/unit/ml2/test_ml2_plugin.py @@ -13,14 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.tests.unit import _test_extension_portbindings as test_bindings -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.tests.unit import _test_extension_portbindings as test_bindings +from neutron.tests.unit import test_db_plugin as test_plugin -PLUGIN_NAME = 'quantum.plugins.ml2.plugin.Ml2Plugin' +PLUGIN_NAME = 'neutron.plugins.ml2.plugin.Ml2Plugin' -class Ml2PluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class Ml2PluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): _plugin_name = PLUGIN_NAME diff --git a/quantum/tests/unit/ml2/test_rpcapi.py b/neutron/tests/unit/ml2/test_rpcapi.py similarity index 94% rename from quantum/tests/unit/ml2/test_rpcapi.py rename to neutron/tests/unit/ml2/test_rpcapi.py index 2deff04d17..5195915ec6 100644 --- a/quantum/tests/unit/ml2/test_rpcapi.py +++ b/neutron/tests/unit/ml2/test_rpcapi.py @@ -19,12 +19,12 @@ Unit Tests for ml2 rpc import mock -from quantum.agent import rpc as agent_rpc -from quantum.common import topics -from quantum.openstack.common import context -from quantum.openstack.common import rpc -from quantum.plugins.ml2 import rpc as plugin_rpc -from quantum.tests import base +from neutron.agent import rpc as agent_rpc +from neutron.common import topics +from neutron.openstack.common import context +from neutron.openstack.common import rpc +from neutron.plugins.ml2 import rpc as plugin_rpc +from neutron.tests import base class RpcApiTestCase(base.BaseTestCase): diff --git a/quantum/tests/unit/ml2/test_security_group.py b/neutron/tests/unit/ml2/test_security_group.py similarity index 88% rename from quantum/tests/unit/ml2/test_security_group.py rename to neutron/tests/unit/ml2/test_security_group.py index 219eeaebb9..8a0e2261b8 100644 --- a/quantum/tests/unit/ml2/test_security_group.py +++ b/neutron/tests/unit/ml2/test_security_group.py @@ -16,14 +16,14 @@ import mock -from quantum.api.v2 import attributes -from quantum.extensions import securitygroup as ext_sg -from quantum import manager -from quantum.tests.unit import test_extension_security_group as test_sg -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.api.v2 import attributes +from neutron.extensions import securitygroup as ext_sg +from neutron import manager +from neutron.tests.unit import test_extension_security_group as test_sg +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc -PLUGIN_NAME = 'quantum.plugins.ml2.plugin.Ml2Plugin' -NOTIFIER = 'quantum.plugins.ml2.rpc.AgentNotifierApi' +PLUGIN_NAME = 'neutron.plugins.ml2.plugin.Ml2Plugin' +NOTIFIER = 'neutron.plugins.ml2.rpc.AgentNotifierApi' class Ml2SecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase): @@ -69,7 +69,7 @@ class TestMl2SecurityGroups(Ml2SecurityGroupsTestCase, res = self.deserialize(self.fmt, req.get_response(self.api)) port_id = res['port']['id'] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin.callbacks.get_port_from_device(port_id) self.assertEqual(port_id, port_dict['id']) self.assertEqual([security_group_id], @@ -80,7 +80,7 @@ class TestMl2SecurityGroups(Ml2SecurityGroupsTestCase, self._delete('ports', port_id) def test_security_group_get_port_from_device_with_no_port(self): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin.callbacks.get_port_from_device('bad_device_id') self.assertEqual(None, port_dict) diff --git a/quantum/tests/unit/mlnx/__init__.py b/neutron/tests/unit/mlnx/__init__.py similarity index 100% rename from quantum/tests/unit/mlnx/__init__.py rename to neutron/tests/unit/mlnx/__init__.py diff --git a/quantum/tests/unit/mlnx/test_defaults.py b/neutron/tests/unit/mlnx/test_defaults.py similarity index 93% rename from quantum/tests/unit/mlnx/test_defaults.py rename to neutron/tests/unit/mlnx/test_defaults.py index d8c210920d..5dcbae9885 100644 --- a/quantum/tests/unit/mlnx/test_defaults.py +++ b/neutron/tests/unit/mlnx/test_defaults.py @@ -16,8 +16,8 @@ from oslo.config import cfg #NOTE this import loads tests required options -from quantum.plugins.mlnx.common import config # noqa -from quantum.tests import base +from neutron.plugins.mlnx.common import config # noqa +from neutron.tests import base class ConfigurationTest(base.BaseTestCase): diff --git a/quantum/tests/unit/mlnx/test_mlnx_db.py b/neutron/tests/unit/mlnx/test_mlnx_db.py similarity index 96% rename from quantum/tests/unit/mlnx/test_mlnx_db.py rename to neutron/tests/unit/mlnx/test_mlnx_db.py index 680dc22bba..819af0ee7f 100644 --- a/quantum/tests/unit/mlnx/test_mlnx_db.py +++ b/neutron/tests/unit/mlnx/test_mlnx_db.py @@ -15,11 +15,11 @@ from testtools import matchers -from quantum.common import exceptions as q_exc -from quantum.db import api as db -from quantum.plugins.mlnx.db import mlnx_db_v2 as mlnx_db -from quantum.tests import base -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.common import exceptions as q_exc +from neutron.db import api as db +from neutron.plugins.mlnx.db import mlnx_db_v2 as mlnx_db +from neutron.tests import base +from neutron.tests.unit import test_db_plugin as test_plugin PHYS_NET = 'physnet1' PHYS_NET_2 = 'physnet2' @@ -155,7 +155,7 @@ class SegmentationIdAllocationTest(base.BaseTestCase): self.assertIsNone(mlnx_db.get_network_state(PHYS_NET, vlan_id)) -class NetworkBindingsTest(test_plugin.QuantumDbPluginV2TestCase): +class NetworkBindingsTest(test_plugin.NeutronDbPluginV2TestCase): def setUp(self): super(NetworkBindingsTest, self).setUp() mlnx_db.initialize() diff --git a/quantum/tests/unit/mlnx/test_mlnx_plugin.py b/neutron/tests/unit/mlnx/test_mlnx_plugin.py similarity index 81% rename from quantum/tests/unit/mlnx/test_mlnx_plugin.py rename to neutron/tests/unit/mlnx/test_mlnx_plugin.py index a7753f1acb..1eae64142e 100644 --- a/quantum/tests/unit/mlnx/test_mlnx_plugin.py +++ b/neutron/tests/unit/mlnx/test_mlnx_plugin.py @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.plugins.mlnx.common import constants -from quantum.tests.unit import _test_extension_portbindings as test_bindings -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.plugins.mlnx.common import constants +from neutron.tests.unit import _test_extension_portbindings as test_bindings +from neutron.tests.unit import test_db_plugin as test_plugin -PLUGIN_NAME = ('quantum.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin') +PLUGIN_NAME = ('neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin') -class MlnxPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class MlnxPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): _plugin_name = PLUGIN_NAME def setUp(self): diff --git a/quantum/tests/unit/mlnx/test_rpcapi.py b/neutron/tests/unit/mlnx/test_rpcapi.py similarity index 94% rename from quantum/tests/unit/mlnx/test_rpcapi.py rename to neutron/tests/unit/mlnx/test_rpcapi.py index 419f8a2783..64973e119e 100644 --- a/quantum/tests/unit/mlnx/test_rpcapi.py +++ b/neutron/tests/unit/mlnx/test_rpcapi.py @@ -21,12 +21,12 @@ Unit Tests for Mellanox RPC (major reuse of linuxbridge rpc unit tests) import stubout -from quantum.agent import rpc as agent_rpc -from quantum.common import topics -from quantum.openstack.common import context -from quantum.openstack.common import rpc -from quantum.plugins.mlnx import agent_notify_api -from quantum.tests import base +from neutron.agent import rpc as agent_rpc +from neutron.common import topics +from neutron.openstack.common import context +from neutron.openstack.common import rpc +from neutron.plugins.mlnx import agent_notify_api +from neutron.tests import base class rpcApiTestCase(base.BaseTestCase): diff --git a/quantum/tests/unit/nec/__init__.py b/neutron/tests/unit/nec/__init__.py similarity index 100% rename from quantum/tests/unit/nec/__init__.py rename to neutron/tests/unit/nec/__init__.py diff --git a/quantum/tests/unit/nec/stub_ofc_driver.py b/neutron/tests/unit/nec/stub_ofc_driver.py similarity index 97% rename from quantum/tests/unit/nec/stub_ofc_driver.py rename to neutron/tests/unit/nec/stub_ofc_driver.py index 45911374af..88ee53554b 100644 --- a/quantum/tests/unit/nec/stub_ofc_driver.py +++ b/neutron/tests/unit/nec/stub_ofc_driver.py @@ -15,7 +15,7 @@ # under the License. # @author: Ryota MIBU -from quantum.plugins.nec import ofc_driver_base +from neutron.plugins.nec import ofc_driver_base class StubOFCDriver(ofc_driver_base.OFCDriverBase): diff --git a/quantum/tests/unit/nec/test_agent_scheduler.py b/neutron/tests/unit/nec/test_agent_scheduler.py similarity index 90% rename from quantum/tests/unit/nec/test_agent_scheduler.py rename to neutron/tests/unit/nec/test_agent_scheduler.py index fadbc777b1..a54f4bdae9 100644 --- a/quantum/tests/unit/nec/test_agent_scheduler.py +++ b/neutron/tests/unit/nec/test_agent_scheduler.py @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.tests.unit.nec import test_nec_plugin -from quantum.tests.unit.openvswitch import test_agent_scheduler +from neutron.tests.unit.nec import test_nec_plugin +from neutron.tests.unit.openvswitch import test_agent_scheduler class NecAgentSchedulerTestCase( diff --git a/quantum/tests/unit/nec/test_config.py b/neutron/tests/unit/nec/test_config.py similarity index 95% rename from quantum/tests/unit/nec/test_config.py rename to neutron/tests/unit/nec/test_config.py index 1a1905a35c..907c33dfe7 100644 --- a/quantum/tests/unit/nec/test_config.py +++ b/neutron/tests/unit/nec/test_config.py @@ -15,8 +15,8 @@ # under the License. # @author: Ryota MIBU -from quantum.plugins.nec.common import config -from quantum.tests import base +from neutron.plugins.nec.common import config +from neutron.tests import base class ConfigurationTest(base.BaseTestCase): diff --git a/quantum/tests/unit/nec/test_db.py b/neutron/tests/unit/nec/test_db.py similarity index 96% rename from quantum/tests/unit/nec/test_db.py rename to neutron/tests/unit/nec/test_db.py index 4ae4f5c595..d3637269d7 100644 --- a/quantum/tests/unit/nec/test_db.py +++ b/neutron/tests/unit/nec/test_db.py @@ -17,13 +17,13 @@ import random -from quantum.common import constants as q_const -from quantum.db import api as db_api -from quantum.openstack.common import uuidutils -from quantum.plugins.nec.common import exceptions as nexc -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec.db import models as nmodels # noqa -from quantum.tests import base +from neutron.common import constants as q_const +from neutron.db import api as db_api +from neutron.openstack.common import uuidutils +from neutron.plugins.nec.common import exceptions as nexc +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec.db import models as nmodels # noqa +from neutron.tests import base class NECPluginV2DBTestBase(base.BaseTestCase): @@ -39,9 +39,9 @@ class NECPluginV2DBTestBase(base.BaseTestCase): def get_ofc_item_random_params(self): """create random parameters for ofc_item test.""" ofc_id = uuidutils.generate_uuid() - quantum_id = uuidutils.generate_uuid() + neutron_id = uuidutils.generate_uuid() none = uuidutils.generate_uuid() - return ofc_id, quantum_id, none + return ofc_id, neutron_id, none def get_portinfo_random_params(self): """create random parameters for portinfo test.""" diff --git a/quantum/tests/unit/nec/test_nec_agent.py b/neutron/tests/unit/nec/test_nec_agent.py similarity index 91% rename from quantum/tests/unit/nec/test_nec_agent.py rename to neutron/tests/unit/nec/test_nec_agent.py index a6d395f1eb..3440473957 100644 --- a/quantum/tests/unit/nec/test_nec_agent.py +++ b/neutron/tests/unit/nec/test_nec_agent.py @@ -23,10 +23,10 @@ import mock from oslo.config import cfg import testtools -from quantum.agent.linux import ovs_lib -from quantum.extensions import securitygroup as ext_sg -from quantum.plugins.nec.agent import nec_quantum_agent -from quantum.tests import base +from neutron.agent.linux import ovs_lib +from neutron.extensions import securitygroup as ext_sg +from neutron.plugins.nec.agent import nec_neutron_agent +from neutron.tests import base DAEMON_LOOP_COUNT = 10 OVS_DPID = '00000629355b6943' @@ -40,21 +40,21 @@ class TestNecAgentBase(base.BaseTestCase): self.addCleanup(cfg.CONF.reset) self.addCleanup(mock.patch.stopall) cfg.CONF.set_override('rpc_backend', - 'quantum.openstack.common.rpc.impl_fake') + 'neutron.openstack.common.rpc.impl_fake') cfg.CONF.set_override('host', 'dummy-host') with contextlib.nested( mock.patch.object(ovs_lib.OVSBridge, 'get_datapath_id', return_value=OVS_DPID), mock.patch('socket.gethostname', return_value='dummy-host'), - mock.patch('quantum.openstack.common.loopingcall.' + mock.patch('neutron.openstack.common.loopingcall.' 'FixedIntervalLoopingCall'), - mock.patch('quantum.agent.rpc.PluginReportStateAPI') + mock.patch('neutron.agent.rpc.PluginReportStateAPI') ) as (get_datapath_id, gethostname, loopingcall, state_rpc_api): kwargs = {'integ_br': 'integ_br', 'root_helper': 'dummy_wrapper', 'polling_interval': 1} - self.agent = nec_quantum_agent.NECQuantumAgent(**kwargs) + self.agent = nec_neutron_agent.NECNeutronAgent(**kwargs) self.loopingcall = loopingcall self.state_rpc_api = state_rpc_api @@ -93,7 +93,7 @@ class TestNecAgent(TestNecAgentBase): with contextlib.nested( mock.patch.object(time, 'sleep', side_effect=sleep_mock), mock.patch.object(ovs_lib.OVSBridge, 'get_vif_ports'), - mock.patch.object(nec_quantum_agent.NECPluginApi, 'update_ports'), + mock.patch.object(nec_neutron_agent.NECPluginApi, 'update_ports'), mock.patch.object(self.agent.sg_agent, 'prepare_devices_filter'), mock.patch.object(self.agent.sg_agent, 'remove_devices_filter') ) as (sleep, get_vif_potrs, update_ports, @@ -150,7 +150,7 @@ class TestNecAgent(TestNecAgentBase): self.num_ports_hist.append(num_ports) def _test_report_state(self, fail_mode): - log_mocked = mock.patch.object(nec_quantum_agent, 'LOG') + log_mocked = mock.patch.object(nec_neutron_agent, 'LOG') log_patched = log_mocked.start() def record_state(*args, **kwargs): @@ -184,7 +184,7 @@ class TestNecAgent(TestNecAgentBase): self.num_ports_hist)): rec, num_ports = x expected_state = { - 'binary': 'quantum-nec-agent', + 'binary': 'neutron-nec-agent', 'host': 'dummy-host', 'topic': 'N/A', 'configurations': {'devices': 0}, @@ -248,9 +248,9 @@ class TestNecAgentPluginApi(TestNecAgentBase): def _test_plugin_api(self, expected_failure=False): with contextlib.nested( - mock.patch.object(nec_quantum_agent.NECPluginApi, 'make_msg'), - mock.patch.object(nec_quantum_agent.NECPluginApi, 'call'), - mock.patch.object(nec_quantum_agent, 'LOG') + mock.patch.object(nec_neutron_agent.NECPluginApi, 'make_msg'), + mock.patch.object(nec_neutron_agent.NECPluginApi, 'call'), + mock.patch.object(nec_neutron_agent, 'LOG') ) as (make_msg, apicall, log): agent_id = 'nec-q-agent.dummy-host' if expected_failure: @@ -288,16 +288,16 @@ class TestNecAgentPluginApi(TestNecAgentBase): class TestNecAgentMain(base.BaseTestCase): def test_main(self): with contextlib.nested( - mock.patch.object(nec_quantum_agent, 'NECQuantumAgent'), + mock.patch.object(nec_neutron_agent, 'NECNeutronAgent'), mock.patch('eventlet.monkey_patch'), - mock.patch.object(nec_quantum_agent, 'logging_config'), - mock.patch.object(nec_quantum_agent, 'config') + mock.patch.object(nec_neutron_agent, 'logging_config'), + mock.patch.object(nec_neutron_agent, 'config') ) as (agent, eventlet, logging_config, cfg): cfg.OVS.integration_bridge = 'br-int-x' cfg.AGENT.root_helper = 'dummy-helper' cfg.AGENT.polling_interval = 10 - nec_quantum_agent.main() + nec_neutron_agent.main() self.assertTrue(eventlet.called) self.assertTrue(logging_config.setup_logging.called) diff --git a/quantum/tests/unit/nec/test_nec_plugin.py b/neutron/tests/unit/nec/test_nec_plugin.py similarity index 96% rename from quantum/tests/unit/nec/test_nec_plugin.py rename to neutron/tests/unit/nec/test_nec_plugin.py index c3ea46b9eb..5ed8c613b0 100644 --- a/quantum/tests/unit/nec/test_nec_plugin.py +++ b/neutron/tests/unit/nec/test_nec_plugin.py @@ -15,24 +15,24 @@ import mock -from quantum.common import topics -from quantum import context as q_context -from quantum.extensions import portbindings -from quantum import manager -from quantum.plugins.nec.common import exceptions as nexc -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec import nec_plugin -from quantum.tests.unit import _test_extension_portbindings as test_bindings -from quantum.tests.unit import test_db_plugin as test_plugin -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.common import topics +from neutron import context as q_context +from neutron.extensions import portbindings +from neutron import manager +from neutron.plugins.nec.common import exceptions as nexc +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec import nec_plugin +from neutron.tests.unit import _test_extension_portbindings as test_bindings +from neutron.tests.unit import test_db_plugin as test_plugin +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc -PLUGIN_NAME = 'quantum.plugins.nec.nec_plugin.NECPluginV2' -OFC_MANAGER = 'quantum.plugins.nec.nec_plugin.ofc_manager.OFCManager' -OFC_DRIVER = 'quantum.tests.unit.nec.stub_ofc_driver.StubOFCDriver' +PLUGIN_NAME = 'neutron.plugins.nec.nec_plugin.NECPluginV2' +OFC_MANAGER = 'neutron.plugins.nec.nec_plugin.ofc_manager.OFCManager' +OFC_DRIVER = 'neutron.tests.unit.nec.stub_ofc_driver.StubOFCDriver' -class NecPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class NecPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): _plugin_name = PLUGIN_NAME PACKET_FILTER_ENABLE = False @@ -44,7 +44,7 @@ class NecPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): ofc_driver.filter_supported.return_value = self.PACKET_FILTER_ENABLE super(NecPluginV2TestCase, self).setUp(self._plugin_name) self.context = q_context.get_admin_context() - self.plugin = manager.QuantumManager.get_plugin() + self.plugin = manager.NeutronManager.get_plugin() class TestNecBasicGet(test_plugin.TestBasicGet, NecPluginV2TestCase): diff --git a/quantum/tests/unit/nec/test_ofc_manager.py b/neutron/tests/unit/nec/test_ofc_manager.py similarity index 96% rename from quantum/tests/unit/nec/test_ofc_manager.py rename to neutron/tests/unit/nec/test_ofc_manager.py index 74d7e460c4..6b58608953 100644 --- a/quantum/tests/unit/nec/test_ofc_manager.py +++ b/neutron/tests/unit/nec/test_ofc_manager.py @@ -15,13 +15,13 @@ # under the License. # @author: Ryota MIBU -from quantum import context -from quantum.openstack.common import uuidutils -from quantum.plugins.nec.common import config -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec.db import models as nmodels # noqa -from quantum.plugins.nec import ofc_manager -from quantum.tests import base +from neutron import context +from neutron.openstack.common import uuidutils +from neutron.plugins.nec.common import config +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec.db import models as nmodels # noqa +from neutron.plugins.nec import ofc_manager +from neutron.tests import base class OFCManagerTestBase(base.BaseTestCase): @@ -29,7 +29,7 @@ class OFCManagerTestBase(base.BaseTestCase): def setUp(self): super(OFCManagerTestBase, self).setUp() - driver = "quantum.tests.unit.nec.stub_ofc_driver.StubOFCDriver" + driver = "neutron.tests.unit.nec.stub_ofc_driver.StubOFCDriver" config.CONF.set_override('driver', driver, 'OFC') ndb.initialize() self.addCleanup(ndb.clear_db) diff --git a/quantum/tests/unit/nec/test_pfc_driver.py b/neutron/tests/unit/nec/test_pfc_driver.py similarity index 96% rename from quantum/tests/unit/nec/test_pfc_driver.py rename to neutron/tests/unit/nec/test_pfc_driver.py index 421c007e39..229002f59e 100644 --- a/quantum/tests/unit/nec/test_pfc_driver.py +++ b/neutron/tests/unit/nec/test_pfc_driver.py @@ -20,13 +20,13 @@ import string import mox -from quantum import context -from quantum.openstack.common import uuidutils -from quantum.plugins.nec.common import ofc_client as ofc -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec.db import models as nmodels -from quantum.plugins.nec import drivers -from quantum.tests import base +from neutron import context +from neutron.openstack.common import uuidutils +from neutron.plugins.nec.common import ofc_client as ofc +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec.db import models as nmodels +from neutron.plugins.nec import drivers +from neutron.tests import base class TestConfig(object): @@ -45,7 +45,7 @@ def _ofc(id): class PFCDriverTestBase(base.BaseTestCase): - driver = 'quantum.plugins.nec.drivers.pfc.PFCDriverBase' + driver = 'neutron.plugins.nec.drivers.pfc.PFCDriverBase' def setUp(self): super(PFCDriverTestBase, self).setUp() @@ -204,7 +204,7 @@ class PFCV4DriverTest(PFCDriverTestBase): class PFCDriverStringTest(base.BaseTestCase): - driver = 'quantum.plugins.nec.drivers.pfc.PFCDriverBase' + driver = 'neutron.plugins.nec.drivers.pfc.PFCDriverBase' def setUp(self): super(PFCDriverStringTest, self).setUp() @@ -246,7 +246,7 @@ class PFCDriverStringTest(base.BaseTestCase): class PFCIdConvertTest(base.BaseTestCase): - driver = 'quantum.plugins.nec.drivers.pfc.PFCDriverBase' + driver = 'neutron.plugins.nec.drivers.pfc.PFCDriverBase' def setUp(self): super(PFCIdConvertTest, self).setUp() diff --git a/quantum/tests/unit/nec/test_security_group.py b/neutron/tests/unit/nec/test_security_group.py similarity index 83% rename from quantum/tests/unit/nec/test_security_group.py rename to neutron/tests/unit/nec/test_security_group.py index b66b938b1a..5a35e623a9 100644 --- a/quantum/tests/unit/nec/test_security_group.py +++ b/neutron/tests/unit/nec/test_security_group.py @@ -19,18 +19,18 @@ import contextlib import mock -from quantum.api.v2 import attributes -from quantum.extensions import securitygroup as ext_sg -from quantum import manager -from quantum.plugins.nec.db import api as ndb # noqa -from quantum.tests.unit.nec import test_nec_plugin -from quantum.tests.unit import test_extension_security_group as test_sg -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.api.v2 import attributes +from neutron.extensions import securitygroup as ext_sg +from neutron import manager +from neutron.plugins.nec.db import api as ndb # noqa +from neutron.tests.unit.nec import test_nec_plugin +from neutron.tests.unit import test_extension_security_group as test_sg +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc PLUGIN_NAME = test_nec_plugin.PLUGIN_NAME OFC_MANAGER = test_nec_plugin.OFC_MANAGER -AGENT_NAME = ('quantum.plugins.nec.agent.nec_quantum_agent.NECQuantumAgent') -NOTIFIER = ('quantum.plugins.nec.nec_plugin.NECPluginV2AgentNotifierApi') +AGENT_NAME = ('neutron.plugins.nec.agent.nec_neutron_agent.NECNeutronAgent') +NOTIFIER = ('neutron.plugins.nec.nec_plugin.NECPluginV2AgentNotifierApi') class NecSecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase): @@ -46,7 +46,7 @@ class NecSecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase): RESOURCE_ATTRIBUTE_MAP[item]. copy()) super(NecSecurityGroupsTestCase, self).setUp(PLUGIN_NAME) - self.notifier = manager.QuantumManager.get_plugin().notifier + self.notifier = manager.NeutronManager.get_plugin().notifier def tearDown(self): super(NecSecurityGroupsTestCase, self).tearDown() @@ -74,7 +74,7 @@ class TestNecSecurityGroups(NecSecurityGroupsTestCase, res = self.deserialize(self.fmt, req.get_response(self.api)) - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin.callback_sg.get_port_from_device(port_id) self.assertEqual(port_id, port_dict['id']) self.assertEqual([sg_id], diff --git a/quantum/tests/unit/nec/test_trema_driver.py b/neutron/tests/unit/nec/test_trema_driver.py similarity index 98% rename from quantum/tests/unit/nec/test_trema_driver.py rename to neutron/tests/unit/nec/test_trema_driver.py index 7ba2326b30..7f8015ed76 100644 --- a/quantum/tests/unit/nec/test_trema_driver.py +++ b/neutron/tests/unit/nec/test_trema_driver.py @@ -19,13 +19,13 @@ import random import mox -from quantum import context -from quantum.openstack.common import uuidutils -from quantum.plugins.nec.common import ofc_client -from quantum.plugins.nec.db import api as ndb -from quantum.plugins.nec.db import models as nmodels -from quantum.plugins.nec import drivers -from quantum.tests import base +from neutron import context +from neutron.openstack.common import uuidutils +from neutron.plugins.nec.common import ofc_client +from neutron.plugins.nec.db import api as ndb +from neutron.plugins.nec.db import models as nmodels +from neutron.plugins.nec import drivers +from neutron.tests import base class TestConfig(object): diff --git a/quantum/tests/unit/nicira/__init__.py b/neutron/tests/unit/nicira/__init__.py similarity index 100% rename from quantum/tests/unit/nicira/__init__.py rename to neutron/tests/unit/nicira/__init__.py diff --git a/quantum/tests/unit/nicira/etc/fake_get_gwservice.json b/neutron/tests/unit/nicira/etc/fake_get_gwservice.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_gwservice.json rename to neutron/tests/unit/nicira/etc/fake_get_gwservice.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_lqueue.json b/neutron/tests/unit/nicira/etc/fake_get_lqueue.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_lqueue.json rename to neutron/tests/unit/nicira/etc/fake_get_lqueue.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_lrouter.json b/neutron/tests/unit/nicira/etc/fake_get_lrouter.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_lrouter.json rename to neutron/tests/unit/nicira/etc/fake_get_lrouter.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_lrouter_lport.json b/neutron/tests/unit/nicira/etc/fake_get_lrouter_lport.json similarity index 85% rename from quantum/tests/unit/nicira/etc/fake_get_lrouter_lport.json rename to neutron/tests/unit/nicira/etc/fake_get_lrouter_lport.json index 5d6bfb0de9..df9fcbea7b 100644 --- a/quantum/tests/unit/nicira/etc/fake_get_lrouter_lport.json +++ b/neutron/tests/unit/nicira/etc/fake_get_lrouter_lport.json @@ -3,10 +3,10 @@ "admin_status_enabled": "%(admin_status_enabled)s", "_href": "/ws.v1/lrouter/%(lr_uuid)s/lport/%(uuid)s", "tags": - [{"scope": "q_port_id", "tag": "%(quantum_port_id)s"}, + [{"scope": "q_port_id", "tag": "%(neutron_port_id)s"}, {"scope": "os_tid", "tag": "%(tenant_id)s"}], "ip_addresses": %(ip_addresses_json)s, "_schema": "/ws.v1/schema/LogicalRouterPortConfig", "type": "LogicalRouterPortConfig", "uuid": "%(uuid)s" -} \ No newline at end of file +} diff --git a/quantum/tests/unit/nicira/etc/fake_get_lrouter_lport_att.json b/neutron/tests/unit/nicira/etc/fake_get_lrouter_lport_att.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_lrouter_lport_att.json rename to neutron/tests/unit/nicira/etc/fake_get_lrouter_lport_att.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_lrouter_nat.json b/neutron/tests/unit/nicira/etc/fake_get_lrouter_nat.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_lrouter_nat.json rename to neutron/tests/unit/nicira/etc/fake_get_lrouter_nat.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_lswitch.json b/neutron/tests/unit/nicira/etc/fake_get_lswitch.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_lswitch.json rename to neutron/tests/unit/nicira/etc/fake_get_lswitch.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_lswitch_lport.json b/neutron/tests/unit/nicira/etc/fake_get_lswitch_lport.json similarity index 84% rename from quantum/tests/unit/nicira/etc/fake_get_lswitch_lport.json rename to neutron/tests/unit/nicira/etc/fake_get_lswitch_lport.json index 0f5718c316..cbe987d359 100644 --- a/quantum/tests/unit/nicira/etc/fake_get_lswitch_lport.json +++ b/neutron/tests/unit/nicira/etc/fake_get_lswitch_lport.json @@ -8,8 +8,8 @@ "_schema": "/ws.v1/schema/LogicalSwitchPortStatus"} }, "tags": - [{"scope": "q_port_id", "tag": "%(quantum_port_id)s"}, - {"scope": "vm_id", "tag": "%(quantum_device_id)s"}, + [{"scope": "q_port_id", "tag": "%(neutron_port_id)s"}, + {"scope": "vm_id", "tag": "%(neutron_device_id)s"}, {"scope": "os_tid", "tag": "%(tenant_id)s"}], "uuid": "%(uuid)s", "admin_status_enabled": "%(admin_status_enabled)s", diff --git a/quantum/tests/unit/nicira/etc/fake_get_lswitch_lport_att.json b/neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_att.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_lswitch_lport_att.json rename to neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_att.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_lswitch_lport_status.json b/neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_status.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_lswitch_lport_status.json rename to neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_status.json diff --git a/quantum/tests/unit/nicira/etc/fake_get_security_profile.json b/neutron/tests/unit/nicira/etc/fake_get_security_profile.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_get_security_profile.json rename to neutron/tests/unit/nicira/etc/fake_get_security_profile.json diff --git a/quantum/tests/unit/nicira/etc/fake_post_gwservice.json b/neutron/tests/unit/nicira/etc/fake_post_gwservice.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_post_gwservice.json rename to neutron/tests/unit/nicira/etc/fake_post_gwservice.json diff --git a/quantum/tests/unit/nicira/etc/fake_post_lqueue.json b/neutron/tests/unit/nicira/etc/fake_post_lqueue.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_post_lqueue.json rename to neutron/tests/unit/nicira/etc/fake_post_lqueue.json diff --git a/quantum/tests/unit/nicira/etc/fake_post_lrouter.json b/neutron/tests/unit/nicira/etc/fake_post_lrouter.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_post_lrouter.json rename to neutron/tests/unit/nicira/etc/fake_post_lrouter.json diff --git a/quantum/tests/unit/nicira/etc/fake_post_lrouter_lport.json b/neutron/tests/unit/nicira/etc/fake_post_lrouter_lport.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_post_lrouter_lport.json rename to neutron/tests/unit/nicira/etc/fake_post_lrouter_lport.json diff --git a/quantum/tests/unit/nicira/etc/fake_post_lrouter_nat.json b/neutron/tests/unit/nicira/etc/fake_post_lrouter_nat.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_post_lrouter_nat.json rename to neutron/tests/unit/nicira/etc/fake_post_lrouter_nat.json diff --git a/quantum/tests/unit/nicira/etc/fake_post_lswitch.json b/neutron/tests/unit/nicira/etc/fake_post_lswitch.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_post_lswitch.json rename to neutron/tests/unit/nicira/etc/fake_post_lswitch.json diff --git a/quantum/tests/unit/nicira/etc/fake_post_lswitch_lport.json b/neutron/tests/unit/nicira/etc/fake_post_lswitch_lport.json similarity index 77% rename from quantum/tests/unit/nicira/etc/fake_post_lswitch_lport.json rename to neutron/tests/unit/nicira/etc/fake_post_lswitch_lport.json index 458adfbf07..cc8decf267 100644 --- a/quantum/tests/unit/nicira/etc/fake_post_lswitch_lport.json +++ b/neutron/tests/unit/nicira/etc/fake_post_lswitch_lport.json @@ -3,8 +3,8 @@ "_href": "/ws.v1/lswitch/%(ls_uuid)s/lport/%(uuid)s", "security_profiles": [], "tags": - [{"scope": "q_port_id", "tag": "%(quantum_port_id)s"}, - {"scope": "vm_id", "tag": "%(quantum_device_id)s"}, + [{"scope": "q_port_id", "tag": "%(neutron_port_id)s"}, + {"scope": "vm_id", "tag": "%(neutron_device_id)s"}, {"scope": "os_tid", "tag": "%(tenant_id)s"}], "portno": 1, "queue_uuid": null, diff --git a/quantum/tests/unit/nicira/etc/fake_post_security_profile.json b/neutron/tests/unit/nicira/etc/fake_post_security_profile.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_post_security_profile.json rename to neutron/tests/unit/nicira/etc/fake_post_security_profile.json diff --git a/quantum/tests/unit/nicira/etc/fake_put_lrouter_lport_att.json b/neutron/tests/unit/nicira/etc/fake_put_lrouter_lport_att.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_put_lrouter_lport_att.json rename to neutron/tests/unit/nicira/etc/fake_put_lrouter_lport_att.json diff --git a/quantum/tests/unit/nicira/etc/fake_put_lswitch_lport_att.json b/neutron/tests/unit/nicira/etc/fake_put_lswitch_lport_att.json similarity index 100% rename from quantum/tests/unit/nicira/etc/fake_put_lswitch_lport_att.json rename to neutron/tests/unit/nicira/etc/fake_put_lswitch_lport_att.json diff --git a/quantum/tests/unit/nicira/etc/quantum.conf.test b/neutron/tests/unit/nicira/etc/neutron.conf.test similarity index 100% rename from quantum/tests/unit/nicira/etc/quantum.conf.test rename to neutron/tests/unit/nicira/etc/neutron.conf.test diff --git a/quantum/tests/unit/nicira/etc/nvp.ini.basic.test b/neutron/tests/unit/nicira/etc/nvp.ini.basic.test similarity index 100% rename from quantum/tests/unit/nicira/etc/nvp.ini.basic.test rename to neutron/tests/unit/nicira/etc/nvp.ini.basic.test diff --git a/quantum/tests/unit/nicira/etc/nvp.ini.full.test b/neutron/tests/unit/nicira/etc/nvp.ini.full.test similarity index 100% rename from quantum/tests/unit/nicira/etc/nvp.ini.full.test rename to neutron/tests/unit/nicira/etc/nvp.ini.full.test diff --git a/quantum/tests/unit/nicira/etc/nvp.ini.grizzly.test b/neutron/tests/unit/nicira/etc/nvp.ini.grizzly.test similarity index 100% rename from quantum/tests/unit/nicira/etc/nvp.ini.grizzly.test rename to neutron/tests/unit/nicira/etc/nvp.ini.grizzly.test diff --git a/quantum/tests/unit/nicira/etc/nvp.ini.test b/neutron/tests/unit/nicira/etc/nvp.ini.test similarity index 100% rename from quantum/tests/unit/nicira/etc/nvp.ini.test rename to neutron/tests/unit/nicira/etc/nvp.ini.test diff --git a/quantum/tests/unit/nicira/fake_nvpapiclient.py b/neutron/tests/unit/nicira/fake_nvpapiclient.py similarity index 98% rename from quantum/tests/unit/nicira/fake_nvpapiclient.py rename to neutron/tests/unit/nicira/fake_nvpapiclient.py index 7ea7666fa2..bd2aceaffe 100644 --- a/quantum/tests/unit/nicira/fake_nvpapiclient.py +++ b/neutron/tests/unit/nicira/fake_nvpapiclient.py @@ -17,9 +17,9 @@ import json import urlparse -from quantum.openstack.common import log as logging -from quantum.openstack.common import uuidutils -from quantum.plugins.nicira import NvpApiClient +from neutron.openstack.common import log as logging +from neutron.openstack.common import uuidutils +from neutron.plugins.nicira import NvpApiClient LOG = logging.getLogger(__name__) @@ -191,9 +191,9 @@ class FakeClient: # for simplyfying templating fake_lport['ls_uuid'] = ls_uuid fake_lport['tenant_id'] = self._get_tag(fake_lport, 'os_tid') - fake_lport['quantum_port_id'] = self._get_tag(fake_lport, + fake_lport['neutron_port_id'] = self._get_tag(fake_lport, 'q_port_id') - fake_lport['quantum_device_id'] = self._get_tag(fake_lport, 'vm_id') + fake_lport['neutron_device_id'] = self._get_tag(fake_lport, 'vm_id') self._fake_lswitch_lport_dict[fake_lport['uuid']] = fake_lport fake_lswitch = self._fake_lswitch_dict[ls_uuid] @@ -215,7 +215,7 @@ class FakeClient: if lr_uuid: fake_lport['lr_uuid'] = lr_uuid fake_lport['tenant_id'] = self._get_tag(fake_lport, 'os_tid') - fake_lport['quantum_port_id'] = self._get_tag(fake_lport, + fake_lport['neutron_port_id'] = self._get_tag(fake_lport, 'q_port_id') # replace ip_address with its json dump if 'ip_addresses' in fake_lport: diff --git a/quantum/tests/unit/nicira/test_maclearning.py b/neutron/tests/unit/nicira/test_maclearning.py similarity index 92% rename from quantum/tests/unit/nicira/test_maclearning.py rename to neutron/tests/unit/nicira/test_maclearning.py index 8a7f5631ac..db05e45f5f 100644 --- a/quantum/tests/unit/nicira/test_maclearning.py +++ b/neutron/tests/unit/nicira/test_maclearning.py @@ -21,14 +21,14 @@ import os from oslo.config import cfg -from quantum.api.v2 import attributes -from quantum.common.test_lib import test_config -from quantum import context -from quantum.extensions import agent -from quantum.openstack.common import log as logging -import quantum.plugins.nicira as nvp_plugin -from quantum.tests.unit.nicira import fake_nvpapiclient -from quantum.tests.unit import test_db_plugin +from neutron.api.v2 import attributes +from neutron.common.test_lib import test_config +from neutron import context +from neutron.extensions import agent +from neutron.openstack.common import log as logging +import neutron.plugins.nicira as nvp_plugin +from neutron.tests.unit.nicira import fake_nvpapiclient +from neutron.tests.unit import test_db_plugin LOG = logging.getLogger(__name__) @@ -58,14 +58,14 @@ class MacLearningExtensionManager(object): return [] -class MacLearningDBTestCase(test_db_plugin.QuantumDbPluginV2TestCase): +class MacLearningDBTestCase(test_db_plugin.NeutronDbPluginV2TestCase): fmt = 'json' def setUp(self): self.adminContext = context.get_admin_context() test_config['config_files'] = [NVP_INI_CONFIG_PATH] test_config['plugin_name_v2'] = ( - 'quantum.plugins.nicira.QuantumPlugin.NvpPluginV2') + 'neutron.plugins.nicira.NeutronPlugin.NvpPluginV2') cfg.CONF.set_override('api_extensions_path', NVP_EXTENSIONS_PATH) # Save the original RESOURCE_ATTRIBUTE_MAP diff --git a/quantum/tests/unit/nicira/test_networkgw.py b/neutron/tests/unit/nicira/test_networkgw.py similarity index 96% rename from quantum/tests/unit/nicira/test_networkgw.py rename to neutron/tests/unit/nicira/test_networkgw.py index 8ba5618347..ba1875a664 100644 --- a/quantum/tests/unit/nicira/test_networkgw.py +++ b/neutron/tests/unit/nicira/test_networkgw.py @@ -20,21 +20,21 @@ from oslo.config import cfg from webob import exc import webtest -from quantum.api import extensions -from quantum.api.extensions import PluginAwareExtensionManager -from quantum.api.v2 import attributes -from quantum.common import config -from quantum.common.test_lib import test_config -from quantum import context -from quantum.db import api as db_api -from quantum.db import db_base_plugin_v2 -from quantum import manager -from quantum.plugins.nicira.dbexts import nicira_networkgw_db -from quantum.plugins.nicira.extensions import nvp_networkgw as networkgw -from quantum.tests import base -from quantum.tests.unit import test_api_v2 -from quantum.tests.unit import test_db_plugin -from quantum.tests.unit import test_extensions +from neutron.api import extensions +from neutron.api.extensions import PluginAwareExtensionManager +from neutron.api.v2 import attributes +from neutron.common import config +from neutron.common.test_lib import test_config +from neutron import context +from neutron.db import api as db_api +from neutron.db import db_base_plugin_v2 +from neutron import manager +from neutron.plugins.nicira.dbexts import nicira_networkgw_db +from neutron.plugins.nicira.extensions import nvp_networkgw as networkgw +from neutron.tests import base +from neutron.tests.unit import test_api_v2 +from neutron.tests.unit import test_db_plugin +from neutron.tests.unit import test_extensions _uuid = test_api_v2._uuid @@ -67,13 +67,13 @@ class NetworkGatewayExtensionTestCase(base.BaseTestCase): networkgw.NetworkGatewayPluginBase.__name__) self._resource = networkgw.RESOURCE_NAME.replace('-', '_') # Ensure 'stale' patched copies of the plugin are never returned - manager.QuantumManager._instance = None + manager.NeutronManager._instance = None # Ensure existing ExtensionManager is not used extensions.PluginAwareExtensionManager._instance = None # Create the default configurations - args = ['--config-file', test_api_v2.etcdir('quantum.conf.test')] + args = ['--config-file', test_api_v2.etcdir('neutron.conf.test')] config.parse(args=args) # Update the plugin and extensions path @@ -85,7 +85,7 @@ class NetworkGatewayExtensionTestCase(base.BaseTestCase): self.addCleanup(_plugin_patcher.stop) # Instantiate mock plugin and enable extensions - manager.QuantumManager.get_plugin().supported_extension_aliases = ( + manager.NeutronManager.get_plugin().supported_extension_aliases = ( [networkgw.EXT_ALIAS]) ext_mgr = TestExtensionManager() PluginAwareExtensionManager._instance = ext_mgr @@ -236,7 +236,7 @@ class NetworkGatewayExtensionTestCase(base.BaseTestCase): self.assertEqual(res.status_int, exc.HTTPOk.code) -class NetworkGatewayDbTestCase(test_db_plugin.QuantumDbPluginV2TestCase): +class NetworkGatewayDbTestCase(test_db_plugin.NeutronDbPluginV2TestCase): """Unit tests for Network Gateway DB support.""" def setUp(self): @@ -261,7 +261,7 @@ class NetworkGatewayDbTestCase(test_db_plugin.QuantumDbPluginV2TestCase): data, fmt) if (kwargs.get('set_context') and tenant_id): # create a specific auth context for this request - nw_gw_req.environ['quantum.context'] = context.Context( + nw_gw_req.environ['neutron.context'] = context.Context( '', tenant_id) return nw_gw_req.get_response(self.ext_api) @@ -618,7 +618,7 @@ class NetworkGatewayDbTestCase(test_db_plugin.QuantumDbPluginV2TestCase): 'vlan', 555) -class TestNetworkGatewayPlugin(db_base_plugin_v2.QuantumDbPluginV2, +class TestNetworkGatewayPlugin(db_base_plugin_v2.NeutronDbPluginV2, nicira_networkgw_db.NetworkGatewayMixin): """Simple plugin class for testing db support for network gateway ext.""" diff --git a/quantum/tests/unit/nicira/test_nicira_plugin.py b/neutron/tests/unit/nicira/test_nicira_plugin.py similarity index 95% rename from quantum/tests/unit/nicira/test_nicira_plugin.py rename to neutron/tests/unit/nicira/test_nicira_plugin.py index 8778d2b23d..d51d3543b1 100644 --- a/quantum/tests/unit/nicira/test_nicira_plugin.py +++ b/neutron/tests/unit/nicira/test_nicira_plugin.py @@ -21,36 +21,36 @@ import netaddr from oslo.config import cfg import webob.exc -from quantum.common import constants -import quantum.common.test_lib as test_lib -from quantum import context -from quantum.extensions import l3 -from quantum.extensions import providernet as pnet -from quantum.extensions import securitygroup as secgrp -from quantum import manager -from quantum.openstack.common import uuidutils -import quantum.plugins.nicira as nvp_plugin -from quantum.plugins.nicira.extensions import nvp_networkgw -from quantum.plugins.nicira.extensions import nvp_qos as ext_qos -from quantum.plugins.nicira import NvpApiClient -from quantum.plugins.nicira import nvplib -from quantum.plugins.nicira import QuantumPlugin -from quantum.tests.unit.nicira import fake_nvpapiclient -import quantum.tests.unit.nicira.test_networkgw as test_l2_gw -import quantum.tests.unit.test_db_plugin as test_plugin -import quantum.tests.unit.test_extension_portsecurity as psec -import quantum.tests.unit.test_extension_security_group as ext_sg -from quantum.tests.unit import test_extensions -import quantum.tests.unit.test_l3_plugin as test_l3_plugin -from quantum.tests.unit import testlib_api +from neutron.common import constants +import neutron.common.test_lib as test_lib +from neutron import context +from neutron.extensions import l3 +from neutron.extensions import providernet as pnet +from neutron.extensions import securitygroup as secgrp +from neutron import manager +from neutron.openstack.common import uuidutils +import neutron.plugins.nicira as nvp_plugin +from neutron.plugins.nicira.extensions import nvp_networkgw +from neutron.plugins.nicira.extensions import nvp_qos as ext_qos +from neutron.plugins.nicira import NeutronPlugin +from neutron.plugins.nicira import NvpApiClient +from neutron.plugins.nicira import nvplib +from neutron.tests.unit.nicira import fake_nvpapiclient +import neutron.tests.unit.nicira.test_networkgw as test_l2_gw +import neutron.tests.unit.test_db_plugin as test_plugin +import neutron.tests.unit.test_extension_portsecurity as psec +import neutron.tests.unit.test_extension_security_group as ext_sg +from neutron.tests.unit import test_extensions +import neutron.tests.unit.test_l3_plugin as test_l3_plugin +from neutron.tests.unit import testlib_api NICIRA_PKG_PATH = nvp_plugin.__name__ NICIRA_EXT_PATH = "../../plugins/nicira/extensions" -class NiciraPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class NiciraPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): - _plugin_name = ('%s.QuantumPlugin.NvpPluginV2' % NICIRA_PKG_PATH) + _plugin_name = ('%s.NeutronPlugin.NvpPluginV2' % NICIRA_PKG_PATH) def _create_network(self, fmt, name, admin_state_up, arg_list=None, providernet_args=None, **kwargs): @@ -68,7 +68,7 @@ class NiciraPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): network_req = self.new_create_request('networks', data, fmt) if (kwargs.get('set_context') and 'tenant_id' in kwargs): # create a specific auth context for this request - network_req.environ['quantum.context'] = context.Context( + network_req.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) return network_req.get_response(self.api) @@ -128,7 +128,7 @@ class TestNiciraPortsV2(test_plugin.TestPortsV2, NiciraPluginV2TestCase): with self.subnet(network=net) as sub: with self.port(subnet=sub): with self.port(subnet=sub): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() ls = nvplib.get_lswitches(plugin.cluster, net['network']['id']) self.assertEqual(len(ls), 2) @@ -154,7 +154,7 @@ class TestNiciraPortsV2(test_plugin.TestPortsV2, NiciraPluginV2TestCase): def test_create_port_name_exceeds_40_chars(self): name = 'this_is_a_port_whose_name_is_longer_than_40_chars' with self.port(name=name) as port: - # Assert the Quantum name is not truncated + # Assert the neutron name is not truncated self.assertEqual(name, port['port']['name']) @@ -229,7 +229,7 @@ class TestNiciraNetworksV2(test_plugin.TestNetworksV2, res = self.deserialize('json', req.get_response(self.api)) self.assertEqual(len(res['networks']), 2) req_2 = self.new_list_request('networks') - req_2.environ['quantum.context'] = context.Context('', + req_2.environ['neutron.context'] = context.Context('', 'somebody') res = self.deserialize('json', req_2.get_response(self.api)) # tenant must see a single network @@ -238,13 +238,13 @@ class TestNiciraNetworksV2(test_plugin.TestNetworksV2, def test_create_network_name_exceeds_40_chars(self): name = 'this_is_a_network_whose_name_is_longer_than_40_chars' with self.network(name=name) as net: - # Assert Quantum name is not truncated + # Assert neutron name is not truncated self.assertEqual(net['network']['name'], name) class NiciraPortSecurityTestCase(psec.PortSecurityDBTestCase): - _plugin_name = ('%s.QuantumPlugin.NvpPluginV2' % NICIRA_PKG_PATH) + _plugin_name = ('%s.NeutronPlugin.NvpPluginV2' % NICIRA_PKG_PATH) def setUp(self): etc_path = os.path.join(os.path.dirname(__file__), 'etc') @@ -272,7 +272,7 @@ class TestNiciraPortSecurity(psec.TestPortSecurity, class NiciraSecurityGroupsTestCase(ext_sg.SecurityGroupDBTestCase): - _plugin_name = ('%s.QuantumPlugin.NvpPluginV2' % NICIRA_PKG_PATH) + _plugin_name = ('%s.NeutronPlugin.NvpPluginV2' % NICIRA_PKG_PATH) def setUp(self): etc_path = os.path.join(os.path.dirname(__file__), 'etc') @@ -302,7 +302,7 @@ class TestNiciraSecurityGroup(ext_sg.TestSecurityGroups, def test_create_security_group_name_exceeds_40_chars(self): name = 'this_is_a_secgroup_whose_name_is_longer_than_40_chars' with self.security_group(name=name) as sg: - # Assert Quantum name is not truncated + # Assert Neutron name is not truncated self.assertEqual(sg['security_group']['name'], name) @@ -311,7 +311,7 @@ class TestNiciraL3NatTestCase(test_l3_plugin.L3NatDBTestCase, def _create_l3_ext_network(self, vlan_id=None): name = 'l3_ext_net' - net_type = QuantumPlugin.NetworkTypes.L3_EXT + net_type = NeutronPlugin.NetworkTypes.L3_EXT providernet_args = {pnet.NETWORK_TYPE: net_type, pnet.PHYSICAL_NETWORK: 'l3_gw_uuid'} if vlan_id: @@ -325,7 +325,7 @@ class TestNiciraL3NatTestCase(test_l3_plugin.L3NatDBTestCase, def _test_create_l3_ext_network(self, vlan_id=None): name = 'l3_ext_net' - net_type = QuantumPlugin.NetworkTypes.L3_EXT + net_type = NeutronPlugin.NetworkTypes.L3_EXT expected = [('subnets', []), ('name', name), ('admin_state_up', True), ('status', 'ACTIVE'), ('shared', False), (l3.EXTERNAL, True), @@ -444,13 +444,13 @@ class TestNiciraL3NatTestCase(test_l3_plugin.L3NatDBTestCase, def test_floatingip_with_assoc_fails(self): self._test_floatingip_with_assoc_fails( - 'quantum.plugins.nicira.' - 'QuantumPlugin.NvpPluginV2') + 'neutron.plugins.nicira.' + 'NeutronPlugin.NvpPluginV2') def test_floatingip_with_invalid_create_port(self): self._test_floatingip_with_invalid_create_port( - 'quantum.plugins.nicira.' - 'QuantumPlugin.NvpPluginV2') + 'neutron.plugins.nicira.' + 'NeutronPlugin.NvpPluginV2') def _nvp_metadata_setup(self): cfg.CONF.set_override('metadata_mode', 'access_network', 'NVP') @@ -461,7 +461,7 @@ class TestNiciraL3NatTestCase(test_l3_plugin.L3NatDBTestCase, def test_create_router_name_exceeds_40_chars(self): name = 'this_is_a_router_whose_name_is_longer_than_40_chars' with self.router(name=name) as rtr: - # Assert Quantum name is not truncated + # Assert Neutron name is not truncated self.assertEqual(rtr['router']['name'], name) def test_router_add_interface_subnet_with_metadata_access(self): @@ -616,7 +616,7 @@ class TestNiciraQoSQueue(NiciraPluginV2TestCase): qos_queue = self.new_create_request('qos-queues', body) if (kwargs.get('set_context') and 'tenant_id' in kwargs): # create a specific auth context for this request - qos_queue.environ['quantum.context'] = context.Context( + qos_queue.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) return qos_queue.get_response(self.ext_api) @@ -660,7 +660,7 @@ class TestNiciraQoSQueue(NiciraPluginV2TestCase): def test_create_qos_queue_name_exceeds_40_chars(self): name = 'this_is_a_queue_whose_name_is_longer_than_40_chars' with self.qos_queue(name=name) as queue: - # Assert Quantum name is not truncated + # Assert Neutron name is not truncated self.assertEqual(queue['qos_queue']['name'], name) def test_create_qos_queue_default(self): @@ -800,9 +800,9 @@ class TestNiciraQoSQueue(NiciraPluginV2TestCase): port = self.deserialize('json', res) device_id = "00fff4d0-e4a8-4a3a-8906-4c4cdafb59f1" data = {'port': {'device_id': device_id}} - quantum_context = context.Context('', 'not_admin') + neutron_context = context.Context('', 'not_admin') port = self._update('ports', port['port']['id'], data, - quantum_context=quantum_context) + neutron_context=neutron_context) self.assertFalse(ext_qos.QUEUE in port['port']) def test_rxtx_factor(self): @@ -823,7 +823,7 @@ class TestNiciraQoSQueue(NiciraPluginV2TestCase): self.assertEqual(queue['qos_queue']['max'], 20) -class NiciraQuantumNVPOutOfSync(test_l3_plugin.L3NatTestCaseBase, +class NiciraNeutronNVPOutOfSync(test_l3_plugin.L3NatTestCaseBase, NiciraPluginV2TestCase): def test_delete_network_not_in_nvp(self): @@ -1017,7 +1017,7 @@ class TestNiciraNetworkGateway(test_l2_gw.NetworkGatewayDbTestCase, def test_create_network_gateway_name_exceeds_40_chars(self): name = 'this_is_a_gateway_whose_name_is_longer_than_40_chars' with self._network_gateway(name=name) as nw_gw: - # Assert Quantum name is not truncated + # Assert Neutron name is not truncated self.assertEqual(nw_gw[self.resource]['name'], name) def test_create_network_gateway_nvp_error_returns_500(self): diff --git a/quantum/tests/unit/nicira/test_nvp_api_common.py b/neutron/tests/unit/nicira/test_nvp_api_common.py similarity index 90% rename from quantum/tests/unit/nicira/test_nvp_api_common.py rename to neutron/tests/unit/nicira/test_nvp_api_common.py index ded8349a85..a03776e246 100644 --- a/quantum/tests/unit/nicira/test_nvp_api_common.py +++ b/neutron/tests/unit/nicira/test_nvp_api_common.py @@ -9,8 +9,8 @@ import httplib # Local -import quantum.plugins.nicira.api_client.common as naco -from quantum.tests import base +import neutron.plugins.nicira.api_client.common as naco +from neutron.tests import base class NvpApiCommonTest(base.BaseTestCase): diff --git a/quantum/tests/unit/nicira/test_nvp_api_request.py b/neutron/tests/unit/nicira/test_nvp_api_request.py similarity index 95% rename from quantum/tests/unit/nicira/test_nvp_api_request.py rename to neutron/tests/unit/nicira/test_nvp_api_request.py index 2343e2297d..2a13d3b5bb 100644 --- a/quantum/tests/unit/nicira/test_nvp_api_request.py +++ b/neutron/tests/unit/nicira/test_nvp_api_request.py @@ -10,7 +10,7 @@ eventlet.monkey_patch() import logging import urllib2 -from quantum.tests import base +from neutron.tests import base logging.basicConfig(level=logging.DEBUG) lg = logging.getLogger("test_nvp_api_request") diff --git a/quantum/tests/unit/nicira/test_nvp_api_request_eventlet.py b/neutron/tests/unit/nicira/test_nvp_api_request_eventlet.py similarity index 97% rename from quantum/tests/unit/nicira/test_nvp_api_request_eventlet.py rename to neutron/tests/unit/nicira/test_nvp_api_request_eventlet.py index b52941b9d1..4bab26f9a3 100644 --- a/quantum/tests/unit/nicira/test_nvp_api_request_eventlet.py +++ b/neutron/tests/unit/nicira/test_nvp_api_request_eventlet.py @@ -22,11 +22,11 @@ from eventlet.green import urllib2 from mock import Mock from mock import patch -from quantum.plugins.nicira.api_client import ( +from neutron.plugins.nicira.api_client import ( client_eventlet as nace, request_eventlet as nare, ) -from quantum.tests import base +from neutron.tests import base logging.basicConfig(level=logging.DEBUG) @@ -212,7 +212,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase): self.assertTrue(retval is None) def test_redirect_params_setup_https_with_cooki(self): - with patch('quantum.plugins.nicira.api_client.' + with patch('neutron.plugins.nicira.api_client.' 'client_eventlet.NvpApiClientEventlet') as mock: api_client = mock.return_value self.req._api_client = api_client @@ -224,7 +224,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase): self.assertTrue(api_client.acquire_redirect_connection.called) def test_redirect_params_setup_htttps_and_query(self): - with patch('quantum.plugins.nicira.api_client.' + with patch('neutron.plugins.nicira.api_client.' 'client_eventlet.NvpApiClientEventlet') as mock: api_client = mock.return_value self.req._api_client = api_client @@ -236,7 +236,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase): self.assertTrue(api_client.acquire_redirect_connection.called) def test_redirect_params_setup_https_connection_no_cookie(self): - with patch('quantum.plugins.nicira.api_client.' + with patch('neutron.plugins.nicira.api_client.' 'client_eventlet.NvpApiClientEventlet') as mock: api_client = mock.return_value self.req._api_client = api_client @@ -248,7 +248,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase): self.assertTrue(api_client.acquire_redirect_connection.called) def test_redirect_params_setup_https_and_query_no_cookie(self): - with patch('quantum.plugins.nicira.api_client.' + with patch('neutron.plugins.nicira.api_client.' 'client_eventlet.NvpApiClientEventlet') as mock: api_client = mock.return_value self.req._api_client = api_client @@ -259,7 +259,7 @@ class NvpApiRequestEventletTest(base.BaseTestCase): self.assertTrue(api_client.acquire_redirect_connection.called) def test_redirect_params_path_only_with_query(self): - with patch('quantum.plugins.nicira.api_client.' + with patch('neutron.plugins.nicira.api_client.' 'client_eventlet.NvpApiClientEventlet') as mock: api_client = mock.return_value api_client.wait_for_login.return_value = None diff --git a/quantum/tests/unit/nicira/test_nvplib.py b/neutron/tests/unit/nicira/test_nvplib.py similarity index 95% rename from quantum/tests/unit/nicira/test_nvplib.py rename to neutron/tests/unit/nicira/test_nvplib.py index 0153ab2671..0a98f77c5d 100644 --- a/quantum/tests/unit/nicira/test_nvplib.py +++ b/neutron/tests/unit/nicira/test_nvplib.py @@ -18,17 +18,17 @@ import mock import os -from quantum.common import constants -from quantum.common import exceptions -import quantum.plugins.nicira as nvp_plugin -from quantum.plugins.nicira.common import config # noqa -from quantum.plugins.nicira.common import exceptions as nvp_exc -from quantum.plugins.nicira import nvp_cluster -from quantum.plugins.nicira import NvpApiClient -from quantum.plugins.nicira import nvplib -from quantum.tests import base -from quantum.tests.unit.nicira import fake_nvpapiclient -from quantum.tests.unit import test_api_v2 +from neutron.common import constants +from neutron.common import exceptions +import neutron.plugins.nicira as nvp_plugin +from neutron.plugins.nicira.common import config # noqa +from neutron.plugins.nicira.common import exceptions as nvp_exc +from neutron.plugins.nicira import nvp_cluster +from neutron.plugins.nicira import NvpApiClient +from neutron.plugins.nicira import nvplib +from neutron.tests import base +from neutron.tests.unit.nicira import fake_nvpapiclient +from neutron.tests.unit import test_api_v2 NICIRA_PKG_PATH = nvp_plugin.__name__ _uuid = test_api_v2._uuid @@ -311,7 +311,7 @@ class TestNvplibLogicalSwitches(NvplibTestCase): # Create secondary lswitch nvplib.create_lswitch( self.fake_cluster, tenant_id, 'fake-switch-2', - quantum_net_id=main_lswitch['uuid']) + neutron_net_id=main_lswitch['uuid']) res_lswitch = nvplib.get_lswitches(self.fake_cluster, main_lswitch['uuid']) self.assertEqual(len(res_lswitch), 2) @@ -472,7 +472,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): def test_query_lrouter_lports_nonexistent_lrouter_raises(self): self.assertRaises( exceptions.NotFound, nvplib.create_router_lport, - self.fake_cluster, 'booo', 'pippo', 'quantum_port_id', + self.fake_cluster, 'booo', 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) def test_create_and_get_lrouter_port(self): @@ -481,7 +481,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) ports = nvplib.query_lrouter_lports(self.fake_cluster, lrouter['uuid']) self.assertEqual(len(ports), 1) @@ -491,12 +491,12 @@ class TestNvplibLogicalRouters(NvplibTestCase): self.assertIn('os_tid', port_tags) self.assertIn('q_port_id', port_tags) self.assertEqual('pippo', port_tags['os_tid']) - self.assertEqual('quantum_port_id', port_tags['q_port_id']) + self.assertEqual('neutron_port_id', port_tags['q_port_id']) def test_create_lrouter_port_nonexistent_router_raises(self): self.assertRaises( exceptions.NotFound, nvplib.create_router_lport, - self.fake_cluster, 'booo', 'pippo', 'quantum_port_id', + self.fake_cluster, 'booo', 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) def test_update_lrouter_port(self): @@ -505,7 +505,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) nvplib.update_router_lport( self.fake_cluster, lrouter['uuid'], lrouter_port['uuid'], @@ -528,7 +528,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): self.assertRaises( exceptions.NotFound, nvplib.update_router_lport, self.fake_cluster, 'boo-router', 'boo-port', 'pippo', - 'quantum_port_id', 'name', True, ['192.168.0.1']) + 'neutron_port_id', 'name', True, ['192.168.0.1']) def test_update_lrouter_port_nonexistent_port_raises(self): lrouter = nvplib.create_lrouter(self.fake_cluster, @@ -538,7 +538,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): self.assertRaises( exceptions.NotFound, nvplib.update_router_lport, self.fake_cluster, lrouter['uuid'], 'boo-port', 'pippo', - 'quantum_port_id', 'name', True, ['192.168.0.1']) + 'neutron_port_id', 'name', True, ['192.168.0.1']) def test_delete_lrouter_port(self): lrouter = nvplib.create_lrouter(self.fake_cluster, @@ -591,7 +591,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) nvplib.update_lrouter_port_ips( self.fake_cluster, lrouter['uuid'], lrouter_port['uuid'], @@ -608,7 +608,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1', '10.10.10.254']) nvplib.update_lrouter_port_ips( self.fake_cluster, lrouter['uuid'], lrouter_port['uuid'], @@ -624,7 +624,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) nvplib.update_lrouter_port_ips( self.fake_cluster, lrouter['uuid'], lrouter_port['uuid'], @@ -645,7 +645,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) def raise_nvp_exc(*args, **kwargs): @@ -669,7 +669,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) result = nvplib.plug_router_port_attachment( self.fake_cluster, lrouter['uuid'], @@ -684,7 +684,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) result = nvplib.plug_router_port_attachment( self.fake_cluster, lrouter['uuid'], @@ -700,7 +700,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) result = nvplib.plug_router_port_attachment( self.fake_cluster, lrouter['uuid'], @@ -719,7 +719,7 @@ class TestNvplibLogicalRouters(NvplibTestCase): 'fake-lrouter', '10.0.0.1') lrouter_port = nvplib.create_router_lport( - self.fake_cluster, lrouter['uuid'], 'pippo', 'quantum_port_id', + self.fake_cluster, lrouter['uuid'], 'pippo', 'neutron_port_id', 'name', True, ['192.168.0.1']) self.assertRaises(Exception, nvplib.plug_router_port_attachment, @@ -958,7 +958,7 @@ class TestNvplibSecurityProfile(NvplibTestCase): sec_prof_res['logical_port_ingress_rules']) def test_update_non_existing_securityprofile_raises(self): - self.assertRaises(exceptions.QuantumException, + self.assertRaises(exceptions.NeutronException, nvplib.update_security_group_rules, self.fake_cluster, 'whatever', {'logical_port_egress_rules': [], @@ -977,7 +977,7 @@ class TestNvplibSecurityProfile(NvplibTestCase): cluster=self.fake_cluster) def test_delete_non_existing_securityprofile_raises(self): - self.assertRaises(exceptions.QuantumException, + self.assertRaises(exceptions.NeutronException, nvplib.delete_security_profile, self.fake_cluster, 'whatever') @@ -1004,7 +1004,7 @@ class TestNvplibLQueue(NvplibTestCase): with mock.patch.object(nvplib, 'do_request', new=raise_nvp_exc): self.assertRaises( - exceptions.QuantumException, nvplib.create_lqueue, + exceptions.NeutronException, nvplib.create_lqueue, self.fake_cluster, {}) def test_delete_lqueue(self): @@ -1023,7 +1023,7 @@ class TestNvplibLQueue(NvplibTestCase): cluster=self.fake_cluster) def test_delete_non_existing_lqueue_raises(self): - self.assertRaises(exceptions.QuantumException, + self.assertRaises(exceptions.NeutronException, nvplib.delete_lqueue, self.fake_cluster, 'whatever') @@ -1031,11 +1031,11 @@ class TestNvplibLQueue(NvplibTestCase): class TestNvplibLogicalPorts(NvplibTestCase): def _create_switch_and_port(self, tenant_id='pippo', - quantum_port_id='whatever'): + neutron_port_id='whatever'): lswitch = nvplib.create_lswitch(self.fake_cluster, tenant_id, 'fake-switch') lport = nvplib.create_lport(self.fake_cluster, lswitch['uuid'], - tenant_id, quantum_port_id, + tenant_id, neutron_port_id, 'name', 'device_id', True) return lswitch, lport @@ -1060,7 +1060,7 @@ class TestNvplibLogicalPorts(NvplibTestCase): def test_get_port_by_tag(self): lswitch, lport = self._create_switch_and_port() - lport2 = nvplib.get_port_by_quantum_tag(self.fake_cluster, + lport2 = nvplib.get_port_by_neutron_tag(self.fake_cluster, lswitch['uuid'], 'whatever') self.assertIsNotNone(lport2) @@ -1068,12 +1068,12 @@ class TestNvplibLogicalPorts(NvplibTestCase): def test_get_port_by_tag_not_found_returns_None(self): tenant_id = 'pippo' - quantum_port_id = 'whatever' + neutron_port_id = 'whatever' lswitch = nvplib.create_lswitch(self.fake_cluster, tenant_id, 'fake-switch') - lport = nvplib.get_port_by_quantum_tag(self.fake_cluster, + lport = nvplib.get_port_by_neutron_tag(self.fake_cluster, lswitch['uuid'], - quantum_port_id) + neutron_port_id) self.assertIsNone(lport) def test_get_port_status(self): @@ -1093,7 +1093,7 @@ class TestNvplibLogicalPorts(NvplibTestCase): lswitch, lport = self._create_switch_and_port() nvplib.update_port( self.fake_cluster, lswitch['uuid'], lport['uuid'], - 'quantum_port_id', 'pippo2', 'new_name', 'device_id', False) + 'neutron_port_id', 'pippo2', 'new_name', 'device_id', False) lport_res = nvplib.get_port(self.fake_cluster, lswitch['uuid'], lport['uuid']) self.assertEqual(lport['uuid'], lport_res['uuid']) diff --git a/quantum/tests/unit/nicira/test_nvpopts.py b/neutron/tests/unit/nicira/test_nvpopts.py similarity index 89% rename from quantum/tests/unit/nicira/test_nvpopts.py rename to neutron/tests/unit/nicira/test_nvpopts.py index c32aaa4efd..e21a971c48 100644 --- a/quantum/tests/unit/nicira/test_nvpopts.py +++ b/neutron/tests/unit/nicira/test_nvpopts.py @@ -19,25 +19,25 @@ import testtools from oslo.config import cfg -from quantum.common import config as q_config -from quantum.manager import QuantumManager -from quantum.openstack.common import uuidutils -from quantum.plugins.nicira.common import config # noqa -from quantum.plugins.nicira.common import exceptions -from quantum.plugins.nicira import nvp_cluster +from neutron.common import config as q_config +from neutron.manager import NeutronManager +from neutron.openstack.common import uuidutils +from neutron.plugins.nicira.common import config # noqa +from neutron.plugins.nicira.common import exceptions +from neutron.plugins.nicira import nvp_cluster BASE_CONF_PATH = os.path.join(os.path.dirname(__file__), - '../../etc/quantum.conf.test') + '../../etc/neutron.conf.test') NVP_BASE_CONF_PATH = os.path.join(os.path.dirname(__file__), - 'etc/quantum.conf.test') + 'etc/neutron.conf.test') NVP_INI_PATH = os.path.join(os.path.dirname(__file__), 'etc/nvp.ini.basic.test') NVP_INI_FULL_PATH = os.path.join(os.path.dirname(__file__), 'etc/nvp.ini.full.test') NVP_INI_DEPR_PATH = os.path.join(os.path.dirname(__file__), 'etc/nvp.ini.grizzly.test') -NVP_PLUGIN_PATH = ('quantum.plugins.nicira.nicira_nvp_plugin.' - 'QuantumPlugin.NvpPluginV2') +NVP_PLUGIN_PATH = ('neutron.plugins.nicira.nicira_nvp_plugin.' + 'NeutronPlugin.NvpPluginV2') class NVPClusterTest(testtools.TestCase): @@ -84,7 +84,7 @@ class ConfigurationTest(testtools.TestCase): super(ConfigurationTest, self).setUp() self.addCleanup(cfg.CONF.reset) self.useFixture(fixtures.MonkeyPatch( - 'quantum.manager.QuantumManager._instance', + 'neutron.manager.NeutronManager._instance', None)) def _assert_required_options(self, cluster): @@ -106,7 +106,7 @@ class ConfigurationTest(testtools.TestCase): q_config.parse(['--config-file', BASE_CONF_PATH, '--config-file', NVP_INI_FULL_PATH]) cfg.CONF.set_override('core_plugin', NVP_PLUGIN_PATH) - plugin = QuantumManager().get_plugin() + plugin = NeutronManager().get_plugin() cluster = plugin.cluster self._assert_required_options(cluster) self._assert_extra_options(cluster) @@ -115,7 +115,7 @@ class ConfigurationTest(testtools.TestCase): q_config.parse(['--config-file', BASE_CONF_PATH, '--config-file', NVP_INI_PATH]) cfg.CONF.set_override('core_plugin', NVP_PLUGIN_PATH) - plugin = QuantumManager().get_plugin() + plugin = NeutronManager().get_plugin() self._assert_required_options(plugin.cluster) def test_defaults(self): @@ -143,7 +143,7 @@ class ConfigurationTest(testtools.TestCase): '--config-file', NVP_INI_FULL_PATH]) cfg.CONF.set_override('core_plugin', NVP_PLUGIN_PATH) # Load the configuration, and initialize the plugin - QuantumManager().get_plugin() + NeutronManager().get_plugin() self.assertIn('extensions', cfg.CONF.api_extensions_path) @@ -153,7 +153,7 @@ class OldConfigurationTest(testtools.TestCase): super(OldConfigurationTest, self).setUp() self.addCleanup(cfg.CONF.reset) self.useFixture(fixtures.MonkeyPatch( - 'quantum.manager.QuantumManager._instance', + 'neutron.manager.NeutronManager._instance', None)) def _assert_required_options(self, cluster): @@ -166,7 +166,7 @@ class OldConfigurationTest(testtools.TestCase): q_config.parse(['--config-file', BASE_CONF_PATH, '--config-file', NVP_INI_DEPR_PATH]) cfg.CONF.set_override('core_plugin', NVP_PLUGIN_PATH) - plugin = QuantumManager().get_plugin() + plugin = NeutronManager().get_plugin() cluster = plugin.cluster self._assert_required_options(cluster) # Verify nvp_controller_connection has been fully parsed diff --git a/quantum/tests/unit/openvswitch/__init__.py b/neutron/tests/unit/openvswitch/__init__.py similarity index 100% rename from quantum/tests/unit/openvswitch/__init__.py rename to neutron/tests/unit/openvswitch/__init__.py diff --git a/quantum/tests/unit/openvswitch/test_agent_scheduler.py b/neutron/tests/unit/openvswitch/test_agent_scheduler.py similarity index 95% rename from quantum/tests/unit/openvswitch/test_agent_scheduler.py rename to neutron/tests/unit/openvswitch/test_agent_scheduler.py index 30ab21c46d..8dbe0c1d31 100644 --- a/quantum/tests/unit/openvswitch/test_agent_scheduler.py +++ b/neutron/tests/unit/openvswitch/test_agent_scheduler.py @@ -20,25 +20,25 @@ import mock from oslo.config import cfg from webob import exc -from quantum.api import extensions -from quantum.api.rpc.agentnotifiers import dhcp_rpc_agent_api -from quantum.api.v2 import attributes -from quantum.common import constants -from quantum import context -from quantum.db import agents_db -from quantum.db import dhcp_rpc_base -from quantum.db import l3_rpc_base -from quantum.extensions import agent -from quantum.extensions import agentscheduler -from quantum import manager -from quantum.openstack.common import timeutils -from quantum.openstack.common import uuidutils -from quantum.tests.unit import test_agent_ext_plugin -from quantum.tests.unit import test_db_plugin as test_plugin -from quantum.tests.unit import test_extensions -from quantum.tests.unit import test_l3_plugin -from quantum.tests.unit.testlib_api import create_request -from quantum.wsgi import Serializer +from neutron.api import extensions +from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api +from neutron.api.v2 import attributes +from neutron.common import constants +from neutron import context +from neutron.db import agents_db +from neutron.db import dhcp_rpc_base +from neutron.db import l3_rpc_base +from neutron.extensions import agent +from neutron.extensions import agentscheduler +from neutron import manager +from neutron.openstack.common import timeutils +from neutron.openstack.common import uuidutils +from neutron.tests.unit import test_agent_ext_plugin +from neutron.tests.unit import test_db_plugin as test_plugin +from neutron.tests.unit import test_extensions +from neutron.tests.unit import test_l3_plugin +from neutron.tests.unit.testlib_api import create_request +from neutron.wsgi import Serializer L3_HOSTA = 'hosta' DHCP_HOSTA = 'hosta' @@ -191,10 +191,10 @@ class AgentSchedulerTestMixIn(object): class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, test_agent_ext_plugin.AgentDBTestMixIn, AgentSchedulerTestMixIn, - test_plugin.QuantumDbPluginV2TestCase): + test_plugin.NeutronDbPluginV2TestCase): fmt = 'json' - plugin_str = ('quantum.plugins.openvswitch.' - 'ovs_quantum_plugin.OVSQuantumPluginV2') + plugin_str = ('neutron.plugins.openvswitch.' + 'ovs_neutron_plugin.OVSNeutronPluginV2') def setUp(self): # Save the global RESOURCE_ATTRIBUTE_MAP @@ -212,7 +212,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, attributes.RESOURCE_ATTRIBUTE_MAP.update( agent.RESOURCE_ATTRIBUTE_MAP) self.addCleanup(self.restore_attribute_map) - self.agentscheduler_dbMinxin = manager.QuantumManager.get_plugin() + self.agentscheduler_dbMinxin = manager.NeutronManager.get_plugin() def restore_attribute_map(self): # Restore the original RESOURCE_ATTRIBUTE_MAP @@ -332,7 +332,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, # one agent hosts one network dhcp_rpc = dhcp_rpc_base.DhcpRpcCallbackMixin() dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'DHCP_AGENT', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -424,7 +424,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, def test_network_scheduler_with_disabled_agent(self): dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'DHCP_AGENT', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -445,7 +445,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, def test_network_scheduler_with_down_agent(self): dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'DHCP_AGENT', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -453,7 +453,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, }, 'agent_type': constants.AGENT_TYPE_DHCP} self._register_one_agent_state(dhcp_hosta) - is_agent_down_str = 'quantum.db.agents_db.AgentDbMixin.is_agent_down' + is_agent_down_str = 'neutron.db.agents_db.AgentDbMixin.is_agent_down' with mock.patch(is_agent_down_str) as mock_is_agent_down: mock_is_agent_down.return_value = False with self.port() as port: @@ -468,9 +468,9 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, self.assertEqual(0, len(dhcp_agents['agents'])) def test_network_scheduler_with_hosted_network(self): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'DHCP_AGENT', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -541,7 +541,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, def test_network_remove_from_dhcp_agent(self): dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'DHCP_AGENT', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -585,7 +585,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, # one agent hosts one router l3_rpc = l3_rpc_base.L3RpcCallbackMixin() l3_hosta = { - 'binary': 'quantum-l3-agent', + 'binary': 'neutron-l3-agent', 'host': L3_HOSTA, 'topic': 'L3_AGENT', 'configurations': {'use_namespaces': True, @@ -650,7 +650,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, def test_router_auto_schedule_with_candidates(self): l3_hosta = { - 'binary': 'quantum-l3-agent', + 'binary': 'neutron-l3-agent', 'host': L3_HOSTA, 'topic': 'L3_AGENT', 'configurations': {'use_namespaces': False, @@ -683,7 +683,7 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, def test_router_schedule_with_candidates(self): l3_hosta = { - 'binary': 'quantum-l3-agent', + 'binary': 'neutron-l3-agent', 'host': L3_HOSTA, 'topic': 'L3_AGENT', 'configurations': {'use_namespaces': False, @@ -862,14 +862,14 @@ class OvsAgentSchedulerTestCase(test_l3_plugin.L3NatTestCaseMixin, class OvsDhcpAgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, test_agent_ext_plugin.AgentDBTestMixIn, AgentSchedulerTestMixIn, - test_plugin.QuantumDbPluginV2TestCase): - plugin_str = ('quantum.plugins.openvswitch.' - 'ovs_quantum_plugin.OVSQuantumPluginV2') + test_plugin.NeutronDbPluginV2TestCase): + plugin_str = ('neutron.plugins.openvswitch.' + 'ovs_neutron_plugin.OVSNeutronPluginV2') def setUp(self): self.dhcp_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI() self.dhcp_notifier_cls_p = mock.patch( - 'quantum.api.rpc.agentnotifiers.dhcp_rpc_agent_api.' + 'neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.' 'DhcpAgentNotifyAPI') self.dhcp_notifier_cls = self.dhcp_notifier_cls_p.start() self.dhcp_notifier_cls.return_value = self.dhcp_notifier @@ -887,7 +887,7 @@ class OvsDhcpAgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, # the global attribute map attributes.RESOURCE_ATTRIBUTE_MAP.update( agent.RESOURCE_ATTRIBUTE_MAP) - self.agentscheduler_dbMinxin = manager.QuantumManager.get_plugin() + self.agentscheduler_dbMinxin = manager.NeutronManager.get_plugin() self.addCleanup(self.dhcp_notifier_cls_p.stop) self.addCleanup(self.restore_attribute_map) @@ -943,7 +943,7 @@ class OvsDhcpAgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, def test_network_port_create_notification(self): dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'dhcp_agent', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -975,7 +975,7 @@ class OvsDhcpAgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, def test_network_ha_port_create_notification(self): cfg.CONF.set_override('dhcp_agents_per_network', 2) dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'dhcp_agent', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -1027,13 +1027,13 @@ class OvsDhcpAgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, class OvsL3AgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, test_agent_ext_plugin.AgentDBTestMixIn, AgentSchedulerTestMixIn, - test_plugin.QuantumDbPluginV2TestCase): - plugin_str = ('quantum.plugins.openvswitch.' - 'ovs_quantum_plugin.OVSQuantumPluginV2') + test_plugin.NeutronDbPluginV2TestCase): + plugin_str = ('neutron.plugins.openvswitch.' + 'ovs_neutron_plugin.OVSNeutronPluginV2') def setUp(self): self.dhcp_notifier_cls_p = mock.patch( - 'quantum.api.rpc.agentnotifiers.dhcp_rpc_agent_api.' + 'neutron.api.rpc.agentnotifiers.dhcp_rpc_agent_api.' 'DhcpAgentNotifyAPI') self.dhcp_notifier = mock.Mock(name='dhcp_notifier') self.dhcp_notifier_cls = self.dhcp_notifier_cls_p.start() @@ -1052,7 +1052,7 @@ class OvsL3AgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, # the global attribute map attributes.RESOURCE_ATTRIBUTE_MAP.update( agent.RESOURCE_ATTRIBUTE_MAP) - self.agentscheduler_dbMinxin = manager.QuantumManager.get_plugin() + self.agentscheduler_dbMinxin = manager.NeutronManager.get_plugin() self.addCleanup(self.dhcp_notifier_cls_p.stop) self.addCleanup(self.restore_attribute_map) @@ -1061,7 +1061,7 @@ class OvsL3AgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, attributes.RESOURCE_ATTRIBUTE_MAP = self.saved_attr_map def test_router_add_to_l3_agent_notification(self): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() with mock.patch.object(plugin.l3_agent_notifier, 'cast') as mock_l3: with self.router() as router1: self._register_agent_states() @@ -1079,7 +1079,7 @@ class OvsL3AgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, topic='l3_agent.hosta') def test_router_remove_from_l3_agent_notification(self): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() with mock.patch.object(plugin.l3_agent_notifier, 'cast') as mock_l3: with self.router() as router1: self._register_agent_states() @@ -1096,7 +1096,7 @@ class OvsL3AgentNotifierTestCase(test_l3_plugin.L3NatTestCaseMixin, topic='l3_agent.hosta') def test_agent_updated_l3_agent_notification(self): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() with mock.patch.object(plugin.l3_agent_notifier, 'cast') as mock_l3: self._register_agent_states() hosta_id = self._get_agent_id(constants.AGENT_TYPE_L3, diff --git a/quantum/tests/unit/openvswitch/test_openvswitch_plugin.py b/neutron/tests/unit/openvswitch/test_openvswitch_plugin.py similarity index 84% rename from quantum/tests/unit/openvswitch/test_openvswitch_plugin.py rename to neutron/tests/unit/openvswitch/test_openvswitch_plugin.py index a23925ee60..4fbb4fd4aa 100644 --- a/quantum/tests/unit/openvswitch/test_openvswitch_plugin.py +++ b/neutron/tests/unit/openvswitch/test_openvswitch_plugin.py @@ -13,16 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.extensions import portbindings -from quantum.tests.unit import _test_extension_portbindings as test_bindings -from quantum.tests.unit import test_db_plugin as test_plugin -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.extensions import portbindings +from neutron.tests.unit import _test_extension_portbindings as test_bindings +from neutron.tests.unit import test_db_plugin as test_plugin +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc -class OpenvswitchPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class OpenvswitchPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): - _plugin_name = ('quantum.plugins.openvswitch.' - 'ovs_quantum_plugin.OVSQuantumPluginV2') + _plugin_name = ('neutron.plugins.openvswitch.' + 'ovs_neutron_plugin.OVSNeutronPluginV2') def setUp(self): super(OpenvswitchPluginV2TestCase, self).setUp(self._plugin_name) diff --git a/quantum/tests/unit/openvswitch/test_ovs_db.py b/neutron/tests/unit/openvswitch/test_ovs_db.py similarity index 97% rename from quantum/tests/unit/openvswitch/test_ovs_db.py rename to neutron/tests/unit/openvswitch/test_ovs_db.py index 3972aae493..0d0a79b547 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_db.py +++ b/neutron/tests/unit/openvswitch/test_ovs_db.py @@ -16,11 +16,11 @@ import testtools from testtools import matchers -from quantum.common import exceptions as q_exc -from quantum.db import api as db -from quantum.plugins.openvswitch import ovs_db_v2 -from quantum.tests import base -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.common import exceptions as q_exc +from neutron.db import api as db +from neutron.plugins.openvswitch import ovs_db_v2 +from neutron.tests import base +from neutron.tests.unit import test_db_plugin as test_plugin PHYS_NET = 'physnet1' PHYS_NET_2 = 'physnet2' @@ -263,7 +263,7 @@ class TunnelAllocationsTest(base.BaseTestCase): self.assertIsNone(ovs_db_v2.get_tunnel_allocation(tunnel_id)) -class NetworkBindingsTest(test_plugin.QuantumDbPluginV2TestCase): +class NetworkBindingsTest(test_plugin.NeutronDbPluginV2TestCase): def setUp(self): super(NetworkBindingsTest, self).setUp() ovs_db_v2.initialize() diff --git a/quantum/tests/unit/openvswitch/test_ovs_defaults.py b/neutron/tests/unit/openvswitch/test_ovs_defaults.py similarity index 93% rename from quantum/tests/unit/openvswitch/test_ovs_defaults.py rename to neutron/tests/unit/openvswitch/test_ovs_defaults.py index 27d996cf5f..b2d30111df 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_defaults.py +++ b/neutron/tests/unit/openvswitch/test_ovs_defaults.py @@ -15,8 +15,8 @@ from oslo.config import cfg -from quantum.plugins.openvswitch.common import config # noqa -from quantum.tests import base +from neutron.plugins.openvswitch.common import config # noqa +from neutron.tests import base class ConfigurationTest(base.BaseTestCase): diff --git a/quantum/tests/unit/openvswitch/test_ovs_lib.py b/neutron/tests/unit/openvswitch/test_ovs_lib.py similarity index 97% rename from quantum/tests/unit/openvswitch/test_ovs_lib.py rename to neutron/tests/unit/openvswitch/test_ovs_lib.py index 7deb0a25d6..5e5c79cdcd 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_lib.py +++ b/neutron/tests/unit/openvswitch/test_ovs_lib.py @@ -19,15 +19,15 @@ import mock import mox import testtools -from quantum.agent.linux import ovs_lib -from quantum.agent.linux import utils -from quantum.openstack.common import jsonutils -from quantum.openstack.common import uuidutils -from quantum.tests import base +from neutron.agent.linux import ovs_lib +from neutron.agent.linux import utils +from neutron.openstack.common import jsonutils +from neutron.openstack.common import uuidutils +from neutron.tests import base class OVS_Lib_Test(base.BaseTestCase): - """A test suite to excercise the OVS libraries shared by Quantum agents. + """A test suite to excercise the OVS libraries shared by Neutron agents. Note: these tests do not actually execute ovs-* utilities, and thus can run on any system. That does, however, limit their scope. @@ -405,7 +405,7 @@ class OVS_Lib_Test(base.BaseTestCase): self.br.delete_ports(all_ports=True) self.mox.VerifyAll() - def test_delete_quantum_ports(self): + def test_delete_neutron_ports(self): port1 = ovs_lib.VifPort('tap1234', 1, uuidutils.generate_uuid(), 'ca:fe:de:ad:be:ef', 'br') port2 = ovs_lib.VifPort('tap5678', 2, uuidutils.generate_uuid(), @@ -430,12 +430,12 @@ class OVS_Lib_Test(base.BaseTestCase): self.mox.VerifyAll() def test_get_local_port_mac_succeeds(self): - with mock.patch('quantum.agent.linux.ip_lib.IpLinkCommand', + with mock.patch('neutron.agent.linux.ip_lib.IpLinkCommand', return_value=mock.Mock(address='foo')): self.assertEqual('foo', self.br.get_local_port_mac()) def test_get_local_port_mac_raises_exception_for_missing_mac(self): - with mock.patch('quantum.agent.linux.ip_lib.IpLinkCommand', + with mock.patch('neutron.agent.linux.ip_lib.IpLinkCommand', return_value=mock.Mock(address=None)): with testtools.ExpectedException(Exception): self.br.get_local_port_mac() diff --git a/quantum/tests/unit/openvswitch/test_ovs_quantum_agent.py b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py similarity index 91% rename from quantum/tests/unit/openvswitch/test_ovs_quantum_agent.py rename to neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py index 6d1a995ba7..28188bc6c5 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_quantum_agent.py +++ b/neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py @@ -21,22 +21,22 @@ import mock from oslo.config import cfg import testtools -from quantum.agent.linux import ip_lib -from quantum.agent.linux import ovs_lib -from quantum.openstack.common.rpc import common as rpc_common -from quantum.plugins.openvswitch.agent import ovs_quantum_agent -from quantum.plugins.openvswitch.common import constants -from quantum.tests import base +from neutron.agent.linux import ip_lib +from neutron.agent.linux import ovs_lib +from neutron.openstack.common.rpc import common as rpc_common +from neutron.plugins.openvswitch.agent import ovs_neutron_agent +from neutron.plugins.openvswitch.common import constants +from neutron.tests import base -NOTIFIER = ('quantum.plugins.openvswitch.' - 'ovs_quantum_plugin.AgentNotifierApi') +NOTIFIER = ('neutron.plugins.openvswitch.' + 'ovs_neutron_plugin.AgentNotifierApi') class CreateAgentConfigMap(base.BaseTestCase): def test_create_agent_config_map_succeeds(self): - self.assertTrue(ovs_quantum_agent.create_agent_config_map(cfg.CONF)) + self.assertTrue(ovs_neutron_agent.create_agent_config_map(cfg.CONF)) def test_create_agent_config_map_fails_for_invalid_tunnel_config(self): self.addCleanup(cfg.CONF.reset) @@ -44,7 +44,7 @@ class CreateAgentConfigMap(base.BaseTestCase): cfg.CONF.set_override('tunnel_type', constants.TYPE_GRE, group='AGENT') with testtools.ExpectedException(ValueError): - ovs_quantum_agent.create_agent_config_map(cfg.CONF) + ovs_neutron_agent.create_agent_config_map(cfg.CONF) def test_create_agent_config_map_enable_tunneling(self): self.addCleanup(cfg.CONF.reset) @@ -52,7 +52,7 @@ class CreateAgentConfigMap(base.BaseTestCase): cfg.CONF.set_override('tunnel_type', None, group='AGENT') cfg.CONF.set_override('enable_tunneling', True, group='OVS') cfg.CONF.set_override('local_ip', '10.10.10.10', group='OVS') - cfgmap = ovs_quantum_agent.create_agent_config_map(cfg.CONF) + cfgmap = ovs_neutron_agent.create_agent_config_map(cfg.CONF) self.assertEqual(cfgmap['tunnel_type'], constants.TYPE_GRE) def test_create_agent_config_map_fails_no_local_ip(self): @@ -60,13 +60,13 @@ class CreateAgentConfigMap(base.BaseTestCase): # An ip address is required for tunneling but there is no default cfg.CONF.set_override('enable_tunneling', True, group='OVS') with testtools.ExpectedException(ValueError): - ovs_quantum_agent.create_agent_config_map(cfg.CONF) + ovs_neutron_agent.create_agent_config_map(cfg.CONF) -class TestOvsQuantumAgent(base.BaseTestCase): +class TestOvsNeutronAgent(base.BaseTestCase): def setUp(self): - super(TestOvsQuantumAgent, self).setUp() + super(TestOvsNeutronAgent, self).setUp() self.addCleanup(cfg.CONF.reset) self.addCleanup(mock.patch.stopall) notifier_p = mock.patch(NOTIFIER) @@ -75,17 +75,17 @@ class TestOvsQuantumAgent(base.BaseTestCase): notifier_cls.return_value = self.notifier # Avoid rpc initialization for unit tests cfg.CONF.set_override('rpc_backend', - 'quantum.openstack.common.rpc.impl_fake') + 'neutron.openstack.common.rpc.impl_fake') cfg.CONF.set_override('report_interval', 0, 'AGENT') - kwargs = ovs_quantum_agent.create_agent_config_map(cfg.CONF) + kwargs = ovs_neutron_agent.create_agent_config_map(cfg.CONF) with contextlib.nested( - mock.patch('quantum.plugins.openvswitch.agent.ovs_quantum_agent.' - 'OVSQuantumAgent.setup_integration_br', + mock.patch('neutron.plugins.openvswitch.agent.ovs_neutron_agent.' + 'OVSNeutronAgent.setup_integration_br', return_value=mock.Mock()), - mock.patch('quantum.agent.linux.utils.get_interface_mac', + mock.patch('neutron.agent.linux.utils.get_interface_mac', return_value='00:00:00:00:00:01')): - self.agent = ovs_quantum_agent.OVSQuantumAgent(**kwargs) + self.agent = ovs_neutron_agent.OVSNeutronAgent(**kwargs) self.agent.tun_br = mock.Mock() self.agent.sg_agent = mock.Mock() @@ -260,7 +260,7 @@ class TestOvsQuantumAgent(base.BaseTestCase): 'network_id': 1, 'admin_state_up': True} with contextlib.nested( - mock.patch.object(ovs_quantum_agent.LOG, 'error'), + mock.patch.object(ovs_neutron_agent.LOG, 'error'), mock.patch.object(self.agent.int_br, "get_vif_port_by_id"), mock.patch.object(self.agent.plugin_rpc, 'update_device_up'), mock.patch.object(self.agent, 'port_bound'), @@ -332,16 +332,16 @@ class TestOvsQuantumAgent(base.BaseTestCase): def _check_ovs_vxlan_version(self, installed_version, min_vers, expecting_ok): with mock.patch( - 'quantum.agent.linux.ovs_lib.get_installed_ovs_klm_version' + 'neutron.agent.linux.ovs_lib.get_installed_ovs_klm_version' ) as klm_cmd: with mock.patch( - 'quantum.agent.linux.ovs_lib.get_installed_ovs_usr_version' + 'neutron.agent.linux.ovs_lib.get_installed_ovs_usr_version' ) as usr_cmd: try: klm_cmd.return_value = installed_version usr_cmd.return_value = installed_version self.agent.tunnel_type = 'vxlan' - ovs_quantum_agent.check_ovs_version(min_vers, + ovs_neutron_agent.check_ovs_version(min_vers, root_helper='sudo') version_ok = True except SystemExit as e: diff --git a/quantum/tests/unit/openvswitch/test_ovs_rpcapi.py b/neutron/tests/unit/openvswitch/test_ovs_rpcapi.py similarity index 93% rename from quantum/tests/unit/openvswitch/test_ovs_rpcapi.py rename to neutron/tests/unit/openvswitch/test_ovs_rpcapi.py index 93207ca41b..ad7bab452d 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_rpcapi.py +++ b/neutron/tests/unit/openvswitch/test_ovs_rpcapi.py @@ -20,13 +20,13 @@ Unit Tests for openvswitch rpc import stubout -from quantum.agent import rpc as agent_rpc -from quantum.common import topics -from quantum.openstack.common import context -from quantum.openstack.common import rpc -from quantum.plugins.openvswitch.common import constants -from quantum.plugins.openvswitch import ovs_quantum_plugin as povs -from quantum.tests import base +from neutron.agent import rpc as agent_rpc +from neutron.common import topics +from neutron.openstack.common import context +from neutron.openstack.common import rpc +from neutron.plugins.openvswitch.common import constants +from neutron.plugins.openvswitch import ovs_neutron_plugin as povs +from neutron.tests import base class rpcApiTestCase(base.BaseTestCase): diff --git a/quantum/tests/unit/openvswitch/test_ovs_security_group.py b/neutron/tests/unit/openvswitch/test_ovs_security_group.py similarity index 84% rename from quantum/tests/unit/openvswitch/test_ovs_security_group.py rename to neutron/tests/unit/openvswitch/test_ovs_security_group.py index c58a2bc805..83f8755cf4 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_security_group.py +++ b/neutron/tests/unit/openvswitch/test_ovs_security_group.py @@ -17,18 +17,18 @@ import mock -from quantum.api.v2 import attributes -from quantum.extensions import securitygroup as ext_sg -from quantum import manager -from quantum.tests.unit import test_extension_security_group as test_sg -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.api.v2 import attributes +from neutron.extensions import securitygroup as ext_sg +from neutron import manager +from neutron.tests.unit import test_extension_security_group as test_sg +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc -PLUGIN_NAME = ('quantum.plugins.openvswitch.' - 'ovs_quantum_plugin.OVSQuantumPluginV2') -AGENT_NAME = ('quantum.plugins.openvswitch.' - 'agent.ovs_quantum_agent.OVSQuantumAgent') -NOTIFIER = ('quantum.plugins.openvswitch.' - 'ovs_quantum_plugin.AgentNotifierApi') +PLUGIN_NAME = ('neutron.plugins.openvswitch.' + 'ovs_neutron_plugin.OVSNeutronPluginV2') +AGENT_NAME = ('neutron.plugins.openvswitch.' + 'agent.ovs_neutron_agent.OVSNeutronAgent') +NOTIFIER = ('neutron.plugins.openvswitch.' + 'ovs_neutron_plugin.AgentNotifierApi') class OpenvswitchSecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase): @@ -74,7 +74,7 @@ class TestOpenvswitchSecurityGroups(OpenvswitchSecurityGroupsTestCase, res = self.deserialize(self.fmt, req.get_response(self.api)) port_id = res['port']['id'] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin.callbacks.get_port_from_device(port_id) self.assertEqual(port_id, port_dict['id']) self.assertEqual([security_group_id], @@ -85,7 +85,7 @@ class TestOpenvswitchSecurityGroups(OpenvswitchSecurityGroupsTestCase, self._delete('ports', port_id) def test_security_group_get_port_from_device_with_no_port(self): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin.callbacks.get_port_from_device('bad_device_id') self.assertEqual(None, port_dict) diff --git a/quantum/tests/unit/openvswitch/test_ovs_tunnel.py b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py similarity index 89% rename from quantum/tests/unit/openvswitch/test_ovs_tunnel.py rename to neutron/tests/unit/openvswitch/test_ovs_tunnel.py index beade2ba0a..3d6a4449a1 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_tunnel.py +++ b/neutron/tests/unit/openvswitch/test_ovs_tunnel.py @@ -19,12 +19,12 @@ import mox from oslo.config import cfg -from quantum.agent.linux import ip_lib -from quantum.agent.linux import ovs_lib -from quantum.openstack.common import log -from quantum.plugins.openvswitch.agent import ovs_quantum_agent -from quantum.plugins.openvswitch.common import constants -from quantum.tests import base +from neutron.agent.linux import ip_lib +from neutron.agent.linux import ovs_lib +from neutron.openstack.common import log +from neutron.plugins.openvswitch.agent import ovs_neutron_agent +from neutron.plugins.openvswitch.common import constants +from neutron.tests import base # Useful global dummy variables. @@ -38,10 +38,10 @@ OFPORT_NUM = 1 VIF_PORT = ovs_lib.VifPort('port', OFPORT_NUM, VIF_ID, VIF_MAC, 'switch') VIF_PORTS = {LV_ID: VIF_PORT} -LVM = ovs_quantum_agent.LocalVLANMapping(LV_ID, 'gre', None, LS_ID, VIF_PORTS) -LVM_FLAT = ovs_quantum_agent.LocalVLANMapping( +LVM = ovs_neutron_agent.LocalVLANMapping(LV_ID, 'gre', None, LS_ID, VIF_PORTS) +LVM_FLAT = ovs_neutron_agent.LocalVLANMapping( LV_ID, 'flat', 'net1', LS_ID, VIF_PORTS) -LVM_VLAN = ovs_quantum_agent.LocalVLANMapping( +LVM_VLAN = ovs_neutron_agent.LocalVLANMapping( LV_ID, 'vlan', 'net1', LS_ID, VIF_PORTS) BCAST_MAC = "01:00:00:00:00:00/01:00:00:00:00:00" @@ -62,7 +62,7 @@ class TunnelTest(base.BaseTestCase): def setUp(self): super(TunnelTest, self).setUp() cfg.CONF.set_override('rpc_backend', - 'quantum.openstack.common.rpc.impl_fake') + 'neutron.openstack.common.rpc.impl_fake') cfg.CONF.set_override('report_interval', 0, 'AGENT') self.mox = mox.Mox() self.addCleanup(self.mox.UnsetStubs) @@ -126,7 +126,7 @@ class TunnelTest(base.BaseTestCase): def testConstruct(self): self.mox.ReplayAll() - ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -138,7 +138,7 @@ class TunnelTest(base.BaseTestCase): self.mox.StubOutWithMock(ovs_lib, 'get_installed_ovs_usr_version') ovs_lib.get_installed_ovs_usr_version('sudo').AndReturn("1.10") self.mox.ReplayAll() - ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'vxlan') @@ -155,7 +155,7 @@ class TunnelTest(base.BaseTestCase): self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -175,7 +175,7 @@ class TunnelTest(base.BaseTestCase): self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -188,7 +188,7 @@ class TunnelTest(base.BaseTestCase): def testProvisionLocalVlanFlatFail(self): self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -206,7 +206,7 @@ class TunnelTest(base.BaseTestCase): dl_vlan=LV_ID, actions=action_string) self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -219,7 +219,7 @@ class TunnelTest(base.BaseTestCase): def testProvisionLocalVlanVlanFail(self): self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -232,7 +232,7 @@ class TunnelTest(base.BaseTestCase): self.mock_tun_bridge.delete_flows(dl_vlan=LVM.vlan) self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -250,7 +250,7 @@ class TunnelTest(base.BaseTestCase): dl_vlan=65535, in_port=self.INT_OFPORT) self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -272,7 +272,7 @@ class TunnelTest(base.BaseTestCase): dl_vlan=LV_ID, in_port=self.INT_OFPORT) self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -297,7 +297,7 @@ class TunnelTest(base.BaseTestCase): actions=action_string) self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -317,7 +317,7 @@ class TunnelTest(base.BaseTestCase): self.mock_tun_bridge.delete_flows(dl_dst=VIF_MAC, tun_id=LS_ID) self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -330,13 +330,13 @@ class TunnelTest(base.BaseTestCase): def testPortDead(self): self.mock_int_bridge.set_db_attribute( - 'Port', VIF_PORT.port_name, 'tag', ovs_quantum_agent.DEAD_VLAN_TAG) + 'Port', VIF_PORT.port_name, 'tag', ovs_neutron_agent.DEAD_VLAN_TAG) self.mock_int_bridge.add_flow(priority=2, in_port=VIF_PORT.ofport, actions='drop') self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -348,7 +348,7 @@ class TunnelTest(base.BaseTestCase): def testTunnelUpdate(self): self.mock_tun_bridge.add_tunnel_port('gre-1', '10.0.10.1', 'gre', 4789) self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -358,7 +358,7 @@ class TunnelTest(base.BaseTestCase): def testTunnelUpdateSelf(self): self.mox.ReplayAll() - a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + a = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, 'sudo', 2, 'gre') @@ -381,23 +381,23 @@ class TunnelTest(base.BaseTestCase): Exception('Fake exception to get out of the loop')) self.mox.StubOutWithMock( - ovs_quantum_agent.OVSQuantumAgent, 'update_ports') - ovs_quantum_agent.OVSQuantumAgent.update_ports(set()).AndReturn(reply2) - ovs_quantum_agent.OVSQuantumAgent.update_ports( + ovs_neutron_agent.OVSNeutronAgent, 'update_ports') + ovs_neutron_agent.OVSNeutronAgent.update_ports(set()).AndReturn(reply2) + ovs_neutron_agent.OVSNeutronAgent.update_ports( set(['tap0'])).AndReturn(reply3) self.mox.StubOutWithMock( - ovs_quantum_agent.OVSQuantumAgent, 'process_network_ports') - ovs_quantum_agent.OVSQuantumAgent.process_network_ports( + ovs_neutron_agent.OVSNeutronAgent, 'process_network_ports') + ovs_neutron_agent.OVSNeutronAgent.process_network_ports( {'current': set(['tap0']), 'removed': set([]), 'added': set([])}).AndReturn(False) - ovs_quantum_agent.OVSQuantumAgent.process_network_ports( + ovs_neutron_agent.OVSNeutronAgent.process_network_ports( {'current': set(['tap0']), 'removed': set([]), 'added': set([])}).AndRaise( Exception('Fake exception to get out of the loop')) self.mox.ReplayAll() - q_agent = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE, + q_agent = ovs_neutron_agent.OVSNeutronAgent(self.INT_BRIDGE, self.TUN_BRIDGE, '10.0.0.1', self.NET_MAPPING, diff --git a/quantum/tests/unit/plumgrid/__init__.py b/neutron/tests/unit/plumgrid/__init__.py similarity index 100% rename from quantum/tests/unit/plumgrid/__init__.py rename to neutron/tests/unit/plumgrid/__init__.py diff --git a/quantum/tests/unit/plumgrid/test_plumgrid_plugin.py b/neutron/tests/unit/plumgrid/test_plumgrid_plugin.py similarity index 84% rename from quantum/tests/unit/plumgrid/test_plumgrid_plugin.py rename to neutron/tests/unit/plumgrid/test_plumgrid_plugin.py index 301bf6af58..f1e50c777b 100644 --- a/quantum/tests/unit/plumgrid/test_plumgrid_plugin.py +++ b/neutron/tests/unit/plumgrid/test_plumgrid_plugin.py @@ -16,19 +16,19 @@ # @author: Edgar Magana, emagana@plumgrid.com, PLUMgrid, Inc. """ -Test cases for Quantum PLUMgrid Plug-in +Test cases for Neutron PLUMgrid Plug-in """ from mock import patch -from quantum.manager import QuantumManager -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.manager import NeutronManager +from neutron.tests.unit import test_db_plugin as test_plugin -class PLUMgridPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class PLUMgridPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): - _plugin_name = ('quantum.plugins.plumgrid.plumgrid_nos_plugin.' - 'plumgrid_plugin.QuantumPluginPLUMgridV2') + _plugin_name = ('neutron.plugins.plumgrid.plumgrid_nos_plugin.' + 'plumgrid_plugin.NeutronPluginPLUMgridV2') def setUp(self): self.restHTTPConnection = patch('httplib.HTTPConnection') @@ -73,5 +73,5 @@ class TestPlumgridNetworkAdminState(PLUMgridPluginV2TestCase): network = {'network': {'name': name, 'admin_state_up': admin_status_up, 'tenant_id': tenant_id}} - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() self.assertEqual(plugin._network_admin_state(network), network) diff --git a/quantum/tests/unit/ryu/__init__.py b/neutron/tests/unit/ryu/__init__.py similarity index 100% rename from quantum/tests/unit/ryu/__init__.py rename to neutron/tests/unit/ryu/__init__.py diff --git a/quantum/tests/unit/ryu/fake_ryu.py b/neutron/tests/unit/ryu/fake_ryu.py similarity index 100% rename from quantum/tests/unit/ryu/fake_ryu.py rename to neutron/tests/unit/ryu/fake_ryu.py diff --git a/quantum/tests/unit/ryu/test_defaults.py b/neutron/tests/unit/ryu/test_defaults.py similarity index 93% rename from quantum/tests/unit/ryu/test_defaults.py rename to neutron/tests/unit/ryu/test_defaults.py index 2f0e02a52e..8e840f48ab 100644 --- a/quantum/tests/unit/ryu/test_defaults.py +++ b/neutron/tests/unit/ryu/test_defaults.py @@ -17,8 +17,8 @@ from oslo.config import cfg -from quantum.plugins.ryu.common import config # noqa -from quantum.tests import base +from neutron.plugins.ryu.common import config # noqa +from neutron.tests import base class ConfigurationTest(base.BaseTestCase): diff --git a/quantum/tests/unit/ryu/test_ryu_agent.py b/neutron/tests/unit/ryu/test_ryu_agent.py similarity index 97% rename from quantum/tests/unit/ryu/test_ryu_agent.py rename to neutron/tests/unit/ryu/test_ryu_agent.py index 0932cc5013..f5b9a28e93 100644 --- a/quantum/tests/unit/ryu/test_ryu_agent.py +++ b/neutron/tests/unit/ryu/test_ryu_agent.py @@ -18,14 +18,14 @@ import httplib import mock -from quantum.openstack.common import importutils -from quantum.tests import base -from quantum.tests.unit.ryu import fake_ryu +from neutron.openstack.common import importutils +from neutron.tests import base +from neutron.tests.unit.ryu import fake_ryu class RyuAgentTestCase(base.BaseTestCase): - _AGENT_NAME = 'quantum.plugins.ryu.agent.ryu_quantum_agent' + _AGENT_NAME = 'neutron.plugins.ryu.agent.ryu_neutron_agent' def setUp(self): super(RyuAgentTestCase, self).setUp() @@ -34,9 +34,9 @@ class RyuAgentTestCase(base.BaseTestCase): self.mod_agent = importutils.import_module(self._AGENT_NAME) -class TestOVSQuantumOFPRyuAgent(RyuAgentTestCase): +class TestOVSNeutronOFPRyuAgent(RyuAgentTestCase): def setUp(self): - super(TestOVSQuantumOFPRyuAgent, self).setUp() + super(TestOVSNeutronOFPRyuAgent, self).setUp() self.plugin_api = mock.patch( self._AGENT_NAME + '.RyuPluginApi').start() self.ovsbridge = mock.patch( @@ -68,8 +68,8 @@ class TestOVSQuantumOFPRyuAgent(RyuAgentTestCase): mock_rest_addr = mock.Mock(return_value=rest_addr) self.plugin_api.return_value.get_ofp_rest_api_addr = mock_rest_addr - # Instantiate OVSQuantumOFPRyuAgent - return self.mod_agent.OVSQuantumOFPRyuAgent( + # Instantiate OVSNeutronOFPRyuAgent + return self.mod_agent.OVSNeutronOFPRyuAgent( integ_br, tunnel_ip, ovsdb_ip, ovsdb_port, interval, root_helper) def test_valid_rest_addr(self): @@ -278,7 +278,7 @@ class TestOVSBridge(RyuAgentTestCase): def setUp(self): super(TestOVSBridge, self).setUp() self.lib_ovs = mock.patch( - 'quantum.agent.linux.ovs_lib.OVSBridge').start() + 'neutron.agent.linux.ovs_lib.OVSBridge').start() def test_find_datapath_id(self): with mock.patch(self._AGENT_NAME + '.OVSBridge.get_datapath_id', @@ -479,7 +479,7 @@ class TestOVSBridge(RyuAgentTestCase): ]) -class TestRyuQuantumAgent(RyuAgentTestCase): +class TestRyuNeutronAgent(RyuAgentTestCase): def test_get_my_ip(self): sock_attrs = { 'return_value.getsockname.return_value': ['1.2.3.4', '']} @@ -584,7 +584,7 @@ class TestRyuQuantumAgent(RyuAgentTestCase): def test_main(self): agent_attrs = {'daemon_loop.side_effect': SystemExit(0)} - with mock.patch(self._AGENT_NAME + '.OVSQuantumOFPRyuAgent', + with mock.patch(self._AGENT_NAME + '.OVSNeutronOFPRyuAgent', **agent_attrs) as mock_agent: self.assertRaises(SystemExit, self.mock_main) @@ -596,7 +596,7 @@ class TestRyuQuantumAgent(RyuAgentTestCase): def test_main_raise(self): with nested( - mock.patch(self._AGENT_NAME + '.OVSQuantumOFPRyuAgent', + mock.patch(self._AGENT_NAME + '.OVSNeutronOFPRyuAgent', side_effect=httplib.HTTPException('boom')), mock.patch('sys.exit', side_effect=SystemExit(0)) ) as (mock_agent, mock_exit): diff --git a/quantum/tests/unit/ryu/test_ryu_db.py b/neutron/tests/unit/ryu/test_ryu_db.py similarity index 86% rename from quantum/tests/unit/ryu/test_ryu_db.py rename to neutron/tests/unit/ryu/test_ryu_db.py index 481265a72c..1d9d1f4184 100644 --- a/quantum/tests/unit/ryu/test_ryu_db.py +++ b/neutron/tests/unit/ryu/test_ryu_db.py @@ -18,14 +18,14 @@ from contextlib import nested import operator -from quantum.db import api as db -from quantum.plugins.ryu.common import config # noqa -from quantum.plugins.ryu.db import api_v2 as db_api_v2 -from quantum.plugins.ryu.db import models_v2 as ryu_models_v2 # noqa -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.db import api as db +from neutron.plugins.ryu.common import config # noqa +from neutron.plugins.ryu.db import api_v2 as db_api_v2 +from neutron.plugins.ryu.db import models_v2 as ryu_models_v2 # noqa +from neutron.tests.unit import test_db_plugin as test_plugin -class RyuDBTest(test_plugin.QuantumDbPluginV2TestCase): +class RyuDBTest(test_plugin.NeutronDbPluginV2TestCase): @staticmethod def _tunnel_key_sort(key_list): key_list.sort(key=operator.attrgetter('tunnel_key')) diff --git a/quantum/tests/unit/ryu/test_ryu_plugin.py b/neutron/tests/unit/ryu/test_ryu_plugin.py similarity index 79% rename from quantum/tests/unit/ryu/test_ryu_plugin.py rename to neutron/tests/unit/ryu/test_ryu_plugin.py index f93f0966ea..3bb854f98a 100644 --- a/quantum/tests/unit/ryu/test_ryu_plugin.py +++ b/neutron/tests/unit/ryu/test_ryu_plugin.py @@ -13,14 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from quantum.plugins.ryu.db import models_v2 as ryu_models_v2 # noqa -from quantum.tests.unit.ryu import fake_ryu -from quantum.tests.unit import test_db_plugin as test_plugin +from neutron.plugins.ryu.db import models_v2 as ryu_models_v2 # noqa +from neutron.tests.unit.ryu import fake_ryu +from neutron.tests.unit import test_db_plugin as test_plugin -class RyuPluginV2TestCase(test_plugin.QuantumDbPluginV2TestCase): +class RyuPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): - _plugin_name = 'quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2' + _plugin_name = 'neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2' def setUp(self): self.ryu_patcher = fake_ryu.patch_fake_ryu_client() diff --git a/quantum/tests/unit/ryu/test_ryu_security_group.py b/neutron/tests/unit/ryu/test_ryu_security_group.py similarity index 84% rename from quantum/tests/unit/ryu/test_ryu_security_group.py rename to neutron/tests/unit/ryu/test_ryu_security_group.py index 8bfbdf67c7..01d764eb8f 100644 --- a/quantum/tests/unit/ryu/test_ryu_security_group.py +++ b/neutron/tests/unit/ryu/test_ryu_security_group.py @@ -19,19 +19,19 @@ import contextlib import mock -from quantum.api.v2 import attributes -from quantum.extensions import securitygroup as ext_sg -from quantum import manager -from quantum.tests.unit.ryu import fake_ryu -from quantum.tests.unit import test_extension_security_group as test_sg -from quantum.tests.unit import test_security_groups_rpc as test_sg_rpc +from neutron.api.v2 import attributes +from neutron.extensions import securitygroup as ext_sg +from neutron import manager +from neutron.tests.unit.ryu import fake_ryu +from neutron.tests.unit import test_extension_security_group as test_sg +from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc -PLUGIN_NAME = ('quantum.plugins.ryu.' - 'ryu_quantum_plugin.RyuQuantumPluginV2') -AGENT_NAME = ('quantum.plugins.ryu.' - 'agent.ryu_quantum_agent.OVSQuantumOFPRyuAgent') -NOTIFIER = ('quantum.plugins.ryu.' - 'ryu_quantum_plugin.AgentNotifierApi') +PLUGIN_NAME = ('neutron.plugins.ryu.' + 'ryu_neutron_plugin.RyuNeutronPluginV2') +AGENT_NAME = ('neutron.plugins.ryu.' + 'agent.ryu_neutron_agent.OVSNeutronOFPRyuAgent') +NOTIFIER = ('neutron.plugins.ryu.' + 'ryu_neutron_plugin.AgentNotifierApi') class RyuSecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase): @@ -78,7 +78,7 @@ class TestRyuSecurityGroups(RyuSecurityGroupsTestCase, res = self.deserialize(self.fmt, req.get_response(self.api)) port_id = res['port']['id'] - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin.callbacks.get_port_from_device(port_id) self.assertEqual(port_id, port_dict['id']) self.assertEqual([security_group_id], @@ -89,7 +89,7 @@ class TestRyuSecurityGroups(RyuSecurityGroupsTestCase, self._delete('ports', port_id) def test_security_group_get_port_from_device_with_no_port(self): - plugin = manager.QuantumManager.get_plugin() + plugin = manager.NeutronManager.get_plugin() port_dict = plugin.callbacks.get_port_from_device('bad_device_id') self.assertEqual(None, port_dict) diff --git a/quantum/tests/unit/services/__init__.py b/neutron/tests/unit/services/__init__.py similarity index 100% rename from quantum/tests/unit/services/__init__.py rename to neutron/tests/unit/services/__init__.py diff --git a/quantum/tests/unit/services/loadbalancer/__init__.py b/neutron/tests/unit/services/loadbalancer/__init__.py similarity index 100% rename from quantum/tests/unit/services/loadbalancer/__init__.py rename to neutron/tests/unit/services/loadbalancer/__init__.py diff --git a/quantum/tests/unit/services/loadbalancer/drivers/__init__.py b/neutron/tests/unit/services/loadbalancer/drivers/__init__.py similarity index 100% rename from quantum/tests/unit/services/loadbalancer/drivers/__init__.py rename to neutron/tests/unit/services/loadbalancer/drivers/__init__.py diff --git a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/__init__.py b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/__init__.py similarity index 100% rename from quantum/tests/unit/services/loadbalancer/drivers/haproxy/__init__.py rename to neutron/tests/unit/services/loadbalancer/drivers/haproxy/__init__.py diff --git a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py similarity index 91% rename from quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py rename to neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py index b5a0a00493..45161bc2d2 100644 --- a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py +++ b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent.py @@ -20,8 +20,8 @@ import contextlib import mock from oslo.config import cfg -from quantum.services.loadbalancer.drivers.haproxy import agent -from quantum.tests import base +from neutron.services.loadbalancer.drivers.haproxy import agent +from neutron.tests import base class TestLbaasService(base.BaseTestCase): @@ -43,7 +43,7 @@ class TestLbaasService(base.BaseTestCase): self.assertTrue(mock_start.called) def test_main(self): - logging_str = 'quantum.agent.common.config.setup_logging' + logging_str = 'neutron.agent.common.config.setup_logging' with contextlib.nested( mock.patch(logging_str), mock.patch.object(agent.service, 'launch'), diff --git a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_agent_manager.py b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent_manager.py similarity index 98% rename from quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_agent_manager.py rename to neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent_manager.py index 5808578199..d7bffc2c5d 100644 --- a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_agent_manager.py +++ b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_agent_manager.py @@ -20,10 +20,10 @@ import contextlib import mock -from quantum.services.loadbalancer.drivers.haproxy import ( +from neutron.services.loadbalancer.drivers.haproxy import ( agent_manager as manager ) -from quantum.tests import base +from neutron.tests import base class TestLogicalDeviceCache(base.BaseTestCase): @@ -147,7 +147,7 @@ class TestManager(base.BaseTestCase): self.mock_importer = mock.patch.object(manager, 'importutils').start() rpc_mock_cls = mock.patch( - 'quantum.services.loadbalancer.drivers' + 'neutron.services.loadbalancer.drivers' '.haproxy.agent_api.LbaasAgentApi' ).start() diff --git a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_api.py b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_api.py similarity index 97% rename from quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_api.py rename to neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_api.py index 5022727f60..032a3e2a62 100644 --- a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_api.py +++ b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_api.py @@ -18,10 +18,10 @@ import mock -from quantum.services.loadbalancer.drivers.haproxy import ( +from neutron.services.loadbalancer.drivers.haproxy import ( agent_api as api ) -from quantum.tests import base +from neutron.tests import base class TestApiCache(base.BaseTestCase): diff --git a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py similarity index 96% rename from quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py rename to neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py index 8920d83ac4..e21b428db8 100644 --- a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py +++ b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py @@ -22,22 +22,22 @@ import mock from oslo.config import cfg as config -from quantum.services.loadbalancer.drivers.haproxy import cfg -from quantum.tests import base +from neutron.services.loadbalancer.drivers.haproxy import cfg +from neutron.tests import base class TestHaproxyCfg(base.BaseTestCase): def test_save_config(self): with contextlib.nested( - mock.patch('quantum.services.loadbalancer.' + mock.patch('neutron.services.loadbalancer.' 'drivers.haproxy.cfg._build_global'), - mock.patch('quantum.services.loadbalancer.' + mock.patch('neutron.services.loadbalancer.' 'drivers.haproxy.cfg._build_defaults'), - mock.patch('quantum.services.loadbalancer.' + mock.patch('neutron.services.loadbalancer.' 'drivers.haproxy.cfg._build_frontend'), - mock.patch('quantum.services.loadbalancer.' + mock.patch('neutron.services.loadbalancer.' 'drivers.haproxy.cfg._build_backend'), - mock.patch('quantum.agent.linux.utils.replace_file') + mock.patch('neutron.agent.linux.utils.replace_file') ) as (b_g, b_d, b_f, b_b, replace): test_config = ['globals', 'defaults', 'frontend', 'backend'] b_g.return_value = [test_config[0]] diff --git a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py similarity index 95% rename from quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py rename to neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py index 48e3d7df17..2e0837d919 100644 --- a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py +++ b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py @@ -19,11 +19,11 @@ import contextlib import mock -from quantum.common import exceptions -from quantum.services.loadbalancer.drivers.haproxy import ( +from neutron.common import exceptions +from neutron.services.loadbalancer.drivers.haproxy import ( namespace_driver ) -from quantum.tests import base +from neutron.tests import base class TestHaproxyNSDriver(base.BaseTestCase): @@ -72,7 +72,7 @@ class TestHaproxyNSDriver(base.BaseTestCase): with contextlib.nested( mock.patch.object(namespace_driver.hacfg, 'save_config'), mock.patch.object(self.driver, '_get_state_file_path'), - mock.patch('quantum.agent.linux.ip_lib.IPWrapper') + mock.patch('neutron.agent.linux.ip_lib.IPWrapper') ) as (mock_save, gsp, ip_wrap): gsp.side_effect = lambda x, y: y @@ -90,7 +90,7 @@ class TestHaproxyNSDriver(base.BaseTestCase): mock.patch.object(self.driver, '_get_state_file_path'), mock.patch.object(namespace_driver, 'kill_pids_in_file'), mock.patch.object(self.driver, '_unplug'), - mock.patch('quantum.agent.linux.ip_lib.IPWrapper'), + mock.patch('neutron.agent.linux.ip_lib.IPWrapper'), mock.patch('os.path.isdir'), mock.patch('shutil.rmtree') ) as (gsp, kill, unplug, ip_wrap, isdir, rmtree): @@ -113,7 +113,7 @@ class TestHaproxyNSDriver(base.BaseTestCase): def test_exists(self): with contextlib.nested( mock.patch.object(self.driver, '_get_state_file_path'), - mock.patch('quantum.agent.linux.ip_lib.IPWrapper'), + mock.patch('neutron.agent.linux.ip_lib.IPWrapper'), mock.patch('socket.socket'), mock.patch('os.path.exists'), ) as (gsp, ip_wrap, socket, path_exists): @@ -189,9 +189,9 @@ class TestHaproxyNSDriver(base.BaseTestCase): 'subnet': {'cidr': '10.0.0.0/24', 'gateway_ip': '10.0.0.1'}}]} with contextlib.nested( - mock.patch('quantum.agent.linux.ip_lib.device_exists'), + mock.patch('neutron.agent.linux.ip_lib.device_exists'), mock.patch('netaddr.IPNetwork'), - mock.patch('quantum.agent.linux.ip_lib.IPWrapper'), + mock.patch('neutron.agent.linux.ip_lib.IPWrapper'), ) as (dev_exists, ip_net, ip_wrap): self.vif_driver.get_device_name.return_value = 'test_interface' dev_exists.return_value = False @@ -226,9 +226,9 @@ class TestHaproxyNSDriver(base.BaseTestCase): 'fixed_ips': [{'ip_address': '10.0.0.2', 'subnet': {'cidr': '10.0.0.0/24'}}]} with contextlib.nested( - mock.patch('quantum.agent.linux.ip_lib.device_exists'), + mock.patch('neutron.agent.linux.ip_lib.device_exists'), mock.patch('netaddr.IPNetwork'), - mock.patch('quantum.agent.linux.ip_lib.IPWrapper'), + mock.patch('neutron.agent.linux.ip_lib.IPWrapper'), ) as (dev_exists, ip_net, ip_wrap): self.vif_driver.get_device_name.return_value = 'test_interface' dev_exists.return_value = False @@ -263,7 +263,7 @@ class TestHaproxyNSDriver(base.BaseTestCase): with contextlib.nested( mock.patch('os.path.exists'), mock.patch('__builtin__.open'), - mock.patch('quantum.agent.linux.utils.execute') + mock.patch('neutron.agent.linux.utils.execute') ) as (path_exists, mock_open, mock_execute): file_mock = mock.MagicMock() mock_open.return_value = file_mock diff --git a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_plugin_driver.py b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_plugin_driver.py similarity index 96% rename from quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_plugin_driver.py rename to neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_plugin_driver.py index 3852af6e00..111956eec0 100644 --- a/quantum/tests/unit/services/loadbalancer/drivers/haproxy/test_plugin_driver.py +++ b/neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_plugin_driver.py @@ -18,17 +18,17 @@ import mock -from quantum.common import exceptions -from quantum import context -from quantum.db.loadbalancer import loadbalancer_db as ldb -from quantum import manager -from quantum.openstack.common import uuidutils -from quantum.plugins.common import constants -from quantum.services.loadbalancer.drivers.haproxy import ( +from neutron.common import exceptions +from neutron import context +from neutron.db.loadbalancer import loadbalancer_db as ldb +from neutron import manager +from neutron.openstack.common import uuidutils +from neutron.plugins.common import constants +from neutron.services.loadbalancer.drivers.haproxy import ( plugin_driver ) -from quantum.tests import base -from quantum.tests.unit.db.loadbalancer import test_db_loadbalancer +from neutron.tests import base +from neutron.tests.unit.db.loadbalancer import test_db_loadbalancer class TestLoadBalancerPluginBase( @@ -41,7 +41,7 @@ class TestLoadBalancerPluginBase( # pass a mock to our API instance # we need access to loaded plugins to modify models - loaded_plugins = manager.QuantumManager().get_service_plugins() + loaded_plugins = manager.NeutronManager().get_service_plugins() self.plugin_instance = loaded_plugins[constants.LOADBALANCER] @@ -207,7 +207,7 @@ class TestLoadBalancerCallbacks(TestLoadBalancerPluginBase): def test_plug_vip_port(self): exp = { - 'device_owner': 'quantum:' + constants.LOADBALANCER, + 'device_owner': 'neutron:' + constants.LOADBALANCER, 'device_id': 'c596ce11-db30-5c72-8243-15acaae8690f', 'admin_state_up': True } diff --git a/quantum/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py b/neutron/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py similarity index 97% rename from quantum/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py rename to neutron/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py index 62edff17ca..ad1ef62534 100644 --- a/quantum/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py +++ b/neutron/tests/unit/services/loadbalancer/test_loadbalancer_plugin.py @@ -21,16 +21,16 @@ from oslo.config import cfg from webob import exc import webtest -from quantum.api import extensions -from quantum.api.v2 import attributes -from quantum.common import config -from quantum.extensions import loadbalancer -from quantum import manager -from quantum.openstack.common import uuidutils -from quantum.plugins.common import constants -from quantum.tests.unit import test_api_v2 -from quantum.tests.unit import test_extensions -from quantum.tests.unit import testlib_api +from neutron.api import extensions +from neutron.api.v2 import attributes +from neutron.common import config +from neutron.extensions import loadbalancer +from neutron import manager +from neutron.openstack.common import uuidutils +from neutron.plugins.common import constants +from neutron.tests.unit import test_api_v2 +from neutron.tests.unit import test_extensions +from neutron.tests.unit import testlib_api _uuid = uuidutils.generate_uuid @@ -60,15 +60,15 @@ class LoadBalancerExtensionTestCase(testlib_api.WebTestCase): def setUp(self): super(LoadBalancerExtensionTestCase, self).setUp() - plugin = 'quantum.extensions.loadbalancer.LoadBalancerPluginBase' + plugin = 'neutron.extensions.loadbalancer.LoadBalancerPluginBase' # Ensure 'stale' patched copies of the plugin are never returned - manager.QuantumManager._instance = None + manager.NeutronManager._instance = None # Ensure existing ExtensionManager is not used extensions.PluginAwareExtensionManager._instance = None # Create the default configurations - args = ['--config-file', test_api_v2.etcdir('quantum.conf.test')] + args = ['--config-file', test_api_v2.etcdir('neutron.conf.test')] config.parse(args) #just stubbing core plugin with LoadBalancer plugin diff --git a/quantum/tests/unit/test_agent_config.py b/neutron/tests/unit/test_agent_config.py similarity index 91% rename from quantum/tests/unit/test_agent_config.py rename to neutron/tests/unit/test_agent_config.py index fab746a31e..e2408e0ce5 100644 --- a/quantum/tests/unit/test_agent_config.py +++ b/neutron/tests/unit/test_agent_config.py @@ -15,13 +15,13 @@ # License for the specific language governing permissions and limitations # under the License. -from quantum.agent.common import config -from quantum.tests import base +from neutron.agent.common import config +from neutron.tests import base def test_setup_conf(): conf = config.setup_conf() - assert conf.state_path.endswith('/var/lib/quantum') + assert conf.state_path.endswith('/var/lib/neutron') class TestRootHelper(base.BaseTestCase): diff --git a/quantum/tests/unit/test_agent_ext_plugin.py b/neutron/tests/unit/test_agent_ext_plugin.py similarity index 85% rename from quantum/tests/unit/test_agent_ext_plugin.py rename to neutron/tests/unit/test_agent_ext_plugin.py index f58d98ab59..10a1ecf0dc 100644 --- a/quantum/tests/unit/test_agent_ext_plugin.py +++ b/neutron/tests/unit/test_agent_ext_plugin.py @@ -21,19 +21,19 @@ import time from oslo.config import cfg from webob import exc -from quantum.api.v2 import attributes -from quantum.common import constants -from quantum.common.test_lib import test_config -from quantum.common import topics -from quantum import context -from quantum.db import agents_db -from quantum.db import db_base_plugin_v2 -from quantum.extensions import agent -from quantum.openstack.common import log as logging -from quantum.openstack.common import timeutils -from quantum.openstack.common import uuidutils -from quantum.tests.unit import test_api_v2 -from quantum.tests.unit import test_db_plugin +from neutron.api.v2 import attributes +from neutron.common import constants +from neutron.common.test_lib import test_config +from neutron.common import topics +from neutron import context +from neutron.db import agents_db +from neutron.db import db_base_plugin_v2 +from neutron.extensions import agent +from neutron.openstack.common import log as logging +from neutron.openstack.common import timeutils +from neutron.openstack.common import uuidutils +from neutron.tests.unit import test_api_v2 +from neutron.tests.unit import test_db_plugin LOG = logging.getLogger(__name__) @@ -66,7 +66,7 @@ class AgentTestExtensionManager(object): # This plugin class is just for testing -class TestAgentPlugin(db_base_plugin_v2.QuantumDbPluginV2, +class TestAgentPlugin(db_base_plugin_v2.NeutronDbPluginV2, agents_db.AgentDbMixin): supported_extension_aliases = ["agent"] @@ -74,10 +74,10 @@ class TestAgentPlugin(db_base_plugin_v2.QuantumDbPluginV2, class AgentDBTestMixIn(object): def _list_agents(self, expected_res_status=None, - quantum_context=None, + neutron_context=None, query_string=None): agent_res = self._list('agents', - quantum_context=quantum_context, + neutron_context=neutron_context, query_params=query_string) if expected_res_status: self.assertEqual(agent_res.status_int, expected_res_status) @@ -86,7 +86,7 @@ class AgentDBTestMixIn(object): def _register_agent_states(self): """Register two L3 agents and two DHCP agents.""" l3_hosta = { - 'binary': 'quantum-l3-agent', + 'binary': 'neutron-l3-agent', 'host': L3_HOSTA, 'topic': topics.L3_AGENT, 'configurations': {'use_namespaces': True, @@ -101,7 +101,7 @@ class AgentDBTestMixIn(object): l3_hostb = copy.deepcopy(l3_hosta) l3_hostb['host'] = L3_HOSTB dhcp_hosta = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOSTA, 'topic': 'DHCP_AGENT', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -128,7 +128,7 @@ class AgentDBTestMixIn(object): def _register_one_dhcp_agent(self): """Register one DHCP agent.""" dhcp_host = { - 'binary': 'quantum-dhcp-agent', + 'binary': 'neutron-dhcp-agent', 'host': DHCP_HOST1, 'topic': 'DHCP_AGENT', 'configurations': {'dhcp_driver': 'dhcp_driver', @@ -143,13 +143,13 @@ class AgentDBTestMixIn(object): class AgentDBTestCase(AgentDBTestMixIn, - test_db_plugin.QuantumDbPluginV2TestCase): + test_db_plugin.NeutronDbPluginV2TestCase): fmt = 'json' def setUp(self): self.adminContext = context.get_admin_context() test_config['plugin_name_v2'] = ( - 'quantum.tests.unit.test_agent_ext_plugin.TestAgentPlugin') + 'neutron.tests.unit.test_agent_ext_plugin.TestAgentPlugin') # for these tests we need to enable overlapping ips cfg.CONF.set_default('allow_overlapping_ips', True) # Save the original RESOURCE_ATTRIBUTE_MAP @@ -169,7 +169,7 @@ class AgentDBTestCase(AgentDBTestMixIn, def test_create_agent(self): data = {'agent': {}} _req = self.new_create_request('agents', data, self.fmt) - _req.environ['quantum.context'] = context.Context( + _req.environ['neutron.context'] = context.Context( '', 'tenant_id') res = _req.get_response(self.ext_api) self.assertEqual(res.status_int, exc.HTTPBadRequest.code) @@ -189,15 +189,15 @@ class AgentDBTestCase(AgentDBTestMixIn, def test_show_agent(self): self._register_agent_states() agents = self._list_agents( - query_string='binary=quantum-l3-agent') + query_string='binary=neutron-l3-agent') self.assertEqual(2, len(agents['agents'])) agent = self._show('agents', agents['agents'][0]['id']) - self.assertEqual('quantum-l3-agent', agent['agent']['binary']) + self.assertEqual('neutron-l3-agent', agent['agent']['binary']) def test_update_agent(self): self._register_agent_states() agents = self._list_agents( - query_string='binary=quantum-l3-agent&host=' + L3_HOSTB) + query_string='binary=neutron-l3-agent&host=' + L3_HOSTB) self.assertEqual(1, len(agents['agents'])) com_id = agents['agents'][0]['id'] agent = self._show('agents', com_id) @@ -215,7 +215,7 @@ class AgentDBTestCase(AgentDBTestMixIn, self._register_agent_states() time.sleep(1.5) agents = self._list_agents( - query_string='binary=quantum-l3-agent&host=' + L3_HOSTB) + query_string='binary=neutron-l3-agent&host=' + L3_HOSTB) self.assertFalse(agents['agents'][0]['alive']) diff --git a/quantum/tests/unit/test_agent_linux_utils.py b/neutron/tests/unit/test_agent_linux_utils.py similarity index 98% rename from quantum/tests/unit/test_agent_linux_utils.py rename to neutron/tests/unit/test_agent_linux_utils.py index 4eeb8f59e5..8f0f76cca7 100644 --- a/quantum/tests/unit/test_agent_linux_utils.py +++ b/neutron/tests/unit/test_agent_linux_utils.py @@ -18,8 +18,8 @@ import fixtures import mock -from quantum.agent.linux import utils -from quantum.tests import base +from neutron.agent.linux import utils +from neutron.tests import base class AgentUtilsExecuteTest(base.BaseTestCase): diff --git a/quantum/tests/unit/test_agent_netns_cleanup.py b/neutron/tests/unit/test_agent_netns_cleanup.py similarity index 91% rename from quantum/tests/unit/test_agent_netns_cleanup.py rename to neutron/tests/unit/test_agent_netns_cleanup.py index a9c5d559e3..80e188f14d 100644 --- a/quantum/tests/unit/test_agent_netns_cleanup.py +++ b/neutron/tests/unit/test_agent_netns_cleanup.py @@ -18,8 +18,8 @@ import mock from oslo.config import cfg -from quantum.agent import netns_cleanup_util as util -from quantum.tests import base +from neutron.agent import netns_cleanup_util as util +from neutron.tests import base class TestNullDelegate(base.BaseTestCase): @@ -38,7 +38,7 @@ class TestNetnsCleanup(base.BaseTestCase): conf.AGENT.root_helper = 'sudo', conf.dhcp_driver = 'driver' - method_to_patch = 'quantum.openstack.common.importutils.import_object' + method_to_patch = 'neutron.openstack.common.importutils.import_object' with mock.patch(method_to_patch) as import_object: driver = mock.Mock() @@ -68,7 +68,7 @@ class TestNetnsCleanup(base.BaseTestCase): ns = prefix + '6e322ac7-ab50-4f53-9cdc-d1d3c1164b6d' conf = mock.Mock() - with mock.patch('quantum.agent.linux.ip_lib.IPWrapper') as ip_wrap: + with mock.patch('neutron.agent.linux.ip_lib.IPWrapper') as ip_wrap: ip_wrap.return_value.namespace_is_empty.return_value = is_empty self.assertEqual(util.eligible_for_deletion(conf, ns, force), expected) @@ -102,9 +102,9 @@ class TestNetnsCleanup(base.BaseTestCase): device.name = 'tap1' device.link.delete.side_effect = RuntimeError - with mock.patch('quantum.agent.linux.ovs_lib.OVSBridge') as ovs_br_cls: + with mock.patch('neutron.agent.linux.ovs_lib.OVSBridge') as ovs_br_cls: br_patch = mock.patch( - 'quantum.agent.linux.ovs_lib.get_bridge_for_iface') + 'neutron.agent.linux.ovs_lib.get_bridge_for_iface') with br_patch as mock_get_bridge_for_iface: mock_get_bridge_for_iface.return_value = 'br-int' ovs_bridge = mock.Mock() @@ -126,9 +126,9 @@ class TestNetnsCleanup(base.BaseTestCase): device.name = 'tap1' device.link.delete.side_effect = RuntimeError - with mock.patch('quantum.agent.linux.ovs_lib.OVSBridge') as ovs_br_cls: + with mock.patch('neutron.agent.linux.ovs_lib.OVSBridge') as ovs_br_cls: br_patch = mock.patch( - 'quantum.agent.linux.ovs_lib.get_bridge_for_iface') + 'neutron.agent.linux.ovs_lib.get_bridge_for_iface') with br_patch as mock_get_bridge_for_iface: with mock.patch.object(util.LOG, 'debug') as debug: mock_get_bridge_for_iface.return_value = None @@ -158,7 +158,7 @@ class TestNetnsCleanup(base.BaseTestCase): devices.append(dev) num_devices -= 1 - with mock.patch('quantum.agent.linux.ip_lib.IPWrapper') as ip_wrap: + with mock.patch('neutron.agent.linux.ip_lib.IPWrapper') as ip_wrap: ip_wrap.return_value.get_devices.return_value = devices ip_wrap.return_value.netns.exists.return_value = True @@ -193,13 +193,13 @@ class TestNetnsCleanup(base.BaseTestCase): ns = 'qrouter-6e322ac7-ab50-4f53-9cdc-d1d3c1164b6d' conf = mock.Mock() conf.AGENT.root_helper = 'sudo' - with mock.patch('quantum.agent.linux.ip_lib.IPWrapper') as ip_wrap: + with mock.patch('neutron.agent.linux.ip_lib.IPWrapper') as ip_wrap: ip_wrap.side_effect = Exception() util.destroy_namespace(conf, ns) def test_main(self): namespaces = ['ns1', 'ns2'] - with mock.patch('quantum.agent.linux.ip_lib.IPWrapper') as ip_wrap: + with mock.patch('neutron.agent.linux.ip_lib.IPWrapper') as ip_wrap: ip_wrap.get_namespaces.return_value = namespaces with mock.patch('eventlet.sleep') as eventlet_sleep: @@ -213,7 +213,7 @@ class TestNetnsCleanup(base.BaseTestCase): with mock.patch.multiple(util, **methods_to_mock) as mocks: mocks['eligible_for_deletion'].return_value = True mocks['setup_conf'].return_value = conf - with mock.patch('quantum.common.config.setup_logging'): + with mock.patch('neutron.common.config.setup_logging'): util.main() mocks['eligible_for_deletion'].assert_has_calls( @@ -231,7 +231,7 @@ class TestNetnsCleanup(base.BaseTestCase): def test_main_no_candidates(self): namespaces = ['ns1', 'ns2'] - with mock.patch('quantum.agent.linux.ip_lib.IPWrapper') as ip_wrap: + with mock.patch('neutron.agent.linux.ip_lib.IPWrapper') as ip_wrap: ip_wrap.get_namespaces.return_value = namespaces with mock.patch('eventlet.sleep') as eventlet_sleep: @@ -245,7 +245,7 @@ class TestNetnsCleanup(base.BaseTestCase): with mock.patch.multiple(util, **methods_to_mock) as mocks: mocks['eligible_for_deletion'].return_value = False mocks['setup_conf'].return_value = conf - with mock.patch('quantum.common.config.setup_logging'): + with mock.patch('neutron.common.config.setup_logging'): util.main() ip_wrap.assert_has_calls( diff --git a/quantum/tests/unit/test_agent_ovs_cleanup.py b/neutron/tests/unit/test_agent_ovs_cleanup.py similarity index 78% rename from quantum/tests/unit/test_agent_ovs_cleanup.py rename to neutron/tests/unit/test_agent_ovs_cleanup.py index 98a94eae49..0cdc2647d5 100644 --- a/quantum/tests/unit/test_agent_ovs_cleanup.py +++ b/neutron/tests/unit/test_agent_ovs_cleanup.py @@ -20,11 +20,11 @@ import itertools import mock from oslo.config import cfg -from quantum.agent.linux import ip_lib -from quantum.agent.linux import ovs_lib -from quantum.agent import ovs_cleanup_util as util -from quantum.openstack.common import uuidutils -from quantum.tests import base +from neutron.agent.linux import ip_lib +from neutron.agent.linux import ovs_lib +from neutron.agent import ovs_cleanup_util as util +from neutron.openstack.common import uuidutils +from neutron.tests import base class TestOVSCleanup(base.BaseTestCase): @@ -48,24 +48,24 @@ class TestOVSCleanup(base.BaseTestCase): conf.ovs_integration_bridge = 'br-int' conf.external_network_bridge = 'br-ex' with contextlib.nested( - mock.patch('quantum.common.config.setup_logging'), - mock.patch('quantum.agent.ovs_cleanup_util.setup_conf', + mock.patch('neutron.common.config.setup_logging'), + mock.patch('neutron.agent.ovs_cleanup_util.setup_conf', return_value=conf), - mock.patch('quantum.agent.linux.ovs_lib.get_bridges', + mock.patch('neutron.agent.linux.ovs_lib.get_bridges', return_value=bridges), - mock.patch('quantum.agent.linux.ovs_lib.OVSBridge'), - mock.patch.object(util, 'collect_quantum_ports', + mock.patch('neutron.agent.linux.ovs_lib.OVSBridge'), + mock.patch.object(util, 'collect_neutron_ports', return_value=ports), - mock.patch.object(util, 'delete_quantum_ports') + mock.patch.object(util, 'delete_neutron_ports') ) as (_log, _conf, _get, ovs, collect, delete): - with mock.patch('quantum.common.config.setup_logging'): + with mock.patch('neutron.common.config.setup_logging'): util.main() ovs.assert_has_calls([mock.call().delete_ports( all_ports=False)]) collect.assert_called_once_with(set(bridges), 'dummy_sudo') delete.assert_called_once_with(ports, 'dummy_sudo') - def test_collect_quantum_ports(self): + def test_collect_neutron_ports(self): port1 = ovs_lib.VifPort('tap1234', 1, uuidutils.generate_uuid(), '11:22:33:44:55:66', 'br') port2 = ovs_lib.VifPort('tap5678', 2, uuidutils.generate_uuid(), @@ -74,13 +74,13 @@ class TestOVSCleanup(base.BaseTestCase): '99:00:aa:bb:cc:dd', 'br') ports = [[port1, port2], [port3]] portnames = [p.port_name for p in itertools.chain(*ports)] - with mock.patch('quantum.agent.linux.ovs_lib.OVSBridge') as ovs: + with mock.patch('neutron.agent.linux.ovs_lib.OVSBridge') as ovs: ovs.return_value.get_vif_ports.side_effect = ports bridges = ['br-int', 'br-ex'] - ret = util.collect_quantum_ports(bridges, 'dummy_sudo') + ret = util.collect_neutron_ports(bridges, 'dummy_sudo') self.assertEqual(ret, portnames) - def test_delete_quantum_ports(self): + def test_delete_neutron_ports(self): ports = ['tap1234', 'tap5678', 'tap09ab'] port_found = [True, False, True] with contextlib.nested( @@ -88,7 +88,7 @@ class TestOVSCleanup(base.BaseTestCase): side_effect=port_found), mock.patch.object(ip_lib, 'IPDevice') ) as (device_exists, ip_dev): - util.delete_quantum_ports(ports, 'dummy_sudo') + util.delete_neutron_ports(ports, 'dummy_sudo') device_exists.assert_has_calls([mock.call(p) for p in ports]) ip_dev.assert_has_calls( [mock.call('tap1234', 'dummy_sudo'), diff --git a/quantum/tests/unit/test_agent_rpc.py b/neutron/tests/unit/test_agent_rpc.py similarity index 94% rename from quantum/tests/unit/test_agent_rpc.py rename to neutron/tests/unit/test_agent_rpc.py index 4b9c5d6531..7327b53da8 100644 --- a/quantum/tests/unit/test_agent_rpc.py +++ b/neutron/tests/unit/test_agent_rpc.py @@ -17,9 +17,9 @@ import mock -from quantum.agent import rpc -from quantum.openstack.common import context -from quantum.tests import base +from neutron.agent import rpc +from neutron.openstack.common import context +from neutron.tests import base class AgentRPCPluginApi(base.BaseTestCase): @@ -27,7 +27,7 @@ class AgentRPCPluginApi(base.BaseTestCase): agent = rpc.PluginApi('fake_topic') ctxt = context.RequestContext('fake_user', 'fake_project') expect_val = 'foo' - with mock.patch('quantum.openstack.common.rpc.call') as rpc_call: + with mock.patch('neutron.openstack.common.rpc.call') as rpc_call: rpc_call.return_value = expect_val func_obj = getattr(agent, method) if method == 'tunnel_sync': @@ -91,7 +91,7 @@ class AgentRPCMethods(base.BaseTestCase): mock.call().consume_in_thread() ] - call_to_patch = 'quantum.openstack.common.rpc.create_connection' + call_to_patch = 'neutron.openstack.common.rpc.create_connection' with mock.patch(call_to_patch) as create_connection: rpc.create_consumers(dispatcher, 'foo', [('topic', 'op')]) create_connection.assert_has_calls(expected) diff --git a/quantum/tests/unit/test_api_api_common.py b/neutron/tests/unit/test_api_api_common.py similarity index 95% rename from quantum/tests/unit/test_api_api_common.py rename to neutron/tests/unit/test_api_api_common.py index a936361a70..622ddc8f78 100644 --- a/quantum/tests/unit/test_api_api_common.py +++ b/neutron/tests/unit/test_api_api_common.py @@ -21,11 +21,11 @@ from testtools import matchers from webob import exc -from quantum.api import api_common as common -from quantum.tests import base +from neutron.api import api_common as common +from neutron.tests import base -class FakeController(common.QuantumController): +class FakeController(common.NeutronController): _resource_name = 'fake' diff --git a/quantum/tests/unit/test_api_v2.py b/neutron/tests/unit/test_api_v2.py similarity index 96% rename from quantum/tests/unit/test_api_v2.py rename to neutron/tests/unit/test_api_v2.py index ee9540157c..4e2cc76f26 100644 --- a/quantum/tests/unit/test_api_v2.py +++ b/neutron/tests/unit/test_api_v2.py @@ -24,20 +24,20 @@ import webob from webob import exc import webtest -from quantum.api import api_common -from quantum.api.extensions import PluginAwareExtensionManager -from quantum.api.v2 import attributes -from quantum.api.v2 import base as v2_base -from quantum.api.v2 import router -from quantum.common import config -from quantum.common import exceptions as q_exc -from quantum import context -from quantum.manager import QuantumManager -from quantum.openstack.common.notifier import api as notifer_api -from quantum.openstack.common import policy as common_policy -from quantum.openstack.common import uuidutils -from quantum.tests import base -from quantum.tests.unit import testlib_api +from neutron.api import api_common +from neutron.api.extensions import PluginAwareExtensionManager +from neutron.api.v2 import attributes +from neutron.api.v2 import base as v2_base +from neutron.api.v2 import router +from neutron.common import config +from neutron.common import exceptions as q_exc +from neutron import context +from neutron.manager import NeutronManager +from neutron.openstack.common.notifier import api as notifer_api +from neutron.openstack.common import policy as common_policy +from neutron.openstack.common import uuidutils +from neutron.tests import base +from neutron.tests.unit import testlib_api ROOTDIR = os.path.dirname(os.path.dirname(__file__)) @@ -95,13 +95,13 @@ class APIv2TestBase(base.BaseTestCase): def setUp(self): super(APIv2TestBase, self).setUp() - plugin = 'quantum.quantum_plugin_base_v2.QuantumPluginBaseV2' + plugin = 'neutron.neutron_plugin_base_v2.NeutronPluginBaseV2' # Ensure 'stale' patched copies of the plugin are never returned - QuantumManager._instance = None + NeutronManager._instance = None # Ensure existing ExtensionManager is not used PluginAwareExtensionManager._instance = None # Create the default configurations - args = ['--config-file', etcdir('quantum.conf.test')] + args = ['--config-file', etcdir('neutron.conf.test')] config.parse(args=args) # Update the plugin cfg.CONF.set_override('core_plugin', plugin) @@ -110,8 +110,8 @@ class APIv2TestBase(base.BaseTestCase): self._plugin_patcher = mock.patch(plugin, autospec=True) self.plugin = self._plugin_patcher.start() instance = self.plugin.return_value - instance._QuantumPluginBaseV2__native_pagination_support = True - instance._QuantumPluginBaseV2__native_sorting_support = True + instance._NeutronPluginBaseV2__native_pagination_support = True + instance._NeutronPluginBaseV2__native_sorting_support = True self.addCleanup(self._plugin_patcher.stop) self.addCleanup(cfg.CONF.reset) @@ -455,8 +455,8 @@ class APIv2TestCase(APIv2TestBase): def test_emulated_sort(self): instance = self.plugin.return_value - instance._QuantumPluginBaseV2__native_pagination_support = False - instance._QuantumPluginBaseV2__native_sorting_support = False + instance._NeutronPluginBaseV2__native_pagination_support = False + instance._NeutronPluginBaseV2__native_sorting_support = False instance.get_networks.return_value = [] api = webtest.TestApp(router.APIRouter()) api.get(_get_path('networks'), {'sort_key': ['name', 'status'], @@ -467,8 +467,8 @@ class APIv2TestCase(APIv2TestBase): def test_emulated_sort_without_sort_field(self): instance = self.plugin.return_value - instance._QuantumPluginBaseV2__native_pagination_support = False - instance._QuantumPluginBaseV2__native_sorting_support = False + instance._NeutronPluginBaseV2__native_pagination_support = False + instance._NeutronPluginBaseV2__native_sorting_support = False instance.get_networks.return_value = [] api = webtest.TestApp(router.APIRouter()) api.get(_get_path('networks'), {'sort_key': ['name', 'status'], @@ -486,7 +486,7 @@ class APIv2TestCase(APIv2TestBase): def test_emulated_pagination(self): instance = self.plugin.return_value - instance._QuantumPluginBaseV2__native_pagination_support = False + instance._NeutronPluginBaseV2__native_pagination_support = False instance.get_networks.return_value = [] api = webtest.TestApp(router.APIRouter()) api.get(_get_path('networks'), {'limit': 10, @@ -499,7 +499,7 @@ class APIv2TestCase(APIv2TestBase): def test_native_pagination_without_native_sorting(self): instance = self.plugin.return_value - instance._QuantumPluginBaseV2__native_sorting_support = False + instance._NeutronPluginBaseV2__native_sorting_support = False self.assertRaises(q_exc.Invalid, router.APIRouter) def test_native_pagination_without_allow_sorting(self): @@ -525,7 +525,7 @@ class JSONV2TestCase(APIv2TestBase, testlib_api.WebTestCase): def _test_list(self, req_tenant_id, real_tenant_id): env = {} if req_tenant_id: - env = {'quantum.context': context.Context('', req_tenant_id)} + env = {'neutron.context': context.Context('', req_tenant_id)} input_dict = {'id': uuidutils.generate_uuid(), 'name': 'net1', 'admin_state_up': True, @@ -802,7 +802,7 @@ class JSONV2TestCase(APIv2TestBase, testlib_api.WebTestCase): def test_create_with_keystone_env(self): tenant_id = _uuid() net_id = _uuid() - env = {'quantum.context': context.Context('', tenant_id)} + env = {'neutron.context': context.Context('', tenant_id)} # tenant_id should be fetched from env initial_input = {'network': {'name': 'net1'}} full_input = {'network': {'admin_state_up': True, @@ -828,7 +828,7 @@ class JSONV2TestCase(APIv2TestBase, testlib_api.WebTestCase): def test_create_bad_keystone_tenant(self): tenant_id = _uuid() data = {'network': {'name': 'net1', 'tenant_id': tenant_id}} - env = {'quantum.context': context.Context('', tenant_id + "bad")} + env = {'neutron.context': context.Context('', tenant_id + "bad")} res = self.api.post(_get_path('networks', fmt=self.fmt), self.serialize(data), content_type='application/' + self.fmt, @@ -989,7 +989,7 @@ class JSONV2TestCase(APIv2TestBase, testlib_api.WebTestCase): expect_errors=False): env = {} if req_tenant_id: - env = {'quantum.context': context.Context('', req_tenant_id)} + env = {'neutron.context': context.Context('', req_tenant_id)} instance = self.plugin.return_value instance.get_network.return_value = {'tenant_id': real_tenant_id, 'shared': False} @@ -1019,10 +1019,10 @@ class JSONV2TestCase(APIv2TestBase, testlib_api.WebTestCase): env = {} shared = False if req_tenant_id: - env = {'quantum.context': context.Context('', req_tenant_id)} + env = {'neutron.context': context.Context('', req_tenant_id)} if req_tenant_id.endswith('another'): shared = True - env['quantum.context'].roles = ['tenant_admin'] + env['neutron.context'].roles = ['tenant_admin'] data = {'tenant_id': real_tenant_id, 'shared': shared} instance = self.plugin.return_value @@ -1068,7 +1068,7 @@ class JSONV2TestCase(APIv2TestBase, testlib_api.WebTestCase): expect_errors=False): env = {} if req_tenant_id: - env = {'quantum.context': context.Context('', req_tenant_id)} + env = {'neutron.context': context.Context('', req_tenant_id)} # leave out 'name' field intentionally data = {'network': {'admin_state_up': True}} return_value = {'subnets': []} @@ -1120,8 +1120,8 @@ class SubresourceTest(base.BaseTestCase): def setUp(self): super(SubresourceTest, self).setUp() - plugin = 'quantum.tests.unit.test_api_v2.TestSubresourcePlugin' - QuantumManager._instance = None + plugin = 'neutron.tests.unit.test_api_v2.TestSubresourcePlugin' + NeutronManager._instance = None PluginAwareExtensionManager._instance = None # Save the global RESOURCE_ATTRIBUTE_MAP @@ -1129,7 +1129,7 @@ class SubresourceTest(base.BaseTestCase): for resource, attrs in attributes.RESOURCE_ATTRIBUTE_MAP.iteritems(): self.saved_attr_map[resource] = attrs.copy() - args = ['--config-file', etcdir('quantum.conf.test')] + args = ['--config-file', etcdir('neutron.conf.test')] config.parse(args=args) cfg.CONF.set_override('core_plugin', plugin) @@ -1311,7 +1311,7 @@ class QuotaTest(APIv2TestBase): instance.get_networks_count.assert_called_with(mock.ANY, filters=mock.ANY) self.assertTrue("Quota exceeded for resources" in - res.json['QuantumError']) + res.json['NeutronError']) def test_create_network_quota_no_counts(self): cfg.CONF.set_override('quota_network', 1, group='QUOTAS') @@ -1328,7 +1328,7 @@ class QuotaTest(APIv2TestBase): instance.get_networks_count.assert_called_with(mock.ANY, filters=mock.ANY) self.assertTrue("Quota exceeded for resources" in - res.json['QuantumError']) + res.json['NeutronError']) def test_create_network_quota_without_limit(self): cfg.CONF.set_override('quota_network', -1, group='QUOTAS') @@ -1343,10 +1343,10 @@ class QuotaTest(APIv2TestBase): class ExtensionTestCase(base.BaseTestCase): def setUp(self): super(ExtensionTestCase, self).setUp() - plugin = 'quantum.quantum_plugin_base_v2.QuantumPluginBaseV2' + plugin = 'neutron.neutron_plugin_base_v2.NeutronPluginBaseV2' # Ensure 'stale' patched copies of the plugin are never returned - QuantumManager._instance = None + NeutronManager._instance = None # Ensure existing ExtensionManager is not used PluginAwareExtensionManager._instance = None @@ -1357,7 +1357,7 @@ class ExtensionTestCase(base.BaseTestCase): self.saved_attr_map[resource] = attrs.copy() # Create the default configurations - args = ['--config-file', etcdir('quantum.conf.test')] + args = ['--config-file', etcdir('neutron.conf.test')] config.parse(args=args) # Update the plugin and extensions path @@ -1368,7 +1368,7 @@ class ExtensionTestCase(base.BaseTestCase): self.plugin = self._plugin_patcher.start() # Instantiate mock plugin and enable the V2attributes extension - QuantumManager.get_plugin().supported_extension_aliases = ["v2attrs"] + NeutronManager.get_plugin().supported_extension_aliases = ["v2attrs"] api = router.APIRouter() self.api = webtest.TestApp(api) diff --git a/quantum/tests/unit/test_api_v2_resource.py b/neutron/tests/unit/test_api_v2_resource.py similarity index 90% rename from quantum/tests/unit/test_api_v2_resource.py rename to neutron/tests/unit/test_api_v2_resource.py index f4580de4d0..f4f7289ed9 100644 --- a/quantum/tests/unit/test_api_v2_resource.py +++ b/neutron/tests/unit/test_api_v2_resource.py @@ -22,11 +22,11 @@ import mock from webob import exc import webtest -from quantum.api.v2 import resource as wsgi_resource -from quantum.common import exceptions as q_exc -from quantum import context -from quantum.tests import base -from quantum import wsgi +from neutron.api.v2 import resource as wsgi_resource +from neutron.common import exceptions as q_exc +from neutron import context +from neutron.tests import base +from neutron import wsgi class RequestTestCase(base.BaseTestCase): @@ -90,22 +90,22 @@ class RequestTestCase(base.BaseTestCase): result = request.best_match_content_type() self.assertEqual(result, "application/json") - def test_context_with_quantum_context(self): + def test_context_with_neutron_context(self): ctxt = context.Context('fake_user', 'fake_tenant') - self.req.environ['quantum.context'] = ctxt + self.req.environ['neutron.context'] = ctxt self.assertEqual(self.req.context, ctxt) - def test_context_without_quantum_context(self): + def test_context_without_neutron_context(self): self.assertTrue(self.req.context.is_admin) class ResourceTestCase(base.BaseTestCase): - def test_unmapped_quantum_error_with_json(self): + def test_unmapped_neutron_error_with_json(self): msg = u'\u7f51\u7edc' - class TestException(q_exc.QuantumException): + class TestException(q_exc.NeutronException): message = msg - expected_res = {'body': {'QuantumError': msg}} + expected_res = {'body': {'NeutronError': msg}} controller = mock.MagicMock() controller.test.side_effect = TestException() @@ -118,12 +118,12 @@ class ResourceTestCase(base.BaseTestCase): self.assertEqual(wsgi.JSONDeserializer().deserialize(res.body), expected_res) - def test_unmapped_quantum_error_with_xml(self): + def test_unmapped_neutron_error_with_xml(self): msg = u'\u7f51\u7edc' - class TestException(q_exc.QuantumException): + class TestException(q_exc.NeutronException): message = msg - expected_res = {'body': {'QuantumError': msg}} + expected_res = {'body': {'NeutronError': msg}} controller = mock.MagicMock() controller.test.side_effect = TestException() @@ -136,12 +136,12 @@ class ResourceTestCase(base.BaseTestCase): self.assertEqual(wsgi.XMLDeserializer().deserialize(res.body), expected_res) - def test_mapped_quantum_error_with_json(self): + def test_mapped_neutron_error_with_json(self): msg = u'\u7f51\u7edc' - class TestException(q_exc.QuantumException): + class TestException(q_exc.NeutronException): message = msg - expected_res = {'body': {'QuantumError': msg}} + expected_res = {'body': {'NeutronError': msg}} controller = mock.MagicMock() controller.test.side_effect = TestException() @@ -156,12 +156,12 @@ class ResourceTestCase(base.BaseTestCase): self.assertEqual(wsgi.JSONDeserializer().deserialize(res.body), expected_res) - def test_mapped_quantum_error_with_xml(self): + def test_mapped_neutron_error_with_xml(self): msg = u'\u7f51\u7edc' - class TestException(q_exc.QuantumException): + class TestException(q_exc.NeutronException): message = msg - expected_res = {'body': {'QuantumError': msg}} + expected_res = {'body': {'NeutronError': msg}} controller = mock.MagicMock() controller.test.side_effect = TestException() @@ -187,7 +187,7 @@ class ResourceTestCase(base.BaseTestCase): self.assertEqual(res.status_int, exc.HTTPGatewayTimeout.code) def test_unhandled_error_with_json(self): - expected_res = {'body': {'QuantumError': + expected_res = {'body': {'NeutronError': _('Request Failed: internal server error ' 'while processing your request.')}} controller = mock.MagicMock() @@ -203,7 +203,7 @@ class ResourceTestCase(base.BaseTestCase): expected_res) def test_unhandled_error_with_xml(self): - expected_res = {'body': {'QuantumError': + expected_res = {'body': {'NeutronError': _('Request Failed: internal server error ' 'while processing your request.')}} controller = mock.MagicMock() diff --git a/quantum/tests/unit/test_attributes.py b/neutron/tests/unit/test_attributes.py similarity index 99% rename from quantum/tests/unit/test_attributes.py rename to neutron/tests/unit/test_attributes.py index 085142c901..d02fa61d39 100644 --- a/quantum/tests/unit/test_attributes.py +++ b/neutron/tests/unit/test_attributes.py @@ -17,9 +17,9 @@ import testtools -from quantum.api.v2 import attributes -from quantum.common import exceptions as q_exc -from quantum.tests import base +from neutron.api.v2 import attributes +from neutron.common import exceptions as q_exc +from neutron.tests import base class TestAttributes(base.BaseTestCase): diff --git a/quantum/tests/unit/test_auth.py b/neutron/tests/unit/test_auth.py similarity index 93% rename from quantum/tests/unit/test_auth.py rename to neutron/tests/unit/test_auth.py index 53d0f92112..0db600864d 100644 --- a/quantum/tests/unit/test_auth.py +++ b/neutron/tests/unit/test_auth.py @@ -17,21 +17,21 @@ import webob -from quantum import auth -from quantum.tests import base +from neutron import auth +from neutron.tests import base -class QuantumKeystoneContextTestCase(base.BaseTestCase): +class NeutronKeystoneContextTestCase(base.BaseTestCase): def setUp(self): - super(QuantumKeystoneContextTestCase, self).setUp() + super(NeutronKeystoneContextTestCase, self).setUp() @webob.dec.wsgify def fake_app(req): - self.context = req.environ['quantum.context'] + self.context = req.environ['neutron.context'] return webob.Response() self.context = None - self.middleware = auth.QuantumKeystoneContext(fake_app) + self.middleware = auth.NeutronKeystoneContext(fake_app) self.request = webob.Request.blank('/') self.request.headers['X_AUTH_TOKEN'] = 'testauthtoken' diff --git a/quantum/tests/unit/test_common_utils.py b/neutron/tests/unit/test_common_utils.py similarity index 98% rename from quantum/tests/unit/test_common_utils.py rename to neutron/tests/unit/test_common_utils.py index 21d7b136e3..4fa2719455 100644 --- a/quantum/tests/unit/test_common_utils.py +++ b/neutron/tests/unit/test_common_utils.py @@ -14,10 +14,10 @@ import testtools -from quantum.common import exceptions as q_exc -from quantum.common import utils -from quantum.plugins.common import utils as plugin_utils -from quantum.tests import base +from neutron.common import exceptions as q_exc +from neutron.common import utils +from neutron.plugins.common import utils as plugin_utils +from neutron.tests import base class TestParseMappings(base.BaseTestCase): diff --git a/quantum/tests/unit/test_config.py b/neutron/tests/unit/test_config.py similarity index 93% rename from quantum/tests/unit/test_config.py rename to neutron/tests/unit/test_config.py index 3c16948759..b43a5ffdf3 100644 --- a/quantum/tests/unit/test_config.py +++ b/neutron/tests/unit/test_config.py @@ -17,8 +17,8 @@ import os from oslo.config import cfg -from quantum.common import config # noqa -from quantum.tests import base +from neutron.common import config # noqa +from neutron.tests import base class ConfigurationTest(base.BaseTestCase): @@ -43,4 +43,4 @@ class ConfigurationTest(base.BaseTestCase): self.assertEqual(absolute_dir, cfg.CONF.state_path) self.assertEqual(120, cfg.CONF.dhcp_lease_duration) self.assertFalse(cfg.CONF.allow_overlapping_ips) - self.assertEqual('quantum', cfg.CONF.control_exchange) + self.assertEqual('neutron', cfg.CONF.control_exchange) diff --git a/quantum/tests/unit/test_db_migration.py b/neutron/tests/unit/test_db_migration.py similarity index 97% rename from quantum/tests/unit/test_db_migration.py rename to neutron/tests/unit/test_db_migration.py index 114f3aae6d..608fa757bb 100644 --- a/quantum/tests/unit/test_db_migration.py +++ b/neutron/tests/unit/test_db_migration.py @@ -21,9 +21,9 @@ import sys import mock -from quantum.db import migration -from quantum.db.migration import cli -from quantum.tests import base +from neutron.db import migration +from neutron.db.migration import cli +from neutron.tests import base class TestDbMigration(base.BaseTestCase): diff --git a/quantum/tests/unit/test_db_plugin.py b/neutron/tests/unit/test_db_plugin.py similarity index 96% rename from quantum/tests/unit/test_db_plugin.py rename to neutron/tests/unit/test_db_plugin.py index 729dfe28fe..e8ad031ce3 100644 --- a/quantum/tests/unit/test_db_plugin.py +++ b/neutron/tests/unit/test_db_plugin.py @@ -26,26 +26,26 @@ from oslo.config import cfg from testtools import matchers import webob.exc -import quantum -from quantum.api import api_common -from quantum.api.extensions import PluginAwareExtensionManager -from quantum.api.v2 import attributes -from quantum.api.v2.attributes import ATTR_NOT_SPECIFIED -from quantum.api.v2.router import APIRouter -from quantum.common import config -from quantum.common import exceptions as q_exc -from quantum.common.test_lib import test_config -from quantum import context -from quantum.db import api as db -from quantum.db import db_base_plugin_v2 -from quantum.db import models_v2 -from quantum.manager import QuantumManager -from quantum.openstack.common import timeutils -from quantum.tests import base -from quantum.tests.unit import test_extensions -from quantum.tests.unit import testlib_api +import neutron +from neutron.api import api_common +from neutron.api.extensions import PluginAwareExtensionManager +from neutron.api.v2 import attributes +from neutron.api.v2.attributes import ATTR_NOT_SPECIFIED +from neutron.api.v2.router import APIRouter +from neutron.common import config +from neutron.common import exceptions as q_exc +from neutron.common.test_lib import test_config +from neutron import context +from neutron.db import api as db +from neutron.db import db_base_plugin_v2 +from neutron.db import models_v2 +from neutron.manager import NeutronManager +from neutron.openstack.common import timeutils +from neutron.tests import base +from neutron.tests.unit import test_extensions +from neutron.tests.unit import testlib_api -DB_PLUGIN_KLASS = 'quantum.db.db_base_plugin_v2.QuantumDbPluginV2' +DB_PLUGIN_KLASS = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' ROOTDIR = os.path.dirname(os.path.dirname(__file__)) ETCDIR = os.path.join(ROOTDIR, 'etc') @@ -72,15 +72,15 @@ def _fake_get_sorting_helper(self, request): return api_common.SortingEmulatedHelper(request, self._attr_info) -class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): +class NeutronDbPluginV2TestCase(testlib_api.WebTestCase): fmt = 'json' resource_prefix_map = {} def setUp(self, plugin=None, service_plugins=None): - super(QuantumDbPluginV2TestCase, self).setUp() + super(NeutronDbPluginV2TestCase, self).setUp() # Make sure at each test a new instance of the plugin is returned - QuantumManager._instance = None + NeutronManager._instance = None # Make sure at each test according extensions for the plugin is loaded PluginAwareExtensionManager._instance = None # Save the attributes map in case the plugin will alter it @@ -99,7 +99,7 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): plugin = test_config.get('plugin_name_v2', DB_PLUGIN_KLASS) # Create the default configurations - args = ['--config-file', etcdir('quantum.conf.test')] + args = ['--config-file', etcdir('neutron.conf.test')] # If test_config specifies some config-file, use it, as well for config_file in test_config.get('config_files', []): args.extend(['--config-file', config_file]) @@ -122,7 +122,7 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): self.port_create_status = 'ACTIVE' def _is_native_bulk_supported(): - plugin_obj = QuantumManager.get_plugin() + plugin_obj = NeutronManager.get_plugin() native_bulk_attr_name = ("_%s__native_bulk_support" % plugin_obj.__class__.__name__) return getattr(plugin_obj, native_bulk_attr_name, False) @@ -132,9 +132,9 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): def _is_native_pagination_support(): native_pagination_attr_name = ( "_%s__native_pagination_support" % - QuantumManager.get_plugin().__class__.__name__) + NeutronManager.get_plugin().__class__.__name__) return (cfg.CONF.allow_pagination and - getattr(QuantumManager.get_plugin(), + getattr(NeutronManager.get_plugin(), native_pagination_attr_name, False)) self._skip_native_pagination = not _is_native_pagination_support() @@ -142,9 +142,9 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): def _is_native_sorting_support(): native_sorting_attr_name = ( "_%s__native_sorting_support" % - QuantumManager.get_plugin().__class__.__name__) + NeutronManager.get_plugin().__class__.__name__) return (cfg.CONF.allow_sorting and - getattr(QuantumManager.get_plugin(), + getattr(NeutronManager.get_plugin(), native_sorting_attr_name, False)) self._skip_native_sorting = not _is_native_sorting_support() @@ -160,13 +160,13 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): self._skip_native_pagination = None self._skip_native_sortin = None self.ext_api = None - # NOTE(jkoelker) for a 'pluggable' framework, Quantum sure + # NOTE(jkoelker) for a 'pluggable' framework, Neutron sure # doesn't like when the plugin changes ;) db.clear_db() cfg.CONF.reset() # Restore the original attribute map attributes.RESOURCE_ATTRIBUTE_MAP = self._attribute_map_bk - super(QuantumDbPluginV2TestCase, self).tearDown() + super(NeutronDbPluginV2TestCase, self).tearDown() def _req(self, method, resource, data=None, fmt=None, id=None, params=None, action=None, subresource=None, sub_id=None): @@ -249,10 +249,10 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): kwargs['set_context'] is True and 'tenant_id' in kwargs): # create a specific auth context for this request - req.environ['quantum.context'] = context.Context( + req.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) elif 'context' in kwargs: - req.environ['quantum.context'] = kwargs['context'] + req.environ['neutron.context'] = kwargs['context'] return req.get_response(self.api) def _create_bulk(self, fmt, number, resource, data, name='test', **kwargs): @@ -271,10 +271,10 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): kwargs['set_context'] is True and 'tenant_id' in kwargs): # create a specific auth context for this request - req.environ['quantum.context'] = context.Context( + req.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) elif 'context' in kwargs: - req.environ['quantum.context'] = kwargs['context'] + req.environ['neutron.context'] = kwargs['context'] return req.get_response(self.api) def _create_network(self, fmt, name, admin_state_up, @@ -290,7 +290,7 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): network_req = self.new_create_request('networks', data, fmt) if (kwargs.get('set_context') and 'tenant_id' in kwargs): # create a specific auth context for this request - network_req.environ['quantum.context'] = context.Context( + network_req.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) return network_req.get_response(self.api) @@ -323,7 +323,7 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): subnet_req = self.new_create_request('subnets', data, fmt) if (kwargs.get('set_context') and 'tenant_id' in kwargs): # create a specific auth context for this request - subnet_req.environ['quantum.context'] = context.Context( + subnet_req.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) subnet_res = subnet_req.get_response(self.api) @@ -359,7 +359,7 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): port_req = self.new_create_request('ports', data, fmt) if (kwargs.get('set_context') and 'tenant_id' in kwargs): # create a specific auth context for this request - port_req.environ['quantum.context'] = context.Context( + port_req.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) port_res = port_req.get_response(self.api) @@ -377,7 +377,7 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): kwargs['set_context'] is True and 'tenant_id' in kwargs): # create a specific auth context for this request - port_req.environ['quantum.context'] = context.Context( + port_req.environ['neutron.context'] = context.Context( '', kwargs['tenant_id']) port_res = port_req.get_response(self.api) @@ -438,42 +438,42 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): def _delete(self, collection, id, expected_code=webob.exc.HTTPNoContent.code, - quantum_context=None): + neutron_context=None): req = self.new_delete_request(collection, id) - if quantum_context: + if neutron_context: # create a specific auth context for this request - req.environ['quantum.context'] = quantum_context + req.environ['neutron.context'] = neutron_context res = req.get_response(self._api_for_resource(collection)) self.assertEqual(res.status_int, expected_code) def _show(self, resource, id, expected_code=webob.exc.HTTPOk.code, - quantum_context=None): + neutron_context=None): req = self.new_show_request(resource, id) - if quantum_context: + if neutron_context: # create a specific auth context for this request - req.environ['quantum.context'] = quantum_context + req.environ['neutron.context'] = neutron_context res = req.get_response(self._api_for_resource(resource)) self.assertEqual(res.status_int, expected_code) return self.deserialize(self.fmt, res) def _update(self, resource, id, new_data, expected_code=webob.exc.HTTPOk.code, - quantum_context=None): + neutron_context=None): req = self.new_update_request(resource, new_data, id) - if quantum_context: + if neutron_context: # create a specific auth context for this request - req.environ['quantum.context'] = quantum_context + req.environ['neutron.context'] = neutron_context res = req.get_response(self._api_for_resource(resource)) self.assertEqual(res.status_int, expected_code) return self.deserialize(self.fmt, res) - def _list(self, resource, fmt=None, quantum_context=None, + def _list(self, resource, fmt=None, neutron_context=None, query_params=None): fmt = fmt or self.fmt req = self.new_list_request(resource, fmt, query_params) - if quantum_context: - req.environ['quantum.context'] = quantum_context + if neutron_context: + req.environ['neutron.context'] = neutron_context res = req.get_response(self._api_for_resource(resource)) self.assertEqual(res.status_int, webob.exc.HTTPOk.code) return self.deserialize(fmt, res) @@ -481,7 +481,7 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): def _do_side_effect(self, patched_plugin, orig, *args, **kwargs): """Invoked by test cases for injecting failures in plugin.""" def second_call(*args, **kwargs): - raise q_exc.QuantumException + raise q_exc.NeutronException patched_plugin.side_effect = second_call return orig(*args, **kwargs) @@ -501,10 +501,10 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): self.assertEqual(items[0]['name'], 'test_0') self.assertEqual(items[1]['name'], 'test_1') - def _test_list_resources(self, resource, items, quantum_context=None, + def _test_list_resources(self, resource, items, neutron_context=None, query_params=None): res = self._list('%ss' % resource, - quantum_context=quantum_context, + neutron_context=neutron_context, query_params=query_params) resource = resource.replace('-', '_') self.assertEqual(sorted([i['id'] for i in res['%ss' % resource]]), @@ -652,10 +652,10 @@ class QuantumDbPluginV2TestCase(testlib_api.WebTestCase): sorted(expected_res)) -class TestBasicGet(QuantumDbPluginV2TestCase): +class TestBasicGet(NeutronDbPluginV2TestCase): def test_single_get_admin(self): - plugin = quantum.db.db_base_plugin_v2.QuantumDbPluginV2() + plugin = neutron.db.db_base_plugin_v2.NeutronDbPluginV2() with self.network() as network: net_id = network['network']['id'] ctx = context.get_admin_context() @@ -663,7 +663,7 @@ class TestBasicGet(QuantumDbPluginV2TestCase): self.assertEqual(net_id, n.id) def test_single_get_tenant(self): - plugin = quantum.db.db_base_plugin_v2.QuantumDbPluginV2() + plugin = neutron.db.db_base_plugin_v2.NeutronDbPluginV2() with self.network() as network: net_id = network['network']['id'] ctx = context.get_admin_context() @@ -671,7 +671,7 @@ class TestBasicGet(QuantumDbPluginV2TestCase): self.assertEqual(net_id, n.id) -class TestV2HTTPResponse(QuantumDbPluginV2TestCase): +class TestV2HTTPResponse(NeutronDbPluginV2TestCase): def test_create_returns_201(self): res = self._create_network(self.fmt, 'net2', True) self.assertEqual(res.status_int, 201) @@ -705,7 +705,7 @@ class TestV2HTTPResponse(QuantumDbPluginV2TestCase): tenant_id=tenant_id, set_context=True) req = self.new_list_request('networks', params="fields=name") - req.environ['quantum.context'] = context.Context('', tenant_id) + req.environ['neutron.context'] = context.Context('', tenant_id) res = req.get_response(self.api) self._check_list_with_fields(res, 'name') @@ -724,7 +724,7 @@ class TestV2HTTPResponse(QuantumDbPluginV2TestCase): tenant_id=tenant_id, set_context=True) req = self.new_list_request('networks', params="fields=tenant_id") - req.environ['quantum.context'] = context.Context('', tenant_id) + req.environ['neutron.context'] = context.Context('', tenant_id) res = req.get_response(self.api) self._check_list_with_fields(res, 'tenant_id') @@ -763,7 +763,7 @@ class TestV2HTTPResponse(QuantumDbPluginV2TestCase): self.assertEqual(res.status_int, 404) -class TestPortsV2(QuantumDbPluginV2TestCase): +class TestPortsV2(NeutronDbPluginV2TestCase): def test_create_port_json(self): keys = [('admin_state_up', True), ('status', self.port_create_status)] with self.port(name='myname') as port: @@ -872,8 +872,8 @@ class TestPortsV2(QuantumDbPluginV2TestCase): with mock.patch('__builtin__.hasattr', new=fakehasattr): - orig = QuantumManager.get_plugin().create_port - with mock.patch.object(QuantumManager.get_plugin(), + orig = NeutronManager.get_plugin().create_port + with mock.patch.object(NeutronManager.get_plugin(), 'create_port') as patched_plugin: def side_effect(*args, **kwargs): @@ -894,8 +894,8 @@ class TestPortsV2(QuantumDbPluginV2TestCase): self.skipTest("Plugin does not support native bulk port create") ctx = context.get_admin_context() with self.network() as net: - orig = QuantumManager._instance.plugin.create_port - with mock.patch.object(QuantumManager._instance.plugin, + orig = NeutronManager._instance.plugin.create_port + with mock.patch.object(NeutronManager._instance.plugin, 'create_port') as patched_plugin: def side_effect(*args, **kwargs): @@ -940,11 +940,11 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s # Tenant_1 request - must return single port q_context = context.Context('', 'tenant_1') self._test_list_resources('port', [port1], - quantum_context=q_context) + neutron_context=q_context) # Tenant_2 request - must return single port q_context = context.Context('', 'tenant_2') self._test_list_resources('port', [port2], - quantum_context=q_context) + neutron_context=q_context) def test_list_ports_with_sort_native(self): if self._skip_native_sorting: @@ -963,7 +963,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s def test_list_ports_with_sort_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_sorting_helper', + 'neutron.api.v2.base.Controller._get_sorting_helper', new=_fake_get_sorting_helper) helper_patcher.start() try: @@ -995,7 +995,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s def test_list_ports_with_pagination_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_pagination_helper', + 'neutron.api.v2.base.Controller._get_pagination_helper', new=_fake_get_pagination_helper) helper_patcher.start() try: @@ -1025,7 +1025,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s def test_list_ports_with_pagination_reverse_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_pagination_helper', + 'neutron.api.v2.base.Controller._get_pagination_helper', new=_fake_get_pagination_helper) helper_patcher.start() try: @@ -1083,9 +1083,9 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s tenant_id='not_admin', set_context=True) port = self.deserialize(self.fmt, res) data = {'port': {'admin_state_up': False}} - quantum_context = context.Context('', 'not_admin') + neutron_context = context.Context('', 'not_admin') port = self._update('ports', port['port']['id'], data, - quantum_context=quantum_context) + neutron_context=neutron_context) self.assertEqual(port['port']['admin_state_up'], False) def test_update_device_id_null(self): @@ -1131,7 +1131,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s res = self._create_port(self.fmt, id) data = self.deserialize(self.fmt, res) msg = str(q_exc.IpAddressGenerationFailure(net_id=id)) - self.assertEqual(data['QuantumError'], msg) + self.assertEqual(data['NeutronError'], msg) self.assertEqual(res.status_int, 409) def test_update_port_update_ip(self): @@ -1257,7 +1257,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s def fake_gen_mac(context, net_id): raise q_exc.MacAddressGenerationFailure(net_id=net_id) - with mock.patch.object(quantum.db.db_base_plugin_v2.QuantumDbPluginV2, + with mock.patch.object(neutron.db.db_base_plugin_v2.NeutronDbPluginV2, '_generate_mac', new=fake_gen_mac): res = self._create_network(fmt=self.fmt, name='net1', admin_state_up=True) @@ -1648,14 +1648,14 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s with mock.patch.object(timeutils, 'utcnow') as mock_utcnow: mock_utcnow.return_value = reference - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() expires = plugin._default_allocation_expiration() self.assertEqual(expires, reference + datetime.timedelta(seconds=120)) def test_update_fixed_ip_lease_expiration(self): cfg.CONF.set_override('dhcp_lease_duration', 10) - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() with self.subnet() as subnet: with self.port(subnet=subnet) as port: update_context = context.Context('', port['port']['tenant_id']) @@ -1677,7 +1677,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s matchers.GreaterThan(datetime.timedelta(seconds=10))) def test_port_delete_holds_ip(self): - base_class = db_base_plugin_v2.QuantumDbPluginV2 + base_class = db_base_plugin_v2.NeutronDbPluginV2 with mock.patch.object(base_class, '_hold_ip') as hold_ip: with self.subnet() as subnet: with self.port(subnet=subnet, no_delete=True) as port: @@ -1694,7 +1694,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s def test_update_fixed_ip_lease_expiration_invalid_address(self): cfg.CONF.set_override('dhcp_lease_duration', 10) - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() with self.subnet() as subnet: with self.port(subnet=subnet) as port: update_context = context.Context('', port['port']['tenant_id']) @@ -1707,7 +1707,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s self.assertTrue(log.mock_calls) def test_hold_ip_address(self): - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() with self.subnet() as subnet: with self.port(subnet=subnet) as port: update_context = context.Context('', port['port']['tenant_id']) @@ -1728,7 +1728,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s self.assertEqual(q.count(), 1) def test_recycle_held_ip_address(self): - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() with self.subnet() as subnet: with self.port(subnet=subnet) as port: update_context = context.Context('', port['port']['tenant_id']) @@ -1747,7 +1747,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s set([subnet['subnet']['network_id']])) def test_recycle_expired_previously_run_within_context(self): - plugin = QuantumManager.get_plugin() + plugin = NeutronManager.get_plugin() with self.subnet() as subnet: with self.port(subnet=subnet) as port: update_context = context.Context('', port['port']['tenant_id']) @@ -1801,7 +1801,7 @@ fixed_ips=ip_address%%3D%s&fixed_ips=ip_address%%3D%s&fixed_ips=subnet_id%%3D%s self.assertEqual(res.status_int, 400) -class TestNetworksV2(QuantumDbPluginV2TestCase): +class TestNetworksV2(NeutronDbPluginV2TestCase): # NOTE(cerberus): successful network update and delete are # effectively tested above def test_create_network(self): @@ -1847,7 +1847,7 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): req = self.new_update_request('networks', data, network['network']['id']) - req.environ['quantum.context'] = context.Context('', 'somebody') + req.environ['neutron.context'] = context.Context('', 'somebody') res = req.get_response(self.api) # The API layer always returns 404 on updates in place of 403 self.assertEqual(res.status_int, 404) @@ -1873,7 +1873,7 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): # must query db to see whether subnet's shared attribute # has been updated or not ctx = context.Context('', '', is_admin=True) - subnet_db = QuantumManager.get_plugin()._get_subnet( + subnet_db = NeutronManager.get_plugin()._get_subnet( ctx, subnet['subnet']['id']) self.assertEqual(subnet_db['shared'], True) @@ -2035,11 +2035,11 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): return False return real_has_attr(item, attr) - orig = QuantumManager.get_plugin().create_network + orig = NeutronManager.get_plugin().create_network #ensures the API choose the emulation code path with mock.patch('__builtin__.hasattr', new=fakehasattr): - with mock.patch.object(QuantumManager.get_plugin(), + with mock.patch.object(NeutronManager.get_plugin(), 'create_network') as patched_plugin: def side_effect(*args, **kwargs): @@ -2054,8 +2054,8 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): def test_create_networks_bulk_native_plugin_failure(self): if self._skip_native_bulk: self.skipTest("Plugin does not support native bulk network create") - orig = QuantumManager.get_plugin().create_network - with mock.patch.object(QuantumManager.get_plugin(), + orig = NeutronManager.get_plugin().create_network + with mock.patch.object(NeutronManager.get_plugin(), 'create_network') as patched_plugin: def side_effect(*args, **kwargs): @@ -2120,7 +2120,7 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): def test_list_networks_with_sort_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_sorting_helper', + 'neutron.api.v2.base.Controller._get_sorting_helper', new=_fake_get_sorting_helper) helper_patcher.start() try: @@ -2150,7 +2150,7 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): def test_list_networks_with_pagination_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_pagination_helper', + 'neutron.api.v2.base.Controller._get_pagination_helper', new=_fake_get_pagination_helper) helper_patcher.start() try: @@ -2166,7 +2166,7 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): def test_list_networks_without_pk_in_fields_pagination_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_pagination_helper', + 'neutron.api.v2.base.Controller._get_pagination_helper', new=_fake_get_pagination_helper) helper_patcher.start() try: @@ -2211,7 +2211,7 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): def test_list_networks_with_pagination_reverse_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_pagination_helper', + 'neutron.api.v2.base.Controller._get_pagination_helper', new=_fake_get_pagination_helper) helper_patcher.start() try: @@ -2304,7 +2304,7 @@ class TestNetworksV2(QuantumDbPluginV2TestCase): self.assertEqual(res['network']['admin_state_up'], v[1]) -class TestSubnetsV2(QuantumDbPluginV2TestCase): +class TestSubnetsV2(NeutronDbPluginV2TestCase): def _test_create_subnet(self, network=None, expected=None, **kwargs): keys = kwargs.copy() @@ -2456,8 +2456,8 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase): with mock.patch('__builtin__.hasattr', new=fakehasattr): - orig = QuantumManager.get_plugin().create_subnet - with mock.patch.object(QuantumManager.get_plugin(), + orig = NeutronManager.get_plugin().create_subnet + with mock.patch.object(NeutronManager.get_plugin(), 'create_subnet') as patched_plugin: def side_effect(*args, **kwargs): @@ -2475,8 +2475,8 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase): def test_create_subnets_bulk_native_plugin_failure(self): if self._skip_native_bulk: self.skipTest("Plugin does not support native bulk subnet create") - orig = QuantumManager._instance.plugin.create_subnet - with mock.patch.object(QuantumManager._instance.plugin, + orig = NeutronManager._instance.plugin.create_subnet + with mock.patch.object(NeutronManager._instance.plugin, 'create_subnet') as patched_plugin: def side_effect(*args, **kwargs): return self._do_side_effect(patched_plugin, orig, @@ -2529,7 +2529,7 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase): data = self.deserialize(self.fmt, res) self.assertEqual(res.status_int, 409) msg = str(q_exc.SubnetInUse(subnet_id=id)) - self.assertEqual(data['QuantumError'], msg) + self.assertEqual(data['NeutronError'], msg) def test_delete_network(self): gateway_ip = '10.0.0.1' @@ -3133,7 +3133,7 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase): with self.subnet(cidr='10.0.1.0/24') as priv_subnet: # normal user should see only 1 subnet req = self.new_list_request('subnets') - req.environ['quantum.context'] = context.Context( + req.environ['neutron.context'] = context.Context( '', 'some_tenant') res = self.deserialize(self.fmt, req.get_response(self.api)) @@ -3181,7 +3181,7 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase): def test_list_subnets_with_sort_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_sorting_helper', + 'neutron.api.v2.base.Controller._get_sorting_helper', new=_fake_get_sorting_helper) helper_patcher.start() try: @@ -3213,7 +3213,7 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase): def test_list_subnets_with_pagination_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_pagination_helper', + 'neutron.api.v2.base.Controller._get_pagination_helper', new=_fake_get_pagination_helper) helper_patcher.start() try: @@ -3241,7 +3241,7 @@ class TestSubnetsV2(QuantumDbPluginV2TestCase): def test_list_subnets_with_pagination_reverse_emulated(self): helper_patcher = mock.patch( - 'quantum.api.v2.base.Controller._get_pagination_helper', + 'neutron.api.v2.base.Controller._get_pagination_helper', new=_fake_get_pagination_helper) helper_patcher.start() try: @@ -3513,7 +3513,7 @@ class DbModelTestCase(base.BaseTestCase): network = models_v2.Network(name="net_net", status="OK", admin_state_up=True) actual_repr_output = repr(network) - exp_start_with = "=0.1.4 kombu>=1.0.4 netaddr -python-quantumclient>=2.2.0,<3.0.0 +python-neutronclient>=2.2.3,<3.0.0 pyudev sqlalchemy>=0.7.8,<=0.7.99 WebOb>=1.2 diff --git a/run_tests.py b/run_tests.py index eb5c6aa036..a673f47286 100755 --- a/run_tests.py +++ b/run_tests.py @@ -17,7 +17,7 @@ # limitations under the License. -"""Unittest runner for quantum +"""Unittest runner for neutron To run all test:: python run_tests.py @@ -47,8 +47,8 @@ import sys from nose import config from nose import core -from quantum.common.test_lib import run_tests -import quantum.tests.unit +from neutron.common.test_lib import run_tests +import neutron.tests.unit def main(): @@ -58,7 +58,7 @@ def main(): includeExe=True, traverseNamespace=True, plugins=core.DefaultPluginManager()) - c.configureWhere(quantum.tests.unit.__path__) + c.configureWhere(neutron.tests.unit.__path__) sys.exit(run_tests(c)) if __name__ == "__main__": diff --git a/run_tests.sh b/run_tests.sh index 668a5a88a6..78eb99a6c0 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -4,7 +4,7 @@ set -eu function usage { echo "Usage: $0 [OPTION]..." - echo "Run Quantum's test suite(s)" + echo "Run Neutron's test suite(s)" echo "" echo " -V, --virtual-env Always use virtualenv. Install automatically if not present" echo " -N, --no-virtual-env Don't use virtualenv. Run tests in local environment" @@ -116,7 +116,7 @@ function run_tests { if [ "$testropts" = "" ] && [ "$testrargs" = "" ]; then # Default to running all tests if specific test is not # provided. - testrargs="discover ./quantum/tests" + testrargs="discover ./neutron/tests" fi ${wrapper} python -m testtools.run $testropts $testrargs @@ -147,7 +147,7 @@ function run_tests { echo "Generating coverage report in covhtml/" # Don't compute coverage for common code, which is tested elsewhere ${wrapper} coverage combine - ${wrapper} coverage html --include='quantum/*' --omit='quantum/openstack/common/*' -d covhtml -i + ${wrapper} coverage html --include='neutron/*' --omit='neutron/openstack/common/*' -d covhtml -i fi return $RESULT diff --git a/setup.cfg b/setup.cfg index 7b68c602ad..22acb1afe8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = quantum +name = neutron version = 2013.2 summary = OpenStack Networking description-file = @@ -20,73 +20,93 @@ classifier = [files] packages = + neutron quantum data_files = - etc/quantum = + etc/neutron = etc/api-paste.ini etc/dhcp_agent.ini etc/l3_agent.ini etc/lbaas_agent.ini etc/metadata_agent.ini etc/policy.json - etc/quantum.conf + etc/neutron.conf etc/rootwrap.conf - etc/quantum/rootwrap.d = - etc/quantum/rootwrap.d/dhcp.filters - etc/quantum/rootwrap.d/iptables-firewall.filters - etc/quantum/rootwrap.d/l3.filters - etc/quantum/rootwrap.d/lbaas-haproxy.filters - etc/quantum/rootwrap.d/linuxbridge-plugin.filters - etc/quantum/rootwrap.d/nec-plugin.filters - etc/quantum/rootwrap.d/openvswitch-plugin.filters - etc/quantum/rootwrap.d/ryu-plugin.filters - etc/init.d = etc/init.d/quantum-server - etc/quantum/plugins/bigswitch = etc/quantum/plugins/bigswitch/restproxy.ini - etc/quantum/plugins/brocade = etc/quantum/plugins/brocade/brocade.ini - etc/quantum/plugins/cisco = etc/quantum/plugins/cisco/cisco_plugins.ini - etc/quantum/plugins/hyperv = etc/quantum/plugins/hyperv/hyperv_quantum_plugin.ini - etc/quantum/plugins/linuxbridge = etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini - etc/quantum/plugins/metaplugin = etc/quantum/plugins/metaplugin/metaplugin.ini - etc/quantum/plugins/midonet = etc/quantum/plugins/midonet/midonet.ini - etc/quantum/plugins/ml2 = etc/quantum/plugins/ml2/ml2_conf.ini - etc/quantum/plugins/mlnx = etc/quantum/plugins/mlnx/mlnx_conf.ini - etc/quantum/plugins/nec = etc/quantum/plugins/nec/nec.ini - etc/quantum/plugins/nicira = etc/quantum/plugins/nicira/nvp.ini - etc/quantum/plugins/openvswitch = etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini - etc/quantum/plugins/plumgrid = etc/quantum/plugins/plumgrid/plumgrid.ini - etc/quantum/plugins/ryu = etc/quantum/plugins/ryu/ryu.ini + etc/neutron/rootwrap.d = + etc/neutron/rootwrap.d/dhcp.filters + etc/neutron/rootwrap.d/iptables-firewall.filters + etc/neutron/rootwrap.d/l3.filters + etc/neutron/rootwrap.d/lbaas-haproxy.filters + etc/neutron/rootwrap.d/linuxbridge-plugin.filters + etc/neutron/rootwrap.d/nec-plugin.filters + etc/neutron/rootwrap.d/openvswitch-plugin.filters + etc/neutron/rootwrap.d/ryu-plugin.filters + etc/init.d = etc/init.d/neutron-server + etc/neutron/plugins/bigswitch = etc/neutron/plugins/bigswitch/restproxy.ini + etc/neutron/plugins/brocade = etc/neutron/plugins/brocade/brocade.ini + etc/neutron/plugins/cisco = etc/neutron/plugins/cisco/cisco_plugins.ini + etc/neutron/plugins/hyperv = etc/neutron/plugins/hyperv/hyperv_neutron_plugin.ini + etc/neutron/plugins/linuxbridge = etc/neutron/plugins/linuxbridge/linuxbridge_conf.ini + etc/neutron/plugins/metaplugin = etc/neutron/plugins/metaplugin/metaplugin.ini + etc/neutron/plugins/midonet = etc/neutron/plugins/midonet/midonet.ini + etc/neutron/plugins/ml2 = etc/neutron/plugins/ml2/ml2_conf.ini + etc/neutron/plugins/mlnx = etc/neutron/plugins/mlnx/mlnx_conf.ini + etc/neutron/plugins/nec = etc/neutron/plugins/nec/nec.ini + etc/neutron/plugins/nicira = etc/neutron/plugins/nicira/nvp.ini + etc/neutron/plugins/openvswitch = etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini + etc/neutron/plugins/plumgrid = etc/neutron/plugins/plumgrid/plumgrid.ini + etc/neutron/plugins/ryu = etc/neutron/plugins/ryu/ryu.ini scripts = bin/quantum-rootwrap + bin/neutron-rootwrap [global] setup-hooks = pbr.hooks.setup_hook - quantum.hooks.setup_hook + neutron.hooks.setup_hook [entry_points] console_scripts = - quantum-check-nvp-config = quantum.plugins.nicira.check_nvp_config:main - quantum-db-manage = quantum.db.migration.cli:main - quantum-debug = quantum.debug.shell:main - quantum-dhcp-agent = quantum.agent.dhcp_agent:main - quantum-dhcp-agent-dnsmasq-lease-update = quantum.agent.linux.dhcp:Dnsmasq.lease_update - quantum-hyperv-agent = quantum.plugins.hyperv.agent.hyperv_quantum_agent:main - quantum-l3-agent = quantum.agent.l3_agent:main - quantum-lbaas-agent = quantum.services.loadbalancer.drivers.haproxy.agent:main - quantum-linuxbridge-agent = quantum.plugins.linuxbridge.agent.linuxbridge_quantum_agent:main - quantum-metadata-agent = quantum.agent.metadata.agent:main - quantum-mlnx-agent = quantum.plugins.mlnx.agent.eswitch_quantum_agent:main - quantum-nec-agent = quantum.plugins.nec.agent.nec_quantum_agent:main - quantum-netns-cleanup = quantum.agent.netns_cleanup_util:main - quantum-ns-metadata-proxy = quantum.agent.metadata.namespace_proxy:main - quantum-openvswitch-agent = quantum.plugins.openvswitch.agent.ovs_quantum_agent:main - quantum-ovs-cleanup = quantum.agent.ovs_cleanup_util:main - quantum-ryu-agent = quantum.plugins.ryu.agent.ryu_quantum_agent:main - quantum-server = quantum.server:main -quantum.ml2.type_drivers = - flat = quantum.plugins.ml2.drivers.type_flat:FlatTypeDriver - local = quantum.plugins.ml2.drivers.type_local:LocalTypeDriver - vlan = quantum.plugins.ml2.drivers.type_vlan:VlanTypeDriver + neutron-check-nvp-config = neutron.plugins.nicira.check_nvp_config:main + neutron-db-manage = neutron.db.migration.cli:main + neutron-debug = neutron.debug.shell:main + neutron-dhcp-agent = neutron.agent.dhcp_agent:main + neutron-dhcp-agent-dnsmasq-lease-update = neutron.agent.linux.dhcp:Dnsmasq.lease_update + neutron-hyperv-agent = neutron.plugins.hyperv.agent.hyperv_neutron_agent:main + neutron-l3-agent = neutron.agent.l3_agent:main + neutron-lbaas-agent = neutron.services.loadbalancer.drivers.haproxy.agent:main + neutron-linuxbridge-agent = neutron.plugins.linuxbridge.agent.linuxbridge_neutron_agent:main + neutron-metadata-agent = neutron.agent.metadata.agent:main + neutron-mlnx-agent = neutron.plugins.mlnx.agent.eswitch_neutron_agent:main + neutron-nec-agent = neutron.plugins.nec.agent.nec_neutron_agent:main + neutron-netns-cleanup = neutron.agent.netns_cleanup_util:main + neutron-ns-metadata-proxy = neutron.agent.metadata.namespace_proxy:main + neutron-openvswitch-agent = neutron.plugins.openvswitch.agent.ovs_neutron_agent:main + neutron-ovs-cleanup = neutron.agent.ovs_cleanup_util:main + neutron-ryu-agent = neutron.plugins.ryu.agent.ryu_neutron_agent:main + neutron-server = neutron.server:main + quantum-check-nvp-config = neutron.plugins.nicira.check_nvp_config:main + quantum-db-manage = neutron.db.migration.cli:main + quantum-debug = neutron.debug.shell:main + quantum-dhcp-agent = neutron.agent.dhcp_agent:main + quantum-dhcp-agent-dnsmasq-lease-update = neutron.agent.linux.dhcp:Dnsmasq.lease_update + quantum-hyperv-agent = neutron.plugins.hyperv.agent.hyperv_neutron_agent:main + quantum-l3-agent = neutron.agent.l3_agent:main + quantum-lbaas-agent = neutron.services.loadbalancer.drivers.haproxy.agent:main + quantum-linuxbridge-agent = neutron.plugins.linuxbridge.agent.linuxbridge_neutron_agent:main + quantum-metadata-agent = neutron.agent.metadata.agent:main + quantum-mlnx-agent = neutron.plugins.mlnx.agent.eswitch_neutron_agent:main + quantum-nec-agent = neutron.plugins.nec.agent.nec_neutron_agent:main + quantum-netns-cleanup = neutron.agent.netns_cleanup_util:main + quantum-ns-metadata-proxy = neutron.agent.metadata.namespace_proxy:main + quantum-openvswitch-agent = neutron.plugins.openvswitch.agent.ovs_neutron_agent:main + quantum-ovs-cleanup = neutron.agent.ovs_cleanup_util:main + quantum-ryu-agent = neutron.plugins.ryu.agent.ryu_neutron_agent:main + quantum-server = neutron.server:main +neutron.ml2.type_drivers = + flat = neutron.plugins.ml2.drivers.type_flat:FlatTypeDriver + local = neutron.plugins.ml2.drivers.type_local:LocalTypeDriver + vlan = neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver [build_sphinx] all_files = 1 @@ -96,13 +116,13 @@ source-dir = doc/source [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg -output_file = quantum/locale/quantum.pot +output_file = neutron/locale/neutron.pot [compile_catalog] -directory = quantum/locale -domain = quantum +directory = neutron/locale +domain = neutron [update_catalog] -domain = quantum -output_dir = quantum/locale -input_file = quantum/locale/quantum.pot +domain = neutron +output_dir = neutron/locale +input_file = neutron/locale/neutron.pot diff --git a/tools/clean.sh b/tools/clean.sh index c1deb844c6..27bc219f9c 100755 --- a/tools/clean.sh +++ b/tools/clean.sh @@ -2,4 +2,4 @@ rm -rf ./*.deb ./*.tar.gz ./*.dsc ./*.changes rm -rf */*.deb rm -rf ./plugins/**/build/ ./plugins/**/dist -rm -rf ./plugins/**/lib/quantum_*_plugin.egg-info ./plugins/quantum-* +rm -rf ./plugins/**/lib/neutron_*_plugin.egg-info ./plugins/neutron-* diff --git a/tools/i18n_cfg.py b/tools/i18n_cfg.py index 9cd87acc3d..abc1bfb14a 100644 --- a/tools/i18n_cfg.py +++ b/tools/i18n_cfg.py @@ -92,6 +92,6 @@ msg_format_checkers = [ ] -file_black_list = ["./quantum/tests/unit", - "./quantum/openstack", +file_black_list = ["./neutron/tests/unit", + "./neutron/openstack", "./quantum/plugins/bigswitch/tests"] diff --git a/tools/install_venv.py b/tools/install_venv.py index eda0ced903..a51c29512e 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -21,7 +21,7 @@ # under the License. """ -Installation script for Quantum's development virtualenv +Installation script for Neutron's development virtualenv """ import os @@ -33,12 +33,12 @@ import install_venv_common as install_venv def print_help(): help = """ - Quantum development environment setup is complete. + Neutron development environment setup is complete. - Quantum development uses virtualenv to track and manage Python dependencies + Neutron development uses virtualenv to track and manage Python dependencies while in development and testing. - To activate the Quantum virtualenv for the extent of your current shell + To activate the Neutron virtualenv for the extent of your current shell session you can run: $ source .venv/bin/activate @@ -59,7 +59,7 @@ def main(argv): pip_requires = os.path.join(root, 'requirements.txt') test_requires = os.path.join(root, 'test-requirements.txt') py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) - project = 'Quantum' + project = 'Neutron' install = install_venv.InstallVenv(root, venv, pip_requires, test_requires, py_version, project) options = install.parse_args(argv) diff --git a/tools/patch_tox_venv.py b/tools/patch_tox_venv.py index 16e4accdd5..a3cb46aaf1 100644 --- a/tools/patch_tox_venv.py +++ b/tools/patch_tox_venv.py @@ -40,7 +40,7 @@ def main(argv): os.path.join(root, 'tools', 'test-requires'), ]) py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) - project = 'quantum' + project = 'neutron' install = install_venv.InstallVenv(root, venv, pip_requires, test_requires, py_version, project) #NOTE(dprince): For Tox we only run post_process (which patches files, etc) diff --git a/tox.ini b/tox.ini index d111aeeb89..c87903eb88 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ commands = flake8 [testenv:i18n] -commands = python ./tools/check_i18n.py ./quantum ./tools/i18n_cfg.py +commands = python ./tools/check_i18n.py ./neutron ./tools/i18n_cfg.py [testenv:cover] commands =