basestring to six.string_types for Python 3

This commit is contained in:
cclauss
2018-02-09 16:28:36 +01:00
parent ce9cb24995
commit c371b869dc
11 changed files with 43 additions and 30 deletions

View File

@@ -1,5 +1,7 @@
from django.contrib.auth.models import User
import six
from awx.main.models import (
Organization,
Project,
@@ -148,7 +150,7 @@ def create_survey_spec(variables=None, default_type='integer', required=True, mi
vars_list = variables
else:
vars_list = [variables]
if isinstance(variables[0], basestring):
if isinstance(variables[0], six.string_types):
slogan = variables[0]
else:
slogan = variables[0].get('question_name', 'something')
@@ -415,14 +417,14 @@ def create_workflow_job_template(name, organization=None, persisted=True, **kwar
wfjt = mk_workflow_job_template(name,
organization=organization,
spec=spec,
spec=spec,
extra_vars=extra_vars,
persisted=persisted)
workflow_jt_nodes = generate_workflow_job_template_nodes(wfjt,
persisted,
workflow_jt_nodes = generate_workflow_job_template_nodes(wfjt,
persisted,
workflow_job_template_nodes=kwargs.get('workflow_job_template_nodes', []))
'''
@@ -438,5 +440,3 @@ def create_workflow_job_template(name, organization=None, persisted=True, **kwar
#jobs=jobs,
workflow_job_template_nodes=workflow_jt_nodes,
survey=spec,)