Run pep8 tox env with python3 interpreter
This changes the pep8 environ to run pyflakes3 and fixes python3 compatibility errors. Change-Id: I2a57966cd60fbc54be1f07a2505ff029ab8dda41
This commit is contained in:
parent
769ed3329b
commit
01be20f981
|
@ -28,9 +28,11 @@ import testtools
|
|||
import time
|
||||
import uuid
|
||||
|
||||
|
||||
from ipapython.ipa_log_manager import log_mgr
|
||||
|
||||
from ipalib import api
|
||||
import six
|
||||
|
||||
from novajoin import config
|
||||
from novajoin.ipa import IPAClient
|
||||
|
@ -60,7 +62,7 @@ class TestIPAService(testtools.TestCase):
|
|||
console = log_mgr.get_handler('console')
|
||||
console.setLevel(logging.WARN)
|
||||
if hostname is None:
|
||||
hostname = unicode(str(uuid.uuid4()) + '.' + api.env.domain)
|
||||
hostname = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain)
|
||||
os.environ['KRB5_CONFIG'] = 'krb5.conf'
|
||||
|
||||
def test_host_add(self):
|
||||
|
@ -79,7 +81,7 @@ class TestIPAService(testtools.TestCase):
|
|||
|
||||
def test_host_subhost(self):
|
||||
global hostname
|
||||
subhost = unicode(str(uuid.uuid4()) + '.' + api.env.domain)
|
||||
subhost = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain)
|
||||
self.ipaclient.add_subhost(subhost)
|
||||
self.ipaclient.flush_batch_operation()
|
||||
|
||||
|
@ -103,7 +105,7 @@ class TestIPAService(testtools.TestCase):
|
|||
ipaotp = str(uuid.uuid4())
|
||||
metadata = {}
|
||||
image_metadata = {}
|
||||
subhost = unicode(str(uuid.uuid4()) + '.' + api.env.domain)
|
||||
subhost = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain)
|
||||
service_principal = u'test/%s' % subhost
|
||||
self.ipaclient.add_host(hostname, ipaotp, metadata, image_metadata)
|
||||
self.ipaclient.add_host(subhost, ipaotp, metadata, image_metadata)
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -29,6 +29,7 @@ whitelist_externals =
|
|||
passenv = *_proxy *_PROXY
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python3
|
||||
commands =
|
||||
flake8 {posargs} .
|
||||
{toxinidir}/tools/check_exec.py {toxinidir}/novajoin
|
||||
|
@ -66,4 +67,3 @@ commands = sphinx-build -W -b html doc/source doc/build/html
|
|||
sitepackages = False
|
||||
envdir = {toxworkdir}/pep8
|
||||
commands = oslo-config-generator --config-file=files/novajoin-config-generator.conf
|
||||
|
||||
|
|
Loading…
Reference in New Issue