Use six instead of future

This commit is contained in:
mprahl
2018-04-05 11:24:07 -04:00
parent 9c603a27ec
commit aa990d3de3
3 changed files with 8 additions and 9 deletions

View File

@@ -33,9 +33,9 @@ import shutil
import subprocess
import tempfile
import time
from builtins import str
from io import open
from six import text_type
import koji
from module_build_service import log, build_logs
@@ -170,7 +170,7 @@ class KojiContentGenerator(object):
tools = [u"modulemd"]
ret = []
for tool in tools:
version = str(pkg_resources.get_distribution(tool).version)
version = text_type(pkg_resources.get_distribution(tool).version)
ret.append({u"name": tool,
u"version": version})
return ret
@@ -233,15 +233,15 @@ class KojiContentGenerator(object):
ret = {
u"id": 1,
u"host": {
u"arch": str(platform.machine()),
u"arch": text_type(platform.machine()),
u'os': u"%s %s" % (distro[0], distro[1])
},
u"content_generator": {
u"name": u"module-build-service",
u"version": str(version)
u"version": text_type(version)
},
u"container": {
u"arch": str(platform.machine()),
u"arch": text_type(platform.machine()),
u"type": u"none"
},
u"components": self.__get_rpms(),
@@ -278,7 +278,7 @@ class KojiContentGenerator(object):
},
u'filesize': len(self.mmd),
u'checksum_type': u'md5',
u'checksum': str(hashlib.md5(self.mmd.encode('utf-8')).hexdigest()),
u'checksum': text_type(hashlib.md5(self.mmd.encode('utf-8')).hexdigest()),
u'filename': u'modulemd.txt',
u'components': components
}

View File

@@ -30,7 +30,7 @@ import json
import module_build_service.auth
from flask import request, url_for
from flask.views import MethodView
from builtins import str
from six import text_type
from module_build_service import app, conf, log, models, db, version, api_version as max_api_version
from module_build_service.utils import (
@@ -342,7 +342,7 @@ class SCMHandler(BaseHandler):
branch = self.data["branch"]
# python-modulemd expects this to be bytes, not unicode.
if isinstance(branch, str):
if isinstance(branch, text_type):
branch = branch.encode('utf-8')
return submit_module_build_from_scm(self.username, url, branch,

View File

@@ -7,7 +7,6 @@ dogpile.cache
fedmsg
funcsigs # Python2 only
futures # Python 2 only
future
httplib2
kerberos
kobo>=0.5.0