[Swift-commit] r4784 - SwiftApps/GOSwift/pykoa/tools

jonmon at ci.uchicago.edu jonmon at ci.uchicago.edu
Tue Jul 5 22:51:52 CDT 2011


Author: jonmon
Date: 2011-07-05 22:51:52 -0500 (Tue, 05 Jul 2011)
New Revision: 4784

Modified:
   SwiftApps/GOSwift/pykoa/tools/koa_goswift.py
Log:
o swift now can be run on the vm through globusonline


Modified: SwiftApps/GOSwift/pykoa/tools/koa_goswift.py
===================================================================
--- SwiftApps/GOSwift/pykoa/tools/koa_goswift.py	2011-07-05 22:26:56 UTC (rev 4783)
+++ SwiftApps/GOSwift/pykoa/tools/koa_goswift.py	2011-07-06 03:51:52 UTC (rev 4784)
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+import commands
 import os
 import sys
 import uuid
@@ -172,12 +173,15 @@
     #      same time will screw everything to  #
     #      fail.                               #
     ############################################
-    # write to appropriate files created in /tmp
-    tc_file = open( '/tmp/tc', 'w' )
-    sites_file = open( '/tmp/sites.xml', 'w' )
-    config_file = open( '/tmp/cf', 'w' )
-    script_file = open( '/tmp/script.swift', 'w' )
+    # write to appropriate files created in /home/jonmon/swift
+    if not os.access( '/home/jonmon/swift', os.F_OK ):
+        os.mkdir( '/home/jonmon/swift' )
 
+    tc_file = open( '/home/jonmon/swift/tc', 'w' )
+    sites_file = open( '/home/jonmon/swift/sites.xml', 'w' )
+    config_file = open( '/home/jonmon/swift/cf', 'w' )
+    script_file = open( '/home/jonmon/swift/script.swift', 'w' )
+
     tc_file.write( tc )
     sites_file.write( sites )
     config_file.write( config )
@@ -202,13 +206,16 @@
         return 0
 
     # Execute the script
+    os.chdir( '/home/jonmon/swift' )
+    ( status, output ) = commands.getstatusoutput( '/home/koa/swift-0.92/bin/swift -sites.file sites.xml -tc.file tc -config cf script.swift' )
+    sys.stdout.write( "Swift output: " + output + "\n" )
+    sys.stdout.write( "Swift exit status: " + str(status) + "\n" )
 
-    # THIS SCRIPT DOES NOT HAVE PRIVALEDGES TO REMOVE FROM /tmp
     # clean up
-#    os.remove( "/tmp/tc" )
-#    os.remove( "/tmp/sites.xml" )
-#    os.remove( "/tmp/config" )
-#    os.remove( "/tmp/script.swift" )
+    os.remove( "/home/jonmon/swift/tc" )
+    os.remove( "/home/jonmon/swift/sites.xml" )
+    os.remove( "/home/jonmon/swift/cf" )
+    os.remove( "/home/jonmon/swift/script.swift" )
 
     return 0
 




More information about the Swift-commit mailing list