summaryrefslogtreecommitdiff
path: root/nova/api/openstack/wsgi.py
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Debug Nova APIs call failures"Sylvain Bauza2023-05-111-6/+0
| | | | | | | | | | | | | This reverts commit afb0f774841d30dcae9c074d524e7fa9be840678. Reason for revert: We unfortunately leak the token in the logs which is considered a security flaw, even if only provided on DEBUG level. Change-Id: I52b52e65b689dadbdb08122c94652c491f850de6 Closes-Bug: #2012993 (cherry picked from commit 6833695e70bba31b84a0a19301657bc59ae1710b) (cherry picked from commit a02f96687350ad74d9921406a525ee991bbe8882)
* Debug Nova APIs call failuresFederico Ressi2022-02-041-0/+6
| | | | | | | This should help finding out cause of failures happening when performing API requests by reading the log file Change-Id: I02e531c2aaaccae99da9a21ee9268f6fdd0efb3e
* Convert features not supported error to HTTPBadRequestGhanshyam Mann2021-09-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | There is inconsistency on return code nova API return for "Feature not supported/implemented'. Current return code are 400, 409, and 403. - 400 case: Example: Multiattach Swap Volume Not Supported - 403 case: Cyborg integration - 409 case: Example: Operation Not Supported For SEV , Operation Not Supported For VTPM In xena PTG, we agreed to fix this by returning 400 in all cases - L446: https://etherpad.opendev.org/p/nova-xena-ptg This commit convert all the features not supported error to HTTPBadRequest(400). To avoid converting every NotSupported inherited exception in API controller to HTTPBadRequest generic conversion is added in expected_errors() decorator. Closes-Bug: #1938093 Change-Id: I410924668a73785f1bfe5c79827915d72e1d9e03
* Change API unexpected exception messageBelmiro Moreira2021-02-171-3/+5
| | | | | | | | | | | | The "API unexpected exception" message can now be configured by the cloud provider. By default it continues to display the "launchpad" webpage to report the nova bug, but it can be configured by the cloud provider to point to a custom support page. Change-Id: Ib262b91b57f832cbcc233f24f15572e1ea6803bd Closes-Bug: #1810342
* Remove six.text_type (1/2)Takashi Natsume2020-12-131-7/+6
| | | | | | | | | Replace six.text_type with str. A subsequent patch will replace other six.text_type. Change-Id: I23bb9e539d08f5c6202909054c2dd49b6c7a7a0e Implements: blueprint six-removal Signed-off-by: Takashi Natsume <takanattie@gmail.com>
* Remove six.add_metaclassTakashi Natsume2020-08-151-2/+1
| | | | | | | | Replace six.add_metaclass with Python 3 style code. Change-Id: Ifc3f2bcb8fcdd2b555864bd4e22a973a7858c272 Implements: blueprint six-removal Signed-off-by: Takashi Natsume <takanattie@gmail.com>
* Remove six.PY2 and six.PY3Takashi Natsume2020-08-151-24/+11
| | | | | | | | | Remove six.PY2 and six.PY3. Subsequent patches will replace other six usages. Change-Id: Iccce0ab50eee515e533ab36c8e7adc10cb3f7019 Implements: blueprint six-removal Signed-off-by: Takashi Natsume <takanattie@gmail.com>
* Ensure controllers all call superStephen Finucane2019-06-151-4/+2
| | | | | | | | | Currently some do and some don't. Do it by default as intended. We also remove the 'view_builder' argument from the base 'Controller.__init__' function since nothing was actually setting this. Change-Id: Ic0b16608078e4545f546509df94caba3166ed6e2 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Clean up header encoding handling in compute API"Zuul2018-12-241-8/+11
|\
| * Clean up header encoding handling in compute APIChris Dent2018-12-041-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PEP 3333[1] says request and response headers (within the application) should be treated as native `str` (whatever the Python version). It's the job of the WSGI server to translate from `str` to reasonable output on the outgoing socket connection. This was already mostly correct but two issues were discovered while trying to create integration tests that use the value of the location response header when POSTing to create a server. In python2 it was working. In Python3 the header had a value of location: http://192.168.1.76/compute/v2.1/b'http:/192.168.1.76/compute/v2.1/servers/fad04042-850b-443a-9e48-773111cbc981' (note the b'...' bounding the full url on the end). This was happening for two reasons: * nova/api/openstack/compute/servers.py independently encodes the location header to utf-8, instead of using the centralized handling in nova/api/openstack/wsgi.py This meant that the value of the location header would arrive, in Python 3, at the centralized handling as a bytestring. * The centralized handling in nova/api/openstack/wsgi.py was incorrectly using the six.text_type() method. That is simply an alias to unicode in python 2 and str in python3. In python3 when given a bytestring as the only argument object.__str()__ is called on the argument. Which yields b'whatever'. At that stage, the handling in the web server which processes a location header to check for the presence of a host and prefix already at the start of the provided location will find b'...' and do a concatenation without any replace. So, because of all that, this patch includes three changes: * The server creation location header code does no encoding and relies on the centralized handling. * The centralized handling removes the use of text_type() as a function because that is redundant with the safe_encode and safe_decode changes in the same loop. * Doc strings and comments in the ResponseObject are clarified with regard to this encoding topic. Also, comments in Resource._process_stack are updated to correspond with the changes above. The code is not changed, as they are already doing the right thing: The comment was misrepresenting what was going on. There is some duplication of code between these two areas, but the code is too inscrutable for me to be willing to change a part that isn't presenting an explicit bug. Tests for the internal production of the location header are adjusted to reflect these changes. [1] https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types Change-Id: I163c417375678b428ac77aac87ccafaf1f6186ab Closes-Bug: #1795425
* | Fix best_match() deprecation warningTakashi NATSUME2018-12-171-3/+16
|/ | | | | | | | | | | | | | | | | | | | wsgi call to best_match() generates the following warning: DeprecationWarning: The behavior of .best_match for the Accept classes is currently being maintained for backward compatibility, but the method will be deprecated in the future, as its behavior is not specified in (and currently does not conform to) RFC 7231. See the following URL for more information about deprecation. https://docs.pylonsproject.org/projects/webob/en/stable/api/webob.html#webob.acceptparse.AcceptValidHeader.best_match Simlar changes in the wsgi best language code as well, except new call is to lookup(). Change-Id: Ib93ffffd3f28aa6d53a0a4eed5aeee94900cb073 Closes-Bug: #1798224
* Remove the extensions framework from wsgi.pyghanshyam2018-10-181-98/+12
| | | | | | | | | | | | All the API extensions has been merged into their main controller. which means we can remove the API extensions framework from wsgi.py. This commit finish the last step of API extensions merge work. Implements: blueprint api-extensions-merge-stein Change-Id: I365e2ae72b72f75b1eb28b63ad3e87dc2d6dc92f
* Remove the caching the resource on Request objectghanshyam2018-10-181-64/+0
| | | | | | | | | | | | | All extensions are now merged into their main controller view builder. Request object used to have the cache mechanism to store the db resources for extensions to extend those. Now those caching is not needed and this commit removes the caching and get methods from Request object and their usage. Partially implements: blueprint api-extensions-merge-stein Change-Id: I444c2be539031a9ace0b3602c5c6f9f4132b6f23
* Refactor WSGI apps and utils to limit importsChris Dent2018-03-061-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file nova/api/openstack/__init__.py had imported a lot of modules, notably nova.utils. This means that any code which runs within that package, notably the placement service, imports all those modules, even if it is not going to use them. This results in scripts/binaries that are heavier than they need to be and in some cases including modules, like eventlet, that it would feel safe to not have in the stack. Unfortunately we cannot sinply rename nova/api/openstack/__init__.py to another name because it contains FaultWrapper and FaultWrapper is referred to, by package path, from the paste.ini file and that file is out there in config land, and something we prefer not to change. Therefore alternate methods of cleaning up were explored and this has led to some useful changes: Fault wrapper is the only consumer of walk_class_hierarchy so there is no reason for it it to be in nova.utils. nova.wsgi contains a mismash of WSGI middleware and applications, which need only a small number of imports, and Server classes which are more complex and not required by the WSGI wares. Therefore nova.wsgi was split into nova.wsgi and nova.api.wsgi. The name choices may not be ideal, but they were chosen to limit the cascades of changes that are needed across code and tests. Where utils.utf8 was used it has been replaced with the similar (but not exactly equivalient) method from oslo_utils.encodeutils. Change-Id: I297f30aa6eb01fe3b53fd8c9b7853949be31156d Partial-Bug: #1743120
* Remove the inherits parameter for the Resource objectHe Jie Xu2017-12-211-12/+1
| | | | | | | | | | | In the past, the '/os-volumes_boot' API is inherited from the '/servers' API, then the Resource object have the ability to get method from the inherits controller. But now, we use the plain routes, all the methods of '/os-volumes_boot' are listed in the route list now. Partial implement bp api-extensions-merge-queens Change-Id: Iff44b7756fd9a0f4aa78fa4306e66344011d0c2f
* Merge ResourceV21 obj into Resource objHe Jie Xu2017-12-211-5/+1
| | | | | | | | | | | | In the past, we have two code bases for the v2.1 API and legacy v2 API. Then we need two Resource objects, the ResourceV21 object supports microversion, the Resource object doesn't. But now the old legacy v2 API code base is removed, then we only need one Resource object which support the microversion. Partial implement bp api-extensions-merge-queens Change-Id: I0cc0d5ad850e01f0c0d96d698ffdce7ae515faf8
* Remove extensions moduleHe Jie Xu2017-12-201-0/+50
| | | | | | | | | | | | The most of objects are removed from the extensions module. The last thing is the expected_errors decorator, but that decorator is nothing about the extensions. So move the decorator to the wsgi module where is the place put the other decorator also. Then we can remove the extensions module entirely. Partial implement bp api-extensions-merge-queens Change-Id: I4802c5b38001a756448d4feb9ca336908821f591
* Stop caching compute nodes in the requestMatt Riedemann2017-06-141-12/+0
| | | | | | | | | | | | | Caching compute nodes in the request was added in change I73a96db7beb4cc0f017008f81e9f671382ad9105. That was so the PciHypervisorController could use them, which was an extension on the hypervisors API. The os-pci API (and the PciHypervisorController) was removed in change I9099744264eeec175672d10d04da69648dec1a9d so nothing needs the compute nodes from the request cache anymore. Change-Id: I06aacb9d4a8cff8180010c69d3aa32c0492fe2bc
* API: accept None as content-length in HTTP requestsMarkus Zoeller2017-04-041-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API defines PUT and POST as HTTP methods which need a request body. It is allowed, that this request body might be of zero length. What was missing is, that the "content-length" of the request also might be None. The tempest test cases of servers.test_server_tags.ServerTagsTestJSON revealed that a PUT with a non-existing body raises a BadRequest exception because of the missing "content-length". [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-OpenStack-Nova-API-Version': '2.26', 'X-Auth-Token': '<omitted>'} Body: None Response - Headers: {'status': '400', u'content-length': '66', u'server': 'Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5', u'date': 'Mon, 03 Apr 2017 10:15:12 GMT', u'x-openstack-nova-api-version': '2.26', u'x-compute-request-id': 'req-1f8726fc-df20-4592-a214-cff3fa73c8e6', u'content-type': 'application/json; charset=UTF-8', content-location': 'https://ctrl:8774/v2.1/servers/<uuid>/tags/mytag', u'vary': 'OpenStack-API-Version,X-OpenStack-Nova-API-Version', u'openstack-api-version': 'compute 2.26', u'connection': 'close'} Body: {"badRequest": {"message": "Malformed request body", "code": 400} } For some reason this, this seems to only occur on centos7 test nodes, but not on ubuntu xenial nodes. The root cause is still unclear to me. I suspect the underlying "webob.Request" object which is used in Nova's API, but I don't have proof for that. This change checks for "content-length is None". The logic to determine the request content was part of a very long method which is hard to test. That's why I extracted the code paths to a new method. That made the unit test much easier. Change I3236648f79f44d2758bb7ab0d64d58b0143f6bdb alters the tempest test cases which revealed the missing handling of "content-length is None". Change-Id: Id0b0ab5050a4ec15ab2a0d0dd67fcefe4b1ecb39 Closes-Bug: #1679223
* remove i18n log markers from nova.api.*Sean Dague2017-03-241-5/+3
| | | | | | This completes the removal of i18n markers from nova.api.* Change-Id: I8e765d2dcda3edbef4981b0f4c960da3e6d15776
* Merge "Remove unused code in nova/api/openstack/wsgi.py"Jenkins2016-11-221-9/+0
|\
| * Remove unused code in nova/api/openstack/wsgi.pyTakashi NATSUME2016-11-171-9/+0
| | | | | | | | | | | | | | | | The 'get_media_map' method hasn't been used since I8d37751624ca1d381e1098a3a6349922a4c5ef6a. TrivialFix Change-Id: I3d3e08fa2f305cecfe7e2f01791d39bc0f3ef868
* | Use byte string or utf8 depending on python version for wsgiJuan Antonio Osorio Robles2016-11-211-3/+7
| | | | | | | | | | | | | | | | | | | | A recent change to the wsgi code broke deployments running over httpd/mod_wsgi. This is because for py2.X mod_wsgi accepts byte strings and breaks with utf8. However, for py3.X, utf8 is accepted. So this acts accordingly. Change-Id: I81739bc3de9d623b718987b5fc18eaf851533902 Closes-Bug: #1643511
* | [PY3] byte/string conversions and enable PY3 testdineshbhor2016-11-171-1/+3
|/ | | | | | | | | | | | | * The dict.items()[0] will raise a TypeError in PY3, as dict.items() doesn't return a list any more in PY3 but a view of list. * Webob response body should be bytes not strings so used oslo_utils.encodeutils.safe_decode to decode it. Partially implements blueprint: goal-python35 Co-Authored-By: ChangBo Guo(gcb) <eric.guo@easystack.cn> Change-Id: I38d416923bc0cec0ca98c4494dd1e06cd49671cf
* Remove RateLimitFault classjichenjc2016-09-101-45/+0
| | | | | | | | the last usage of this class is RateLimitingMiddleware and that was removed in a31d917af0cc5ecb55424598e7b812e02afbf28c Change-Id: Icefdd7d35b4f6b510d0ead907f486e6ea7abc3ea
* remove support for legacy v2 generator extensionsSean Dague2016-06-211-95/+25
| | | | | | | | | | | | | This removes the support for legacy v2 extensions which were allowed to be generators to have a pre / post processing phase. The modern compute api stack never supported this construct. Because of the remove of the 'pre' phase, the 'post_process' phase is just renamed to 'process'. All pre_process and generator tests are removed. Change-Id: Ia34c1f814fb938915d74c6845dfa5135cba29d0a
* Support for both microversion headersChris Dent2016-05-251-6/+13
| | | | | | | | | | | | | | | | | In this change the new OpenStack-API-Version headers is allowed, but not required, for requesting a microversion. Both headers are accepted in the request and both headers are sent in the response (both the header and its value, and the addition to the Vary header). Many tests which explicitly use a microversion header have been updated to use both. This change is not 100% as most of the tests are testing the handling of the value of the header, not which header is involved. Partially-Implements: blueprint modern-microversions Change-Id: I68da13b5ba0c2f3357523e765a5b9db81899daf1
* Merge "Initial use of microversion_parse"Jenkins2016-04-211-20/+22
|\
| * Initial use of microversion_parseChris Dent2016-04-151-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | microversion_parse is a new simple library that does one job: it extracts microversions from headers. By default it will look for the new style 'OpenStack-API-Version: compute 2.15' but can be called to look in a variety of old style headers. In this change 'X-OpenStack-Nova-API-Version: 2.15' continues to work and no further changes are done. Followup patches will add tests for the new style header and versioning of the microversion (if required). Depends-On: Iea8bf5cc70ad24bb352347ef347be71817db3dc5 Change-Id: I9098ab8f0800fb0550887f5eff219b18addde709
* | Changed an HTTP exception to return proper codeBrandon Irizarry2016-04-151-1/+1
|/ | | | | | | | | | | | POSTing to /servers with a content-type of text/plain and a text/plain body results in a response code of 400. It should be 415. I found this line in the code that appears to handle this singular case and modified the HTTP exception used to the correct one. Tests were also updated accordingly. Change-Id: I5fa1fdba56803b2ef63b1efaaeeced6ceb7779d9 Closes-Bug: 1567977
* Check API versions intersectsGleb Stepanov2016-04-111-2/+40
| | | | | | | | Add new method to Controller class that checks whether methods decorated with api_versions versions intersects. Change-Id: I00005f8ae5f2fa55f23f8618f154cbe8dd06188a
* Fix some word spellings in messagesvenkatamahesh2016-02-031-1/+1
| | | | Change-Id: I40e3c0f3b99ae853f84609c5334e6d230dfff867
* cleanup: add comments about the pre/post extension processingSean Dague2016-01-211-1/+25
| | | | | | | | | In doing the cleanup of the rest of the wsgi stack I finally figured out what really was going on here. This can't come out today because of the legacyv2 code stack, however it can be largely removed when that drops. Change-Id: Ie7489b9eb1eb42ba3c4ea2d7ea973eb8d875f0ea
* cleanup: remove custom serializer supportSean Dague2016-01-211-99/+14
| | | | | | | | | | | The custom serializer support in the wsgi stack was to support XML responses. It is a ton of complexity for no gain. Removing this greatly simplifies the response path for the wsgi code. Tests which only tested functionality that was removed, are also removed. Change-Id: I8d37751624ca1d381e1098a3a6349922a4c5ef6a
* cleanup: remove configurable action_peekSean Dague2016-01-211-10/+9
| | | | | | | | action_peek is a concept to pull the action name out of an inbound request. We only accept json requests now, so this can be reduced to just the function for json getting called at the right place. Change-Id: I4d70e1b080eac38c01184001a9a1402e0e12cc0d
* cleanup: remove infrastructure for content/type deserializerSean Dague2016-01-201-39/+16
| | | | | | | | | | | | | | | | | | | | The modular deserializer (and many other things) worked by slotting in pluggable components based on content_type. We only support one content type, it's json. So this is all overkill and debt now. This first moves content type validation earlier, so that passing an invalid content type is going to explode early. No content type, or default text, still gets through, but we treat everything like application/json (no real change here). We can then delete all the selection of deserializer and action_peek to be single instances. They are json. They will always be json. We don't accept anything else. A few unit tests which injected in funny places in the stack were removed/updated to work with the new flow. Change-Id: I2b5b08f164e0d45c55d5e2685b3e2a8641843fba
* cleanup: collapse wsgi serializer test hierarchySean Dague2016-01-201-20/+6
| | | | | | | | | | | | There previously was a serializer / deserializer hierarchy because the XML serializers shared some content with JSON ones, but not all. Now that XML is out of the tree, this is an extra level of class hierarchy for no reason. Collapse the hierarchy, remove the 2 tests that were testing the base classes (which were not used anywhere in functional code). Change-Id: Iba739a4081f6dd8d6919a27e0ad61a38c33f1525
* cleanup: remove wsgi serialize/deserialize decoratorsSean Dague2016-01-201-32/+0
| | | | | | | | These are vestigial from the days when we supported alternative content types on resources, like xml. They are not used in any of the code. We should remove them as they are now dead code. Change-Id: Ie4be4a140ad9618dea6c9e5bfa8176c1892e8231
* Add helper shim for getting itemsRyan Rossiter2016-01-141-1/+12
| | | | | | | | | | | | | | Within the wsgi module, the wsgi request object has a cache_db_items() function that does a dictionary __getitem__ on the item passed in. Because the objects are being changed over to remove dictionary syntax, __getitem__ on these objects now fails. But the item being passed in is not always a versioned object, so we can't just totally drop the __getitem__ to use getattr(). To keep compatibility between them, a function is added to check if the item has __getitem__. If it does, we'll use it as a dictionary, otherwise, we'll use getattr(). Change-Id: I84b76d2fd344e0f53ffaada3ed74d3b97de4f962 Partially-Implements: bp rm-object-dict-compat
* [Py34] Enable api.openstack.test_wsgi unit testAndrey Kurilin2015-12-101-13/+20
| | | | | | | | | | | | | | | | | | | | | | | Issues: - Method `webob.multidict.MultiDict.items` returns list object in py2 env[1] and listiterator in py3 env[2]. ListIterator prevents changing values of headers in a loop(changes of item's order prevent skipping some headers). - Statement `nova.utils.utf8(str(some_value))` did not work for bytes type in py3 env. Good example is `test_resource_headers_are_utf8` test. Int value 1 became to b'b"b\'1\'"' after deserialization. - Wrong checks for utf-8. (including check for encoding headers names, which is not encoded anywhere in the code) - Wrong checks for `body` property of `webob.response.Response` cls. Method `_body__get` returns bytes[3]. There is no problem in python 2, since type(b"some") equals to type("some"), but it wrong for python 3. [1] - https://github.com/Pylons/webob/blob/1.5.0b0/webob/multidict.py#L266-L267 [2] - https://github.com/Pylons/webob/blob/1.5.0b0/webob/multidict.py#L260-L264 [3] - https://github.com/Pylons/webob/blob/1.5.0b0/webob/response.py#L350 Related bp nova-python3-mitaka Change-Id: I15150c8c8f204081b9b5d8bc28e622692d7d749a
* Fixes dict keys and items references for Python 3Claudiu Belu2015-12-071-1/+1
| | | | | | | | | | Python 3 does not support indexing keys or items iterators. Removes unit tests from tests-py3.txt blacklist. Partially implements blueprint: nova-python3-mitaka Change-Id: I3ec1e775d91e7f56356f744fd80f5d9df36cae1d
* Skip additionalProperties checks when LegacyV2CompatibleWrapper enabledHe Jie Xu2015-08-061-0/+9
| | | | | | | | | | | | LegacyV2CompatibleWrapper adds environ variable 'openstack.legacy_v2' to indicate request coming from v2 request. Based on 'openstack.legacy_v2' will skip additionalProperties checks in JSON-Schema validation. Partial implements blueprint api-relax-validation Change-Id: Ic95dd0d1b77994ce6e47498c8ae0d7ae079706be
* Handle SSL termination proxies for version listRadomir Dopieralski2015-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Return correct scheme in version URLs if service behind an SSL termination proxy. This is done by adding a new configuration option, secure_proxy_ssl_header, which, when defined, makes the wsgi application take the host_url scheme from that header. By default, when this option is not specified, there is no difference in behavior. The intention is to configure any ssl-decrypting proxy to set that header, so that nova-api knows which protocol to use in the URLs in response. This patch is largely based on https://review.openstack.org/#/c/132235/18 DocImpact Closes-Bug: #1384379 Change-Id: I27ba166902ecc19c9b7fff2ee7f3bf733885efe1
* Merge "Replace unicode with six.text_type"Jenkins2015-05-211-1/+1
|\
| * Replace unicode with six.text_typeVictor Stinner2015-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Unicode type is 'unicode' in Python 2 and 'str' on Python 3: replace unicode with six.text_type to make Nova compatible with Python 2 and Python 3. This patch was generated by the following tool (revision e760664379c3) with the operation "unicode": https://bitbucket.org/haypo/misc/src/tip/python/sixer.py Manual change: * Replace "isinstance(value, str) or isinstance(value, unicode)" with "isinstance(value, six.string_types)" in nova/api/ec2/ec2utils.py * Revert changes in strings in: - nova/compute/api.py - nova/hacking/checks.py - nova/tests/unit/api/openstack/test_wsgi.py - nova/utils.py * Revert changes in nova/tests/unit/test_hacking.py: tests must use "unicode()". The nova.hacking module will probably need other changes to support Python 3. * Reformat nova/tests/unit/objects/test_instance_action.py and nova/tests/unit/virt/hyperv/test_hypervapi.py to 80 columns Blueprint nova-python3 Change-Id: I7ced236b6f8f8b6a5d2e7fee3c4f0ba4d72c21fb
* | Replace iter.next() with next(iter)Victor Stinner2015-05-131-1/+1
|/ | | | | | | | | | | | | | | | | | | On Python 3, iterators have a __next__() method, but no next() method. Use the builtin next() function which works on Python 2 and Python 3. This patch was generated by the sixer tool version 0.2: https://pypi.python.org/pypi/sixer Manual change: * Fix indentation * tarfile.TarFile is not an iterator and has a next() method on Python 2 and Python 3: revert changes in nova/tests/unit/virt/xenapi/image/test_utils.py and changes on self._tarfile in nova/virt/xenapi/image/utils.py. Blueprint nova-python3 Change-Id: Ie691d6f236a5aeef049f0b191dd07167020443d7
* Fix bad interaction between @wsgi.extends and @wsgi.api_versionChris Yeoh2015-02-261-0/+7
| | | | | | | | | Fixes possible bad interaction when both wsgi.extends and wsgi.api_version decorators are used on the same method. Adds test cases to verify it works now Partially implements blueprint api-microversions Change-Id: Ib72d0257fc943d7afd25e1cef46fafff657620b5
* Merge "Change microversion header name"Jenkins2015-02-241-1/+1
|\
| * Change microversion header nameKen'ichi Ohmichi2015-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ironic has already implemented its own microversion mechanism, and the header name is X-Ironic-API-Version, not X-Baremetal-API-Version. Because Ida9f60d8cbd0dcf48669b82e619fc4016ee0bcb7 removed program terminology from the governance repo. The microversions of Nova is not used yet. And for consistency of whole OpenStack projects, this patch changes microversion header names on Nova side. Partially implements blueprint api-microversions Change-Id: I3ea2b2982c5f792c82832d772ae951b157da8b39 Depends-on: I1b43e2662107ad81e57b96f0c9430c61b795fdea
* | Use oslo.logDavanum Srinivas2015-02-221-1/+1
|/ | | | | | | | | | Convert the use of the incubated version of the log module to the new oslo.log library. Sync oslo-incubator modules to update their imports as well. Co-Authored-By: Doug Hellmann <doug@doughellmann.com> Change-Id: Ic4932e3f58191869c30bd07a010a6e9fdcb2a12c