Skip to content

Commit

Permalink
Added allowance for cached spot file
Browse files Browse the repository at this point in the history
  • Loading branch information
dwest77a committed Dec 17, 2024
1 parent 1cde4f3 commit 46a48d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cci_os_worker/fbi_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def __init__(self, conf: dict, dryrun: bool = False, test: bool = False):

logger.info('Loading FBI Updater')

self._spot_file = conf.get('spot_file',None)

super().__init__(conf, dryrun=dryrun, test=test)

if self._test:
Expand All @@ -93,7 +95,7 @@ def __init__(self, conf: dict, dryrun: bool = False, test: bool = False):
ldap_hosts = self._conf['ldap_configuration']['hosts']
self.ldap_interface = LDAPIdentifier(server=ldap_hosts, auto_bind=True)

self.pt = PathTools()
self.pt = PathTools(spot_file=self._spot_file)

def _single_process_file(self, path, index,**kwargs) -> None:
"""
Expand Down
3 changes: 2 additions & 1 deletion cci_os_worker/path_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ def __init__(
self,
moles_mapping_url: str = "http://api.catalogue.ceda.ac.uk/api/v2/observations.json/",
mapping_file: Optional[str] = None,
spot_file: str = None,
):

if os.path.isfile('moles_mapping.json'):
mapping_file = 'moles_mapping.json'

self.spots = SpotMapping()
self.spots = SpotMapping(spot_file=spot_file)

self.moles_mapping_url = moles_mapping_url

Expand Down

0 comments on commit 46a48d1

Please sign in to comment.