From 6e62cf68676e1dd8d3f5ca661a8b88600721bfc8 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Feb 07 2019 00:56:33 +0000 Subject: libmodulemd does not require the branch value to be bytes --- diff --git a/module_build_service/utils/submit.py b/module_build_service/utils/submit.py index 239d972..8683da7 100644 --- a/module_build_service/utils/submit.py +++ b/module_build_service/utils/submit.py @@ -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 diff --git a/module_build_service/views.py b/module_build_service/views.py index 44550c7..edcbe84 100644 --- a/module_build_service/views.py +++ b/module_build_service/views.py @@ -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)