libmodulemd does not require the branch value to be bytes

This commit is contained in:
Mike Bonnet
2019-02-06 12:51:07 -08:00
parent fce77b48dc
commit 6e62cf6867
2 changed files with 2 additions and 6 deletions

View File

@@ -636,7 +636,7 @@ def _fetch_mmd(url, branch=None, allow_local_url=False, whitelist_url=False,
'does not match the branch "{1}"'.format(
mmd.get_stream(), scm.branch))
else:
mmd.set_stream(str(scm.branch))
mmd.set_stream(scm.branch)
# If the version is in the modulemd, throw an exception since the version
# since the version is generated by MBS

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 six import text_type, string_types
from six import string_types
from module_build_service import app, conf, log, models, db, version, api_version as max_api_version
from module_build_service.utils import (
@@ -401,10 +401,6 @@ class SCMHandler(BaseHandler):
url = self.data["scmurl"]
branch = self.data["branch"]
# python-modulemd expects this to be bytes, not unicode.
if isinstance(branch, text_type):
branch = branch.encode('utf-8')
return submit_module_build_from_scm(self.username, url, branch,
allow_local_url=False,
optional_params=self.optional_params)