Skip to content

Commit

Permalink
block use in batch jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Feb 24, 2025
1 parent 40fb8f0 commit 9acb20c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions get_files_on_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
import os,sys,getpass,warnings,glob,shlex,subprocess,argparse # pylint: disable=multiple-imports
from collections import defaultdict

# prevent this script from ever being used in a batch job
# to avoid DDOS of Rucio
if "_CONDOR_SCRATCH_DIR" in os.environ:
print("Error: this script cannot be used in batch jobs")
sys.exit(1)

def getOS():
"""Gets OS version from shell (other methods return host OS when in container)"""
cmd = r"sed -nr 's/[^0-9]*([0-9]+).*/\1/p' /etc/redhat-release"
Expand Down

0 comments on commit 9acb20c

Please sign in to comment.