diff --git a/python/spacewalk/common/rhnConfig.py b/python/spacewalk/common/rhnConfig.py index a05b4d452fda..933fc7289e0d 100644 --- a/python/spacewalk/common/rhnConfig.py +++ b/python/spacewalk/common/rhnConfig.py @@ -129,16 +129,17 @@ def parse(self): the configuration cache self.__configs """ # Speed up the most common case - timeDiff = self.modifiedYN() - if not timeDiff and self.is_initialized(): - # Nothing to do: the config file did not change and we already - # have the config cached - return - else: - # if the timestamp changed, clear the list of cached configs - # and retain the new timestamp - self.updateLastModified(timeDiff) - self.__configs.clear() # cache cleared + if self.is_initialized(): + timeDiff = self.modifiedYN() + if not timeDiff: + # Nothing to do: the config file did not change and we already + # have the config cached + return + else: + # if the timestamp changed, clear the list of cached configs + # and retain the new timestamp + self.updateLastModified(timeDiff) + self.__configs.clear() # cache cleared # parse the defaults. self._parseDefaults(allCompsYN=0) diff --git a/python/spacewalk/spacewalk-backend.changes.tanganellilore.fix_clear_cache_config b/python/spacewalk/spacewalk-backend.changes.tanganellilore.fix_clear_cache_config new file mode 100644 index 000000000000..5050065c1abb --- /dev/null +++ b/python/spacewalk/spacewalk-backend.changes.tanganellilore.fix_clear_cache_config @@ -0,0 +1 @@ +- fix clear of self.__config cache on rhnConfig.py only when timeDiff change