From c4fe6b047b85a57cd2572053ba8595deaecd7058 Mon Sep 17 00:00:00 2001 From: Suman Chakravartula Date: Mon, 30 Nov 2015 08:30:00 -0800 Subject: [PATCH] Log the exception if device scan fails, and exit. #1026 --- src/rockstor/scripts/bootstrap.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rockstor/scripts/bootstrap.py b/src/rockstor/scripts/bootstrap.py index 22ea22693..c691bb459 100644 --- a/src/rockstor/scripts/bootstrap.py +++ b/src/rockstor/scripts/bootstrap.py @@ -33,13 +33,19 @@ def main(): - aw = APIWrapper() - device_scan() + + try: + device_scan() + except Exception, e: + print ('BTRFS device scan failed due to an exception. This indicates ' + 'a serious problem. Aborting. Exception: %s' % e.__str__()) + sys.exit(1) print('BTRFS device scan complete') num_attempts = 0 while True: try: + aw = APIWrapper() aw.api_call('network') aw.api_call('commands/bootstrap', calltype='post') break