Remove dependency from cache to config
Getting the right config depends on too many things that cache.py can't know - so just rely on environment variables instead Fixes #2289
This commit is contained in:
parent
a595666eef
commit
31ee1047cd
@ -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:
|
||||
|
@ -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
|
||||
|
||||
# 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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user