* This is a massive patch that aims to clean up the codebase
and bring it into compliance with HACKING.rst and PEP8 in one
fell swoop.
* Cleaned up use of gettext.
* Updated log usage for consistency.
* The tests run successfully against all plugins except
cisco and nicira (due to dependency issues with these plugins).
* Addresses bug 981208
* quantum previously depended on python-quantumclient for the
functionality in quantum/common. This change migrates
the required modules to the quantum repo and removes that
dependency.
* Addresses bug 977711
Sumit Naiksatam [Thu, 15 Mar 2012 23:43:19 +0000 (16:43 -0700)]
Bug #956559
VIF driver and scheduler for UCS plugin are broken since the flag
configuration mechanism in nova is changed. Fixing that and also
fixing some property names, along changes to how the quantum client
code is invoked.
> commit d1888a3359345acffd8d0845c137eefd88072112
> Author: Mark McLoughlin <markmc@redhat.com>
> Date: Fri Feb 3 00:50:58 2012 +0000
>
> Remove the last of the gflags shim layer
>
> Make FLAGS a ConfigOpts instance and fix up all the places where we
> expected FlagValues behaviour.
>
> Change-Id: I8f96f42e0d8d30ba6b362d29861e717cf0fa9e89
Bob Kukura [Tue, 13 Mar 2012 21:23:06 +0000 (17:23 -0400)]
Add root_helper to quantum agents.
When running commands that require root privileges, the linuxbridge,
openvswitch, and ryu agent now prepend the commands with the value of
the root_helper config variable. This is set to "sudo" in the plugins'
.ini files, allowing the agent to run as a non-root user with
appropriate sudo privilidges.
If root_helper is changed to "sudo quantum-rootwrap",
then the command being run will be filtered against lists of each
agent's valid commands in quantum/rootwrap. See
http://wiki.openstack.org/Packager/Rootwrap for details.
Fixes bug 948467.
Change-Id: I549515068a4ce8ae480905ec5eaab6257445d0c3 Signed-off-by: Bob Kukura <rkukura@redhat.com>
Dan Wendlandt [Tue, 28 Feb 2012 20:34:49 +0000 (12:34 -0800)]
Fix some plugins that don't check that nets + ports are owned by tenant
bug 942713. This bug confuses the validate_networks() method of
QuantumManager in Nova, causing it to believe that it is valid for a
tenant to plug into a particular network when in fact that network is not
owned by the tenant, nor the "provider".
The patch also adds unit tests to confirm correct plugin behavior.
This patch fixes the issue for the Sample Plugin, the OVS plugin,
the Linux Bridge plugin, and the Ryu plugin, all of which has the
same DB model. Validated the fix with the unit tests.
I couldn't run the unit tests for the NVP plugin standalone, but by
inspection, the code seems to handle this case. I wasn't able to run
the Cisco plugin unit tests, and that code uses its own DB model, so I
am uncertain whether this issue exists in that plugin.
Isaku Yamahata [Sat, 19 Nov 2011 09:17:03 +0000 (18:17 +0900)]
plugin: introduce ryu plugin
blueprint ovs-driver-extention
This patch implements the blueprint ovs-driver-extention
https://blueprints.launchpad.net/quantum/+spec/ovs-driver-extension
This patch factors out ovs common logic from ovs plugin into ovscommon
and adds Ryu NOS plugin.
This patch enhances ovs plugin for generic OVS controller support and
This patch is to add ofp controller support to OVS.
Store ofp controller address in ovs quantum data base.
- nova firewall_driver
- nova linuxnet_interface_driver
There may be ports unmanaged by nova/quantum. Those ports are used
to connect vm to outside of physical machine. They needs special care.
Changes 11 -> 12:
- ryu agent
eliminated from quantum.common import exceptions as exc
- ryu.db.api
eliminated ofp_has_servers
- ryu.nova
eliminated from quantum.plugins.ryu.nova import ovs_utils
and eliminate ovs_utils
Chnages 10 -> 11:
- rebased to a945d1a30478c644d307c77a8a85f3a08e5a834e
- more Maru's review
- setup.py: fix setup() argument
This isn't directly related to ryu plugin though
- improve fake ini file when unit test
remove fake ini file after unit tests.
use StringIO when no file is required.
- LOG: don't use %
Chnages 8 -> 9 -> 10:
- minor fixes: forgot to commit some hunks
Chnages 7 -> 8:
- rebased to d6bf2b76162ba806b2ad1f636f6273e47e03a117
- catch up d6bf2b76162ba806b2ad1f636f6273e47e03a117 change
introduced bin/quantum_ryu_agent
- addressed Maru's review
- avoid custom patching, use mock for test
and added mox and mock to pip-requires
- more pep8
- avoid \ for line continuation
- avoid single char variables
- db.api: first() -> one()
- utilize implicit conversion
var is not None -> var
- and more...
Changes 6 -> 7:
- update comment in ryu/run_tests.py
- make unit tests pass without ryu installed
i.e.
PLUGIN_DIR=quantum/plugins/ryu/ ./run_tests.sh
works now
Changes 3 -> 4:
- reflected Dan's review
- on-OVS in ryu.ini
- update @author
- some naming
Changes 2 -> 3:
- rebased to 04d144ae0b2ad5618847d1784cea48a08d53a46a
- abandoned to share code and duplicated codes from openvswitch plugin
for ovs plugin stability.
- dropped setup_ryu.sh and added README
- update nova driver to catch up upstream change (gflags -> cfg)
Changes 1 -> 2:
- unbreak openvswtich unit test
- MANIFEST.in
Changes 3 -> new 1:
- rebased to 1eb3c693b5f6f3f301047100c36c7915434f8be7
- factor out common loginc from openvswitch plugin into ovscommon
- Introduced a new independent ryu plugin
- try new review due to the previous effort was marked abandoned.
> https://review.openstack.org/#change,3055
> Change-Id: I17801a7a74d4087838a8a26c1b1f97f28c2dcef3
Dave Lapsley [Tue, 21 Feb 2012 07:41:14 +0000 (02:41 -0500)]
blueprint quantum-ovs-tunnel-agent
Enhance existing Quantum OVS Plugin with a tunneling agent that
enables Hypervisors to be connected via GRE tunnels. The new agent
can be enabled/disabled via configuration file and provides backwards
compatibility with existing non-tunneling OVS Agent.
This patch fixes bug 938637
Quantum unittests doesn't pass with plugin (openvswitch, linuxbridge) in venv
as follows.
This is because config file under <quantum src>/etc/ can't be find due to
FLAGS.state_path points to <python-quantumclient src> which can be different
from <quantum src>.
Set FLAGS.state_path to <quantum src> when quantum unit tests.
$ PLUGIN_DIR=quantum/plugins/openvswitch ./run_tests.sh -V
<snip>
ActionExtensionTest
test_extended_action_for_adding_extra_data (quantum.tests.unit.test_extensions.ActionExtensionTest)ERROR
<snip>
======================================================================
ERROR: test_extended_action_for_adding_extra_data (quantum.tests.unit.test_extensions.ActionExtensionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/quantum/tests/unit/test_extensions.py", line 212, in setUp
self.extension_app = setup_extensions_test_app()
File "/quantum-src/quantum/tests/unit/test_extensions.py", line 474, in setup_extensions_test_app
return TestApp(setup_extensions_middleware(extension_manager))
File "/quantum-src/quantum/tests/unit/test_extensions.py", line 469, in setup_extensions_middleware
conf, app = config.load_paste_app('extensions_test_app', options, None)
File "/quantum-src/.venv/src/python-quantumclient/quantum/common/config.py", line 316, in load_paste_app
conf_file, conf = load_paste_config(app_name, options, args)
File "/quantum-src/.venv/src/python-quantumclient/quantum/common/config.py", line 286, in load_paste_config
"Cannot load application %s" % app_name)
RuntimeError: Unable to locate any configuration file. Cannot load application extensions_test_app
-------------------- >> begin captured logging << --------------------
quantum.extensions.extensions: INFO: Initializing extension manager.
quantum.extensions.extensions: INFO: Loading extension file: foxinsocks.py
quantum.extensions.extensions: DEBUG: Ext name: Fox In Socks
quantum.extensions.extensions: DEBUG: Ext alias: FOXNSOX
quantum.extensions.extensions: DEBUG: Ext description: The Fox In Socks Extension
quantum.extensions.extensions: DEBUG: Ext namespace: http://www.fox.in.socks/api/ext/pie/v1.0
quantum.extensions.extensions: DEBUG: Ext updated: 2011-01-22T13:25:27-06:00
quantum.extensions.extensions: WARNING: Loaded extension: FOXNSOX
quantum.extensions.extensions: INFO: Loading extension file: __init__.py
quantum.extensions.extensions: INFO: Loading extension file: foxinsocks.pyc
quantum.extensions.extensions: INFO: Loading extension file: __init__.pyc
--------------------- >> end captured logging << ---------------------
Bob Kukura [Fri, 17 Feb 2012 22:00:52 +0000 (17:00 -0500)]
Cleanup the source distribution.
Missing text files such as LICENSE and various READMEs are now
included in the tarball source distribution. The Makefile and shell
script for installing the openvswitch agent on xen are also now
included. The openvswitch and linuxbridge agents are included, and
executable wrapper scripts for the agents are provided. The cisco and
linuxbridge nova drivers are now setup to be run from the quantum
namespace rather than copied to nova. Finally, the setup_*.py scripts
have been removed from the project. Fixes bug 925074.
Test by running "python setup.py sdist" and examining the generated
tarball.
Change-Id: I33d336a5eb13678e6d527b575958393b337b6f3d Signed-off-by: Bob Kukura <rkukura@redhat.com>
Removing the specialized db modules (which used InnoDB engine) and
instead using the Quantum DB now.
Incorporated changes to setup so that the Linux Bridge plugin can be
installed.
Other changes to README and tests.
Bob Kukura [Fri, 3 Feb 2012 21:20:28 +0000 (16:20 -0500)]
Remove quantum CLI console script.
The quantum CLI console script is now installed by the
python-quantumclient project, so remove it from the quantum project's
setup.py. Fixes bug 925596.
Test by running "python setup.py install --root <somedir>" and
checking that <somedir>/usr/bin/quantum is not created.
Change-Id: Icd7eff79c8d30511693942a859334829cbf0d9af Signed-off-by: Bob Kukura <rkukura@redhat.com>
Jenkins [Wed, 25 Jan 2012 02:57:30 +0000 (02:57 +0000)]
Merge "bp/api-error-codes Restructured API error codes for Quantum API v1.1 This changeset provides the following changes: - Only standard HTTP errors for Quantum API v1.1 - Customized fault response body formatting according to API version - Changes to unit tests to deal with version specific status codes"
bp/api-error-codes
Restructured API error codes for Quantum API v1.1
This changeset provides the following changes:
- Only standard HTTP errors for Quantum API v1.1
- Customized fault response body formatting according to API version
- Changes to unit tests to deal with version specific status codes
NOTE: Client side changes are not in this branch.
They should be implemented within bp/quantum-client-1.1.
NOTE-2: Fixing references to QuantumHTTPErrors in extensions framework
James E. Blair [Mon, 16 Jan 2012 21:02:10 +0000 (08:02 +1100)]
Base version.py on glance.
This makes setting and calculating the versioning of quantum more
like other OpenStack projects, simplifying the work of the CI
and Release Management teams.
Addresses bug 916018 which prevents the quantum-tarball job from
running correctly.
Luiz H Ozaki [Thu, 5 Jan 2012 20:09:38 +0000 (18:09 -0200)]
Add __init__.py from plugin to be copied on setup scripts
Using debian building scripts to package Quantum and I was getting this error:
('Inner Exception: %s', ImportError('No module named plugins.sample.SamplePlugin',))
Because none of the setup_*.py was copying the __init__.py from the plugins
lzyeval [Wed, 4 Jan 2012 09:10:35 +0000 (17:10 +0800)]
PEP8 quantum cleanup
Fixes bug #911663
The None, True, and False values are singletons.
All variable *comparisons* to singletons should use 'is' or 'is not'.
All variable *evaluations* to boolean should use 'if' or 'if not'.
All Object type comparisons should use isinstance()
instead of comparing types directly.
James E. Blair [Fri, 23 Dec 2011 23:02:57 +0000 (15:02 -0800)]
Rename .quantum-venv to .venv.
This simplifies a number of Jenkins jobs which currently, other
than directory names, could be the same for all OpenStack
projects. By renaming the virtualenv directory, the redundant
Jenkins virtualenv build and copy jobs can be eliminated.