Merge "Run pep8 tox env with python3 interpreter"
This commit is contained in:
commit
671f58dbfb
|
@ -28,9 +28,11 @@ import testtools
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
from ipapython.ipa_log_manager import log_mgr
|
from ipapython.ipa_log_manager import log_mgr
|
||||||
|
|
||||||
from ipalib import api
|
from ipalib import api
|
||||||
|
import six
|
||||||
|
|
||||||
from novajoin import config
|
from novajoin import config
|
||||||
from novajoin.ipa import IPAClient
|
from novajoin.ipa import IPAClient
|
||||||
|
@ -60,7 +62,7 @@ class TestIPAService(testtools.TestCase):
|
||||||
console = log_mgr.get_handler('console')
|
console = log_mgr.get_handler('console')
|
||||||
console.setLevel(logging.WARN)
|
console.setLevel(logging.WARN)
|
||||||
if hostname is None:
|
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'
|
os.environ['KRB5_CONFIG'] = 'krb5.conf'
|
||||||
|
|
||||||
def test_host_add(self):
|
def test_host_add(self):
|
||||||
|
@ -79,7 +81,7 @@ class TestIPAService(testtools.TestCase):
|
||||||
|
|
||||||
def test_host_subhost(self):
|
def test_host_subhost(self):
|
||||||
global hostname
|
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.add_subhost(subhost)
|
||||||
self.ipaclient.flush_batch_operation()
|
self.ipaclient.flush_batch_operation()
|
||||||
|
|
||||||
|
@ -103,7 +105,7 @@ class TestIPAService(testtools.TestCase):
|
||||||
ipaotp = str(uuid.uuid4())
|
ipaotp = str(uuid.uuid4())
|
||||||
metadata = {}
|
metadata = {}
|
||||||
image_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
|
service_principal = u'test/%s' % subhost
|
||||||
self.ipaclient.add_host(hostname, ipaotp, metadata, image_metadata)
|
self.ipaclient.add_host(hostname, ipaotp, metadata, image_metadata)
|
||||||
self.ipaclient.add_host(subhost, 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
|
passenv = *_proxy *_PROXY
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
|
basepython = python3
|
||||||
commands =
|
commands =
|
||||||
flake8 {posargs} .
|
flake8 {posargs} .
|
||||||
{toxinidir}/tools/check_exec.py {toxinidir}/novajoin
|
{toxinidir}/tools/check_exec.py {toxinidir}/novajoin
|
||||||
|
@ -66,4 +67,3 @@ commands = sphinx-build -W -b html doc/source doc/build/html
|
||||||
sitepackages = False
|
sitepackages = False
|
||||||
envdir = {toxworkdir}/pep8
|
envdir = {toxworkdir}/pep8
|
||||||
commands = oslo-config-generator --config-file=files/novajoin-config-generator.conf
|
commands = oslo-config-generator --config-file=files/novajoin-config-generator.conf
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue