clean up unnecessary usage of the six library (awx only supports py3)

This commit is contained in:
Ryan Petrello
2019-01-24 17:57:08 -05:00
parent 68950d56ca
commit daeeaf413a
58 changed files with 238 additions and 311 deletions

View File

@@ -1,7 +1,6 @@
import logging
from django.db.models import Q
import six
logger = logging.getLogger('awx.main.migrations')
@@ -39,8 +38,8 @@ def rename_inventory_sources(apps, schema_editor):
Q(deprecated_group__inventory__organization=org)).distinct().all()):
inventory = invsrc.deprecated_group.inventory if invsrc.deprecated_group else invsrc.inventory
name = six.text_type('{0} - {1} - {2}').format(invsrc.name, inventory.name, i)
logger.debug(six.text_type("Renaming InventorySource({0}) {1} -> {2}").format(
name = '{0} - {1} - {2}'.format(invsrc.name, inventory.name, i)
logger.debug("Renaming InventorySource({0}) {1} -> {2}".format(
invsrc.pk, invsrc.name, name
))
invsrc.name = name

View File

@@ -1,7 +1,6 @@
import logging
import json
from django.utils.translation import ugettext_lazy as _
import six
from awx.conf.migrations._reencrypt import (
decrypt_field,

View File

@@ -3,8 +3,6 @@ import logging
from django.utils.timezone import now
from django.utils.text import slugify
import six
from awx.main.models.base import PERM_INVENTORY_SCAN, PERM_INVENTORY_DEPLOY
from awx.main import utils
@@ -26,7 +24,7 @@ def _create_fact_scan_project(ContentType, Project, org):
polymorphic_ctype=ct)
proj.save()
slug_name = slugify(six.text_type(name)).replace(u'-', u'_')
slug_name = slugify(str(name)).replace(u'-', u'_')
proj.local_path = u'_%d__%s' % (int(proj.pk), slug_name)
proj.save()