#1134 libmodulemd does not require the branch value to be bytes
Merged a year ago by mprahl. Opened a year ago by mikeb.
mikeb/fm-orchestrator modulemd-branch-bytes  into  master

@@ -636,7 +636,7 @@ 

                                    'does not match the branch "{1}"'.format(

                                        mmd.get_stream(), scm.branch))


-         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

@@ -30,7 +30,7 @@ 

  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 @@ 

          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,



Under Python 3, validation in SCM.verify() that the commit is contained on the branch would always fail, because it was comparing str and bytes values.

Pull-Request has been merged by mprahl

a year ago