mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-11 00:55:00 +08:00
Use six instead of future
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -7,7 +7,6 @@ dogpile.cache
|
||||
fedmsg
|
||||
funcsigs # Python2 only
|
||||
futures # Python 2 only
|
||||
future
|
||||
httplib2
|
||||
kerberos
|
||||
kobo>=0.5.0
|
||||
|
||||
Reference in New Issue
Block a user