[ARVADOS] updated: 975c10c5b8ccc7d12ee4df993e06a359c4bbec93

git at public.curoverse.com git at public.curoverse.com
Thu Feb 20 10:16:37 EST 2014


Summary of changes:
 sdk/python/bin/arv-mount |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

       via  975c10c5b8ccc7d12ee4df993e06a359c4bbec93 (commit)
      from  426b8ae13589e4ee121a094a6f18dd89a577402d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 975c10c5b8ccc7d12ee4df993e06a359c4bbec93
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Feb 20 10:17:43 2014 -0500

    Added --exec, needs testing.

diff --git a/sdk/python/bin/arv-mount b/sdk/python/bin/arv-mount
index aa5bd0e..613db12 100755
--- a/sdk/python/bin/arv-mount
+++ b/sdk/python/bin/arv-mount
@@ -2,7 +2,7 @@
 
 from arvados.fuse import * 
 import arvados
-
+import subprocess
 
 if __name__ == '__main__':
     api = arvados.api()
@@ -13,6 +13,7 @@ if __name__ == '__main__':
     parser.add_argument('mountpoint', type=str, help="""Mount point.""")
     parser.add_argument('--collection', type=str, help="""Collection locator""")
     parser.add_argument('--debug', action='store_true', help="""Debug mode""")
+    parser.add_argument('--exec', type=str, help="""Mount, run a command, then unmount and exit""")
 
     args = parser.parse_args()
 
@@ -32,16 +33,22 @@ if __name__ == '__main__':
 
     # Enable FUSE debugging (logs each FUSE request)
     if args.debug:
-        opts += ['debug']
+        opts += ['debug']    
     
     # Initialize the fuse connection
     llfuse.init(operations, args.mountpoint, opts)
 
-    # Run the main loop
-    #try:
-    llfuse.main()
-    #except:
-    #    llfuse.close(unmount=True)
-    #    raise
-    #
-    #llfuse.close(unmount=True)
+    if args.exec:
+        t = threading.Thread(None, lambda: llfuse.main())
+        t.start()
+
+        # wait until the driver is finished initializing
+        operations.initlock.wait()
+
+        rc = subprocess.call(args.exec)
+
+        subprocess.call(["fusermount", "-u", args.mountpoint])
+
+        return rc
+    else:
+        llfuse.main()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list