Improve parsing of job IDs
This commit is contained in:
parent
a5435e65dc
commit
11f334d2b4
1 changed files with 2 additions and 1 deletions
|
@ -25,7 +25,8 @@ def parse_jobid(s):
|
|||
import re
|
||||
hawkpbs = r'.hawk-pbs5'
|
||||
jobid = re.sub(hawkpbs, '', s)
|
||||
if not jobid.isdigit():
|
||||
not_allowed = r'[^0-9\[\]]' # Jobid can be more complex than just digits, eg 2444420[201]
|
||||
if re.search(not_allowed, jobid):
|
||||
raise argparse.ArgumentTypeError(f'invalid job ID "{s}"')
|
||||
return jobid
|
||||
|
||||
|
|
Loading…
Reference in a new issue