From 99a546403f6f6d79aea833d7d650d29130f470d6 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: May 09 2017 11:27:49 +0000 Subject: fix homedir expansion in configuration variables --- diff --git a/mbs-expand-home-dir.patch b/mbs-expand-home-dir.patch new file mode 100644 index 0000000..8d0be9c --- /dev/null +++ b/mbs-expand-home-dir.patch @@ -0,0 +1,44 @@ +diff --git a/module_build_service/config.py b/module_build_service/config.py +index e2e2fbe..34f62e3 100644 +--- a/module_build_service/config.py ++++ b/module_build_service/config.py +@@ -350,22 +350,23 @@ class Config(object): + raise Exception("Configuration item's name is not allowed: %s" % key) + + # Create the empty self._key attribute, so we can assign to it. +- setattr(self, "_" + key, None) +- +- # Create self.key property to access the self._key attribute. +- # Use the setifok_func if available for the attribute. +- setifok_func = '_setifok_{}'.format(key) +- if hasattr(self, setifok_func): +- setx = lambda self, val: getattr(self, setifok_func)(val) +- elif value_type == Path: +- # For paths, expanduser. +- setx = lambda self, val: setattr( +- self, "_" + key, os.path.expanduser(val)) +- else: +- setx = lambda self, val: setattr(self, "_" + key, val) +- getx = lambda self: getattr(self, "_" + key) +- delx = lambda self: delattr(self, "_" + key) +- setattr(Config, key, property(getx, setx, delx)) ++ if not hasattr(self, "_" + key): ++ setattr(self, "_" + key, None) ++ ++ # Create self.key property to access the self._key attribute. ++ # Use the setifok_func if available for the attribute. ++ setifok_func = '_setifok_{}'.format(key) ++ if hasattr(self, setifok_func): ++ setx = lambda self, val: getattr(self, setifok_func)(val) ++ elif value_type == Path: ++ # For paths, expanduser. ++ setx = lambda self, val: setattr( ++ self, "_" + key, os.path.expanduser(val)) ++ else: ++ setx = lambda self, val: setattr(self, "_" + key, val) ++ getx = lambda self: getattr(self, "_" + key) ++ delx = lambda self: delattr(self, "_" + key) ++ setattr(Config, key, property(getx, setx, delx)) + + # managed/registered configuration items + if key in self._defaults: diff --git a/module-build-service.spec b/module-build-service.spec index 0ae476c..d1ad7b1 100644 --- a/module-build-service.spec +++ b/module-build-service.spec @@ -1,13 +1,14 @@ Name: module-build-service Version: 1.3.21 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The Module Build Service for Modularity Group: Development/Tools License: MIT URL: https://pagure.io/fm-orchestrator Source0: https://files.pythonhosted.org/packages/source/m/%{name}/%{name}-%{version}.tar.gz -Patch0: mock-no-bootstrap-container.patch +Patch0: mock-no-bootstrap-container.patch +Patch1: mbs-expand-home-dir.patch %if 0%{?rhel} && 0%{?rhel} <= 7 # In EL7 we need flask which needs python-itsdangerous which comes from @@ -122,6 +123,7 @@ for a number of tasks: %setup -q %patch0 -p1 +%patch1 -p1 # Simply remove an old .pyc file that was included in one release. rm -f module_build_service/scheduler/consumer.pyc @@ -171,6 +173,9 @@ done %changelog +* Tue May 09 2017 Jan Kaluza - 1.3.21-3 +- fix homedir expansion in configuration variables + * Tue May 09 2017 Jan Kaluza - 1.3.21-2 - fix the compatibility with new Mock