diff --git a/osclib/cache.py b/osclib/cache.py index f3da5cff..91bd8923 100644 --- a/osclib/cache.py +++ b/osclib/cache.py @@ -112,9 +112,8 @@ class Cache(object): Cache.patterns = [] - conf.get_config() - if str2bool(conf.config.get('osrt.cache.disable', '')): - if conf.config['debug']: print('CACHE_DISABLE via osrt.cache.disable', file=sys.stderr) + if str2bool(os.environ.get('OSRT_DISABLE_CACHE', '')): + if conf.config['debug']: print('CACHE_DISABLE via $OSRT_DISABLE_CACHE', file=sys.stderr) return for pattern in Cache.PATTERNS: diff --git a/tests/OBSLocal.py b/tests/OBSLocal.py index 9e147e89..a0513133 100644 --- a/tests/OBSLocal.py +++ b/tests/OBSLocal.py @@ -26,11 +26,7 @@ from osclib.core import attribute_value_save from osclib.core import request_state_change from osclib.memoize import memoize_session_reset -try: - from urllib.error import HTTPError, URLError -except ImportError: - #python 2.x - from urllib2 import HTTPError, URLError +from urllib.error import HTTPError, URLError # pointing to other docker container APIURL = 'http://api:3000' @@ -71,7 +67,6 @@ class TestCase(unittest.TestCase): '[general]', 'apiurl = http://api:3000', 'cookiejar = {}'.format(OSCCOOKIEJAR), - 'osrt.cache.disable = true', '[http://api:3000]', 'user = {}'.format(userid), 'pass = opensuse', @@ -104,6 +99,7 @@ class TestCase(unittest.TestCase): override_no_keyring=True, override_no_gnome_keyring=True) os.environ['OSC_CONFIG'] = OSCRC + os.environ['OSRT_DISABLE_CACHE'] = 'true' def execute_script(self, args): if self.script: