Browse Source

Run pep8 tox env with python3 interpreter

This changes the pep8 environ to run pyflakes3 and
fixes python3 compatibility errors.

Change-Id: I2a57966cd60fbc54be1f07a2505ff029ab8dda41
Grzegorz Grasza 6 months ago
parent
commit
01be20f981
2 changed files with 6 additions and 4 deletions
  1. 5
    3
      novajoin/novajoin/tests/integration/test_ipa.py
  2. 1
    1
      tox.ini

+ 5
- 3
novajoin/novajoin/tests/integration/test_ipa.py View File

@@ -28,9 +28,11 @@ import testtools
28 28
 import time
29 29
 import uuid
30 30
 
31
+
31 32
 from ipapython.ipa_log_manager import log_mgr
32 33
 
33 34
 from ipalib import api
35
+import six
34 36
 
35 37
 from novajoin import config
36 38
 from novajoin.ipa import IPAClient
@@ -60,7 +62,7 @@ class TestIPAService(testtools.TestCase):
60 62
         console = log_mgr.get_handler('console')
61 63
         console.setLevel(logging.WARN)
62 64
         if hostname is None:
63
-            hostname = unicode(str(uuid.uuid4()) + '.' + api.env.domain)
65
+            hostname = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain)
64 66
         os.environ['KRB5_CONFIG'] = 'krb5.conf'
65 67
 
66 68
     def test_host_add(self):
@@ -79,7 +81,7 @@ class TestIPAService(testtools.TestCase):
79 81
 
80 82
     def test_host_subhost(self):
81 83
         global hostname
82
-        subhost = unicode(str(uuid.uuid4()) + '.' + api.env.domain)
84
+        subhost = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain)
83 85
         self.ipaclient.add_subhost(subhost)
84 86
         self.ipaclient.flush_batch_operation()
85 87
 
@@ -103,7 +105,7 @@ class TestIPAService(testtools.TestCase):
103 105
         ipaotp = str(uuid.uuid4())
104 106
         metadata = {}
105 107
         image_metadata = {}
106
-        subhost = unicode(str(uuid.uuid4()) + '.' + api.env.domain)
108
+        subhost = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain)
107 109
         service_principal = u'test/%s' % subhost
108 110
         self.ipaclient.add_host(hostname, ipaotp, metadata, image_metadata)
109 111
         self.ipaclient.add_host(subhost, ipaotp, metadata, image_metadata)

+ 1
- 1
tox.ini View File

@@ -29,6 +29,7 @@ whitelist_externals =
29 29
 passenv = *_proxy *_PROXY
30 30
 
31 31
 [testenv:pep8]
32
+basepython = python3
32 33
 commands =
33 34
   flake8 {posargs} .
34 35
   {toxinidir}/tools/check_exec.py {toxinidir}/novajoin
@@ -66,4 +67,3 @@ commands = sphinx-build -W -b html doc/source doc/build/html
66 67
 sitepackages = False
67 68
 envdir = {toxworkdir}/pep8
68 69
 commands = oslo-config-generator --config-file=files/novajoin-config-generator.conf
69
-

Loading…
Cancel
Save