neutron/neutron
Kevin Benton 6dcfe3a936 Mock oslo policy HTTPCheck instead of urllib
We were mocking internal behavior of oslo policy by
patching urllib. This will break with the upcoming oslo
release that switches to requests.

This patch changes the mock to the HTTPCheck level and we
can leave implementation details testing up to oslo_policy.

Change-Id: I07957f01307e25f1547197c720eea6e3e7f0ef5a
Closes-Bug: #1503890
(cherry picked from commit a0f1d9d6de)

Add testresources used by oslo.db fixture

If we use oslo.db fixtures, we'll need the package or
the next version of oslo.db release will break us.

Closes-Bug: #1503501
Change-Id: I7dfbf240333095d91a414ba15a439bdc4804eb25
(cherry picked from commit 86ad967e40)

Fix functional test_server tests

Now oslo.service 0.10.0 no longer sends SIGHUP to parent and
children services.

This was a chance introduced by 286a6ea, and since it invalidated
the very logic under test, this must be revised.

(cherry picked from commit 090fe71359)

Change-Id: I18a11283925369bc918002477774f196010a1bc3
Closes-bug: #1505438
(cherry picked from commit 090fe71359)

Make test_server work with older versions of oslo.service

Change I18a11283925369bc918002477774f196010a1bc3 fixed the test for
oslo.service >= 0.10.0, but it also broke it for older versions of
oslo.service. Since the library has minimal version of >= 0.7.0 in
requirements.txt, test should pass for those versions too.

Now, instead of validating that either reset() or restart() of workers
are triggered on SIGHUP, just validate that .start() is triggered the
expected number of times (either way, no matter how oslo.service decide
to clean up the children, they exit and then are respawned).

Change-Id: I41f9d3af780b3178b075bc1e7084f417a2bd1378
Closes-Bug: #1505645
(cherry picked from commit 7bb4092166)

Fixed multiple py34 gate issues

1. Scope mock of 'open' to module

By mocking 'open' at the module level, we can avoid affecting
'open' calls from other modules.

2. Stop using LOG.exception in contexts with no sys.exc_info set

Python 3.4 logger fills in record.exc_info with sys.exc_info() result
[1], and then it uses it to determine the current exception [2] to
append to the log message. Since there is no exception, exc_info[1] is
None, and we get AttributeError inside traceback module.

It's actually a bug in Python interpreter that it attempt to access the
attribute when there is no exception. It turns out that it's fixed in
latest master of cPython [3] (the intent of the patch does not seem
relevant, but it removes the offending code while reshuffling the code).
Note that now cPython correctly checks the exception value before
accessing its attributes [4].

The patch in cPython that resulted in the failure is [5] and is present
since initial Python 3k releases.

The patch in fixtures that broke us is [6].

[1]: https://hg.python.org/cpython/file/tip/Lib/logging/__init__.py#l1412
[2]: https://hg.python.org/cpython/file/tip/Lib/logging/__init__.py#l575
[3]: https://hg.python.org/cpython/rev/73afda5a4e4c
[4]: https://hg.python.org/cpython/rev/73afda5a4e4c#l6.484
[5]: https://hg.python.org/cpython/rev/2ee09afee126
[6]: 67dd295694

Closes-Bug: #1503847
Closes-Bug: #1504053
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Change-Id: I456b7846b8a53e4d3f8c91583685e0e1eaa84719
(cherry picked from commit 8f58bbf38f)
2015-10-13 17:26:23 +02:00
..
agent DHCP: protect against case when device name is None 2015-10-07 11:20:10 +00:00
api Use pecan controllers for routing 2015-09-18 06:00:14 -07:00
callbacks Merge "Add support for PluginWorker and Process creation notification" 2015-09-04 05:02:52 +00:00
cmd usage_audit: Fix usage_audit to work with ML2 2015-10-02 15:59:19 +00:00
common /common/utils.py py34 incompatibility 2015-10-02 09:26:08 -07:00
core_extensions Forbid attaching rules if policy isn't accessible 2015-08-12 09:52:33 +00:00
db Tag the alembic migration revisions for Liberty 2015-10-02 16:27:39 +00:00
debug Deprecate external_network_bridge option in L3 agent 2015-09-01 20:41:54 -07:00
extensions Re-adds VIF_TYPE_VHOST_USER to portbindings extension 2015-09-17 13:54:53 +01:00
hacking Restructure agent code in preparation for decomp 2015-06-26 15:06:49 +00:00
ipam Merge "Fixed the typo in the doc string of the class SubnetPoolReader" 2015-09-01 07:08:07 +00:00
locale Imported Translations from Zanata 2015-10-02 06:33:59 +00:00
notifiers Remove hack for discovery novaclients extension 2015-09-09 14:35:26 +00:00
objects No network devices on network attached qos policies 2015-09-16 15:11:04 +02:00
openstack Switch to the oslo_utils.fileutils 2015-07-15 08:09:26 +03:00
pecan_wsgi Pecan: Fix quota enforcement 2015-10-02 15:58:05 +00:00
plugins Do not log an error when deleting a linuxbridge does not exist 2015-10-04 19:51:15 +00:00
quota Merge "docstring fix" 2015-09-14 18:36:55 +00:00
scheduler Always return iterables in L3 get_candidates 2015-09-15 16:25:45 -07:00
server Merge "Introduce a separate RPC server" into feature/pecan 2015-09-18 16:58:54 +00:00
services Mock oslo policy HTTPCheck instead of urllib 2015-10-13 17:26:23 +02:00
tests Mock oslo policy HTTPCheck instead of urllib 2015-10-13 17:26:23 +02:00
__init__.py Allow users to run 'tox -epy34' 2015-05-11 16:09:51 +02:00
auth.py Migrate to oslo.log 2015-03-12 11:22:56 +01:00
context.py Add DB support for resource usage tracking 2015-07-26 15:26:10 -07:00
i18n.py
manager.py Mock oslo policy HTTPCheck instead of urllib 2015-10-13 17:26:23 +02:00
neutron_plugin_base_v2.py Add support for PluginWorker and Process creation notification 2015-09-03 06:40:50 +00:00
policy.py Mock oslo policy HTTPCheck instead of urllib 2015-10-13 17:26:23 +02:00
service.py Add support for PluginWorker and Process creation notification 2015-09-03 06:40:50 +00:00
version.py
worker.py Add support for PluginWorker and Process creation notification 2015-09-03 06:40:50 +00:00
wsgi.py Add support for PluginWorker and Process creation notification 2015-09-03 06:40:50 +00:00