Skip to content

Commit 49302fe

Browse files
committed
Workflow parser: add some sanity checks
1 parent c7c3ef6 commit 49302fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

DATA/tools/parse

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import sys
44
import shlex
55
import tempfile
66
import re
7+
8+
if not os.path.exists("tools/parse"):
9+
print("Running from incorrect directory")
10+
exit(1)
11+
712
if 'EPNSYNCMODE' in os.environ and int(os.environ['EPNSYNCMODE']):
813
sys.path.insert(0, '/usr/share/Modules/init')
914
import python as mod
@@ -131,7 +136,8 @@ for line in f:
131136
odccommand = os.environ['GEN_TOPO_ODC_EPN_TOPO_CMD']
132137
else:
133138
odccommand = 'odc-epn-topo'
134-
odccommand += ' ' + os.environ['GEN_TOPO_ODC_EPN_TOPO_ARGS']
139+
if 'GEN_TOPO_ODC_EPN_TOPO_ARGS' in os.environ:
140+
odccommand += ' ' + os.environ['GEN_TOPO_ODC_EPN_TOPO_ARGS']
135141
if reconodes:
136142
replacestring = ""
137143
dd_env_variables = ['DD_DISK_FRACTION']

0 commit comments

Comments
 (0)