-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Netronome Agilio SmartNIC Python code for Mitaka compatibility
1. Replace the urllib3 library with Requests. There appears to be a tug-of-war going on between the Requests library authors and Linux distribution vendors regarding urllib3. Requests has its own vendor-branched copy of urllib3, but Debian et al. disagree with this doing this (possibly for security reasons) so they "unbundle" it: i.e., they replace the local Requests copy of urllib3 with a stub that loads the global version of urllib3. The Requests authors, in turn, disagree with the Debian "unbundling," so they implement countermeasures to it. (See [ `requests/packages/__init__.py`]( https://github.com/kennethreitz/requests/blob/v2.9.1/requests/packages/__init__.py), which on Ubuntu 14.04 is installed to `/usr/lib/python2.7/dist-packages/requests/packages/__init__.py`.) **Problem** On Ubuntu 14.04 Contrail 3.1 OpenStack Mitaka compute nodes, somehow between all the competing ideas about where urllib3 should live we end up with a situation where the global urllib3 is unusable. In particular, the name `urllib3` turns into a reference to `requests.packages.urllib3` in `except` exception lists, but otherwise refers to the global `urllib3`. In other words, with an `import urllib3` at the top level, errors being raised by HTTP requests have the type: (Pdb) type(e) <class 'urllib3.exceptions.MaxRetryError'> but `except` blocks are unable to catch these because the type name that they need to use has been hijacked and turned into an alias for a type in Requests: (Pdb) urllib3.exceptions.MaxRetryError <class 'requests.packages.urllib3.exceptions.MaxRetryError'> **Solution** Since the Netronome Python code is not using the "retries" feature of urllib3, simply replace urllib3 with Requests. This causes an additional complication due to the test code checking log messages, since we need to maintain Kilo compatibility. Workaround is to set the log level of urllib3-related loggers to WARNING while the affected unit tests are running. 2. Use `NovaObjectSerializer` when passing Nova objects to Netronome Python code. The original Netronome code inadvertently had a Kilo dependency when receiving flavor and image metadata, because it used an unofficial method of serializing Nova objects. Rewrite to use a supported serialization method which is compatible with both Kilo and Mitaka. Add unit tests. 3. Support multiqueue TAP interface creation. Change-Id: Ic21aad32cca37775fbbc1726df63163990604c0a Closes-Bug: #1651266 Related-Bug: #1644348
- Loading branch information
Bill Brinzer
committed
Dec 19, 2016
1 parent
9eb6175
commit 21faa7f
Showing
6 changed files
with
963 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.