diff --git a/mbs-empty-server-name.patch b/mbs-empty-server-name.patch new file mode 100644 index 0000000..72eecb0 --- /dev/null +++ b/mbs-empty-server-name.patch @@ -0,0 +1,26 @@ +diff --git a/module_build_service/manage.py b/module_build_service/manage.py +index 2c94f87..866dbde 100644 +--- a/module_build_service/manage.py ++++ b/module_build_service/manage.py +@@ -125,7 +125,7 @@ def cleardb(): + def build_module_locally(url, branch, skiptests=False): + """ Performs local module build using Mock + """ +- if 'SERVER_NAME' not in app.config: ++ if 'SERVER_NAME' not in app.config or not app.config['SERVER_NAME']: + app.config["SERVER_NAME"] = 'localhost' + + with app.app_context(): +diff --git a/module_build_service/models.py b/module_build_service/models.py +index 6786968..01f0c37 100644 +--- a/module_build_service/models.py ++++ b/module_build_service/models.py +@@ -81,7 +81,7 @@ def make_session(conf): + Yields new SQLAlchemy database sesssion. + """ + # Needs to be set to create app_context. +- if 'SERVER_NAME' not in app.config: ++ if 'SERVER_NAME' not in app.config or not app.config['SERVER_NAME']: + app.config['SERVER_NAME'] = 'localhost' + + # If there is no app_context, we have to create one before creating diff --git a/module-build-service.spec b/module-build-service.spec index d3b3c6e..483d1ee 100644 --- a/module-build-service.spec +++ b/module-build-service.spec @@ -1,6 +1,6 @@ Name: module-build-service Version: 1.3.25 -Release: 3%{?dist} +Release: 4%{?dist} Summary: The Module Build Service for Modularity @@ -11,6 +11,7 @@ Source0: https://files.pythonhosted.org/packages/source/m/%{name}/%{name}-%{vers %if 0%{?rhel} && 0%{?rhel} <= 7 Patch0: mbs-no-mbsbuild.patch %endif +Patch1: mbs-empty-server-name.patch %if 0%{?rhel} && 0%{?rhel} <= 7 # In EL7 we need flask which needs python-itsdangerous which comes from @@ -170,6 +171,8 @@ for a number of tasks: %patch0 -p1 %endif +%patch1 -p1 + # Simply remove an old .pyc file that was included in one release. rm -f module_build_service/scheduler/consumer.pyc # And this weird sqlite file that made it in... @@ -186,7 +189,7 @@ rm -f module_build_service/.mbs_local_build.db export PYTHONPATH=%{buildroot}%{python2_sitelib} mkdir -p %{buildroot}/%{_mandir}/man1 for command in mbs-manager mbs-frontend mbs-gencert mbs-upgradedb ; do -MBS_CONFIG_FILE=conf/config.py %{buildroot}/%{_bindir}/$command || true +MBS_CONFIG_FILE=conf/config.py %{buildroot}/%{_bindir}/$command --help || true MBS_CONFIG_FILE=conf/config.py help2man -N --version-string=%{version} \ %{buildroot}/%{_bindir}/$command > \ %{buildroot}/%{_mandir}/man1/$command.1 @@ -219,6 +222,9 @@ done %changelog +* Tue Jul 18 2017 Jan Kaluza - 1.3.25-4 +- fix bug during build caused by not set SERVER_NAME in configuration file + * Mon Jul 17 2017 Jan Kaluza - 1.3.25-3 - fix typo in spec file