Skip to content

Commit 17b6a26

Browse files
authored
Merge pull request #733 from European-XFEL/check-none
Handle cases where there is no output from the check command
2 parents 0cc5e3e + 5a447a9 commit 17b6a26

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

extra_data/cli/check_readable.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ def monitor_access_check(path):
113113
timeout=args.timeout, capture_output=True,
114114
env={'OMP_NUM_THREADS': '1'})
115115
except subprocess.TimeoutExpired as e:
116-
path_states[path] = e.stdout.decode().splitlines()[-1]
116+
if e.stdout is None:
117+
path_states[path] = "Status unknown, no output from check command"
118+
else:
119+
path_states[path] = e.stdout.decode().splitlines()[-1]
117120
return 'T'
118121
else:
119122
path_states[path] = p.stdout.decode().splitlines()[-1]
@@ -158,4 +161,4 @@ def monitor_access_check(path):
158161

159162

160163
if __name__ == '__main__':
161-
sys.exit(main())
164+
sys.exit(main())

0 commit comments

Comments
 (0)