Skip to content

Commit

Permalink
Fixing error and committing changes to submit_py3
Browse files Browse the repository at this point in the history
  • Loading branch information
anpicci committed Jan 5, 2025
1 parent 6b355cf commit db23225
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/python/WMCore/Storage/Backends/GFAL2Impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,23 @@ def createStageOutCommand(self, sourcePFN, targetPFN, options=None, checksums=No
# Special case: for _CONDOR_CREDS, log its subpath if defined
if var == "_CONDOR_CREDS" and value != "Not defined":
subpath = os.path.join(value, "cms.use")
logger.info(f"{var}/cms.use: {subpath}")
logging.info(f"{var}/cms.use: {subpath}")

if os.path.exists(subpath):
try:
decoded_output = subprocess.check_output(
["htdecodetoken", "-H", subpath], stderr=subprocess.STDOUT, text=True
)
if decoded_output.strip():
logger.info(f"Decoded token for {var}/cms.use:\n{decoded_output.strip()}")
logging.info(f"Decoded token for {var}/cms.use:\n{decoded_output.strip()}")
else:
logger.warning(f"No output from htdecodetoken for {var}/cms.use.")
logging.warning(f"No output from htdecodetoken for {var}/cms.use.")
except subprocess.CalledProcessError as e:
logger.error(f"Error decoding token for {var}/cms.use: {e.output.strip()}")
logging.error(f"Error decoding token for {var}/cms.use: {e.output.strip()}")
except FileNotFoundError:
logger.error(f"htdecodetoken command not found. Ensure it is installed and in the PATH.")
logging.error(f"htdecodetoken command not found. Ensure it is installed and in the PATH.")
else:
logger.warning(f"Subpath does not exist: {subpath}")
logging.warning(f"Subpath does not exist: {subpath}")


if _CheckExitCodeOption:
Expand Down

0 comments on commit db23225

Please sign in to comment.