diff options
author | Victor Morales <victor.morales@intel.com> | 2017-08-31 12:03:23 -0500 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2017-08-31 17:33:20 -0500 |
commit | bbd8fafbf83c374c70308c17f10228221068d254 (patch) | |
tree | 0ea7c559665ff06a591959eefc10bcd7cb7410f3 /newton | |
parent | bbc1222bc0044a813bec83572a1acebcc459d5e0 (diff) |
Add Python 3.5 support
Python 2.7 will be supported until 2020[1]. This changes helps to
prepares the transition to the transition to Python 3.x and those
systems which not support other versions.
[1] https://hg.python.org/peps/rev/76d43e52d978
Change-Id: Ic2847e907e29d565c89b0448135393f923de20e3
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: MULTICLOUD-83
Diffstat (limited to 'newton')
-rw-r--r-- | newton/newton/extensions/urls.py | 4 | ||||
-rw-r--r-- | newton/newton/proxy/tests/test_identity_proxy.py | 2 | ||||
-rw-r--r-- | newton/newton/proxy/urls.py | 4 | ||||
-rw-r--r-- | newton/newton/pub/utils/fileutil.py | 2 | ||||
-rw-r--r-- | newton/newton/pub/utils/restcall.py | 4 | ||||
-rw-r--r-- | newton/newton/requests/urls.py | 18 | ||||
-rw-r--r-- | newton/newton/requests/views/flavor.py | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/hosts.py | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/image.py | 4 | ||||
-rw-r--r-- | newton/newton/requests/views/limits.py | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/network.py | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/server.py | 4 | ||||
-rw-r--r-- | newton/newton/requests/views/subnet.py | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/tenants.py | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/volume.py | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/vport.py | 2 | ||||
-rw-r--r-- | newton/newton/samples/tests.py | 2 | ||||
-rw-r--r-- | newton/newton/swagger/views.py | 4 | ||||
-rw-r--r-- | newton/tox.ini | 4 |
19 files changed, 34 insertions, 34 deletions
diff --git a/newton/newton/extensions/urls.py b/newton/newton/extensions/urls.py index ade2b6dc..e87a02eb 100644 --- a/newton/newton/extensions/urls.py +++ b/newton/newton/extensions/urls.py @@ -15,8 +15,8 @@ from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns -from views import extensions -from views import epacaps +from newton.extensions.views import extensions +from newton.extensions.views import epacaps urlpatterns = [ url(r'^sions$', extensions.Extensions.as_view()), diff --git a/newton/newton/proxy/tests/test_identity_proxy.py b/newton/newton/proxy/tests/test_identity_proxy.py index 5066ed67..edda66ee 100644 --- a/newton/newton/proxy/tests/test_identity_proxy.py +++ b/newton/newton/proxy/tests/test_identity_proxy.py @@ -525,7 +525,7 @@ class TestIdentityService(unittest.TestCase): data ={} response = self.client.post("/api/multicloud-newton/v0/windriver-hudson-dc_RegionOne/identity/v3/auth/tokens", data=data, format='json') self.failUnlessEqual(status.HTTP_201_CREATED, response.status_code) - context = json.loads(response.content) + context = response.json() self.assertTrue(response['X-Subject-Token'] != None) self.assertTrue(context['token']['catalog'] != None) diff --git a/newton/newton/proxy/urls.py b/newton/newton/proxy/urls.py index 01d2007c..99a4e851 100644 --- a/newton/newton/proxy/urls.py +++ b/newton/newton/proxy/urls.py @@ -15,8 +15,8 @@ from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns -from views import identityV3 -from views import services +from newton.proxy.views import identityV3 +from newton.proxy.views import services urlpatterns = [ # url(r'^identity/v2)$', diff --git a/newton/newton/pub/utils/fileutil.py b/newton/newton/pub/utils/fileutil.py index a33186ec..6fbbec7e 100644 --- a/newton/newton/pub/utils/fileutil.py +++ b/newton/newton/pub/utils/fileutil.py @@ -12,7 +12,7 @@ import os import shutil import logging import traceback -import urllib2 +from six.moves import urllib logger = logging.getLogger(__name__) diff --git a/newton/newton/pub/utils/restcall.py b/newton/newton/pub/utils/restcall.py index 9f36909c..d784f09c 100644 --- a/newton/newton/pub/utils/restcall.py +++ b/newton/newton/pub/utils/restcall.py @@ -12,9 +12,9 @@ import sys import traceback import logging -import urllib2 +from six.moves import urllib import uuid -import httplib +from six.moves import http_client import httplib2 from rest_framework import status diff --git a/newton/newton/requests/urls.py b/newton/newton/requests/urls.py index 77045340..69f0e444 100644 --- a/newton/newton/requests/urls.py +++ b/newton/newton/requests/urls.py @@ -15,15 +15,15 @@ from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns -from views import network -from views import subnet -from views import image -from views import volume -from views import server -from views import vport -from views import limits -from views import hosts -from views import flavor +from newton.requests.views import network +from newton.requests.views import subnet +from newton.requests.views import image +from newton.requests.views import volume +from newton.requests.views import server +from newton.requests.views import vport +from newton.requests.views import limits +from newton.requests.views import hosts +from newton.requests.views import flavor urlpatterns = [ url(r'^networks(/(?P<networkid>[0-9a-zA-Z_-]+))?', diff --git a/newton/newton/requests/views/flavor.py b/newton/newton/requests/views/flavor.py index 497e105f..eebfe2bb 100644 --- a/newton/newton/requests/views/flavor.py +++ b/newton/newton/requests/views/flavor.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/hosts.py b/newton/newton/requests/views/hosts.py index 86af7152..e8b13e55 100644 --- a/newton/newton/requests/views/hosts.py +++ b/newton/newton/requests/views/hosts.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/image.py b/newton/newton/requests/views/image.py index 178675ae..ae3eacd5 100644 --- a/newton/newton/requests/views/image.py +++ b/newton/newton/requests/views/image.py @@ -13,7 +13,7 @@ # limitations under the License. import logging import json -import urllib2 +from six.moves import urllib import threading import traceback from keystoneauth1.exceptions import HttpError @@ -23,7 +23,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/limits.py b/newton/newton/requests/views/limits.py index 5df83808..4ff5f8cb 100644 --- a/newton/newton/requests/views/limits.py +++ b/newton/newton/requests/views/limits.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/network.py b/newton/newton/requests/views/network.py index a68afba3..9c59e95e 100644 --- a/newton/newton/requests/views/network.py +++ b/newton/newton/requests/views/network.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/server.py b/newton/newton/requests/views/server.py index 2b33bccf..d2221323 100644 --- a/newton/newton/requests/views/server.py +++ b/newton/newton/requests/views/server.py @@ -13,7 +13,7 @@ # limitations under the License. import logging import json -import urllib2 +from six.moves import urllib import threading import traceback from keystoneauth1.exceptions import HttpError @@ -23,7 +23,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/subnet.py b/newton/newton/requests/views/subnet.py index af436107..12f0c084 100644 --- a/newton/newton/requests/views/subnet.py +++ b/newton/newton/requests/views/subnet.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/tenants.py b/newton/newton/requests/views/tenants.py index 7bf544e0..901839a4 100644 --- a/newton/newton/requests/views/tenants.py +++ b/newton/newton/requests/views/tenants.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/volume.py b/newton/newton/requests/views/volume.py index 2e693c07..b5aa0bab 100644 --- a/newton/newton/requests/views/volume.py +++ b/newton/newton/requests/views/volume.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/requests/views/vport.py b/newton/newton/requests/views/vport.py index 021e459c..17f8e83a 100644 --- a/newton/newton/requests/views/vport.py +++ b/newton/newton/requests/views/vport.py @@ -21,7 +21,7 @@ from rest_framework.views import APIView from newton.pub.exceptions import VimDriverNewtonException -from util import VimDriverUtils +from newton.requests.views.util import VimDriverUtils logger = logging.getLogger(__name__) diff --git a/newton/newton/samples/tests.py b/newton/newton/samples/tests.py index 50b571a3..d419efa5 100644 --- a/newton/newton/samples/tests.py +++ b/newton/newton/samples/tests.py @@ -25,5 +25,5 @@ class SampleViewTest(unittest.TestCase): def test_sample(self): response = self.client.get("/samples/") self.assertEqual(status.HTTP_200_OK, response.status_code, response.content) - resp_data = json.loads(response.content) + resp_data = response.json() self.assertEqual({"status": "active"}, resp_data) diff --git a/newton/newton/swagger/views.py b/newton/newton/swagger/views.py index 66d42d68..00d5f3ed 100644 --- a/newton/newton/swagger/views.py +++ b/newton/newton/swagger/views.py @@ -83,7 +83,7 @@ class SwaggerJsonView(APIView): f.close() json_data["paths"].update(json_data_temp["paths"]) json_data["definitions"].update(json_data_temp["definitions"]) - json_data["basePath"] = "/api/multicloud-newton/v0/" - json_data["info"]["title"] = "MultiVIM driver of OpenStack Newton Service NBI" + json_data["basePath"] = "/api/multicloud-newton/v0/" + json_data["info"]["title"] = "MultiVIM driver of OpenStack Newton Service NBI" return Response(json_data) diff --git a/newton/tox.ini b/newton/tox.ini index 4e15a2e7..ee15e4b0 100644 --- a/newton/tox.ini +++ b/newton/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27 +envlist = py27,py35 skipsdist = true [tox:jenkins] @@ -8,5 +8,5 @@ downloadcache = ~/cache/pip [testenv] deps = -r{toxinidir}/requirements.txt commands = coverage run --branch manage.py test newton - coverage html --omit="*test*,*__init__.py" -d htmlcov + coverage html --omit=".tox*,*test*,*__init__.py" -d htmlcov |