Skip to content

Commit 9acb20c

Browse files
committed
block use in batch jobs
1 parent 40fb8f0 commit 9acb20c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

get_files_on_disk.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
import os,sys,getpass,warnings,glob,shlex,subprocess,argparse # pylint: disable=multiple-imports
66
from collections import defaultdict
77

8+
# prevent this script from ever being used in a batch job
9+
# to avoid DDOS of Rucio
10+
if "_CONDOR_SCRATCH_DIR" in os.environ:
11+
print("Error: this script cannot be used in batch jobs")
12+
sys.exit(1)
13+
814
def getOS():
915
"""Gets OS version from shell (other methods return host OS when in container)"""
1016
cmd = r"sed -nr 's/[^0-9]*([0-9]+).*/\1/p' /etc/redhat-release"

0 commit comments

Comments
 (0)