Report error message and propagate exit code if subprocess.call() fails.
authorTom Clegg <tom@curoverse.com>
Tue, 11 Mar 2014 18:58:44 +0000 (14:58 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 11 Mar 2014 18:58:44 +0000 (14:58 -0400)
sdk/python/bin/arv-mount

index ac9cd9bcf6088cbc54751ec340d143b66c423154..5e773dfbc6c0185f32b02b76ab3255692a8b4cbe 100755 (executable)
@@ -51,10 +51,14 @@ with "--".
         # wait until the driver is finished initializing
         operations.initlock.wait()
 
+        rc = 255
         try:
             rc = subprocess.call(args.exec_args, shell=False)
-        except:
-            rc = 255
+        except OSError as e:
+            sys.stderr.write('arv-mount: %s -- exec %s\n' % (str(e), args.exec_args))
+            rc = e.errno
+        except Exception as e:
+            sys.stderr.write('arv-mount: %s\n' % str(e))
         finally:
             subprocess.call(["fusermount", "-u", "-z", args.mountpoint])