Skip to content

Commit

Permalink
Using get() instead of direct dictionary lookup to prevent problem in…
Browse files Browse the repository at this point in the history
… harvester with transfer() call
  • Loading branch information
Paul Nilsson committed Dec 11, 2023
1 parent bda2eaa commit 6a3c0c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pilot/api/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def transfer_files(self, copytool, files, activity=None, **kwargs): # noqa: C90
"""
if getattr(copytool, 'require_replicas', False) and files:
if files[0].replicas is None: # look up replicas only once
files = self.resolve_replicas(files, use_vp=kwargs['use_vp'])
files = self.resolve_replicas(files, use_vp=kwargs.get('use_vp', False))

allowed_schemas = getattr(copytool, 'allowed_schemas', None)

Expand All @@ -787,7 +787,7 @@ def transfer_files(self, copytool, files, activity=None, **kwargs): # noqa: C90
allowed_schemas = self.infosys.queuedata.resolve_allowed_schemas(activity, copytool_name) or allowed_schemas

# overwrite allowed_schemas for VP jobs
if kwargs['use_vp']:
if kwargs.get('use_vp', False):
allowed_schemas = ['root']
self.logger.debug('overwrote allowed_schemas for VP job: %s', str(allowed_schemas))

Expand Down Expand Up @@ -839,7 +839,7 @@ def transfer_files(self, copytool, files, activity=None, **kwargs): # noqa: C90

# prepare files (resolve protocol/transfer url)
if getattr(copytool, 'require_input_protocols', False) and files:
self.require_protocols(files, copytool, activity, local_dir=kwargs['input_dir'])
self.require_protocols(files, copytool, activity, local_dir=kwargs.get('input_dir'))

# mark direct access files with status=remote_io
self.set_status_for_direct_access(files, kwargs.get('workdir', ''))
Expand Down

0 comments on commit 6a3c0c9

Please sign in to comment.