diff --git a/osc-staging.py b/osc-staging.py index 3a01bc09..5687a309 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -389,6 +389,9 @@ def do_staging(self, subcmd, opts, *args): else: opts.project = 'Factory' + # Cache the remote config fetch. + Cache.init() + # Init the OBS access and configuration opts.project = self._full_project_name(opts.project) opts.apiurl = self.get_api_url() diff --git a/osclib/cache.py b/osclib/cache.py index 2e5f41df..71508124 100644 --- a/osclib/cache.py +++ b/osclib/cache.py @@ -103,6 +103,11 @@ class Cache(object): @staticmethod def init(directory='main'): + if Cache.CACHE_DIR: + # Stick with the first initialization to allow for StagingAPI to + # ensure always enabled, but allow parent to change directory. + return + Cache.CACHE_DIR = CacheManager.directory('request', directory) Cache.patterns = []