common

pilot.copytool.common.get_copysetup(copytools, copytool_name)[source]

Return the copysetup for the given copytool.

Parameters:
  • copytools – copytools list from infosys.

  • name (copytool) – name of copytool (string).

Returns:

copysetup (string).

pilot.copytool.common.get_error_info(rcode, state, error_msg)[source]

Return an error info dictionary specific to transfer errors. Helper function to resolve_common_transfer_errors().

Parameters:
  • rcode – return code (int).

  • state – state string used in Rucio traces.

  • error_msg – transfer command stdout (string).

Returns:

dictionary with format {‘rcode’: rcode, ‘state’: state, ‘error’: error_msg}.

pilot.copytool.common.get_timeout(filesize, add=0)[source]

Get a proper time-out limit based on the file size.

Parameters:
  • filesize – file size (int).

  • add – optional additional time to be added [s] (int)

Returns:

time-out in seconds (int).

pilot.copytool.common.merge_destinations(files)[source]

Converts the file-with-destination dict to a destination-with-files dict

:param files Files to merge

:returns destination-with-files dictionary

pilot.copytool.common.output_line_scan(ret, output)[source]

Do some reg exp on the transfer command output to search for special errors. Helper function to resolve_common_transfer_errors().

Parameters:
  • ret – pre-filled error info dictionary with format {‘rcode’: rcode, ‘state’: state, ‘error’: error_msg}

  • output – transfer command stdout (string).

Returns:

updated error info dictionary.

pilot.copytool.common.resolve_common_transfer_errors(output, is_stagein=True)[source]

Resolve any common transfer related errors.

Parameters:
  • output – stdout from transfer command (string).

  • is_stagein – optional (boolean).

Returns:

dict {‘rcode’: rcode, ‘state’: state, ‘error’: error_msg}.

pilot.copytool.common.verify_catalog_checksum(fspec, path)[source]

Verify that the local and remote (fspec) checksum values are the same. The function will update the fspec object.

Parameters:
  • fspec – FileSpec object for a given file.

  • path – path to local file (string).

Returns:

state (string), diagnostics (string).