Commit b43de922 authored by Matias Guijarro's avatar Matias Guijarro Committed by blissadm_ID31@bibhelm
Browse files

fix #2217: create icat object on demand

parent e2ca9ea7
Pipeline #35919 passed with stages
in 87 minutes and 29 seconds
......@@ -212,10 +212,8 @@ class Session:
self.__children_tree = None
self.__include_sessions = config_tree.get("include-sessions")
self.__config_aliases = config_tree.get("aliases", [])
if config_tree.get("icat-mapping"):
self.__icat_mapping = self.config.get(config_tree.get("icat-mapping"))
else:
self.__icat_mapping = None
self.__icat_mapping = None
self.__icat_mapping_config = config_tree.get("icat-mapping")
self.__default_user_script_homedir = config_tree.get("default-userscript-dir")
if self.__default_user_script_homedir and not self._get_user_script_home():
self._set_user_script_home(self.__default_user_script_homedir)
......@@ -288,7 +286,11 @@ class Session:
@property
def icat_mapping(self):
return self.__icat_mapping
if self.__icat_mapping is not None:
return self.__icat_mapping
if self.__icat_mapping_config:
self.__icat_mapping = self.config.get(self.__icat_mapping_config)
return self.__icat_mapping
def _child_session_iter(self):
sessions_tree = self.sessions_tree
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment