[Swift-commit] r3307 - SwiftApps/adem-osg

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon May 3 14:56:21 CDT 2010


Author: aespinosa
Date: 2010-05-03 14:56:21 -0500 (Mon, 03 May 2010)
New Revision: 3307

Modified:
   SwiftApps/adem-osg/adem-test.rb
   SwiftApps/adem-osg/adem.rb
Log:
Refactored rootdir

Modified: SwiftApps/adem-osg/adem-test.rb
===================================================================
--- SwiftApps/adem-osg/adem-test.rb	2010-05-03 19:56:19 UTC (rev 3306)
+++ SwiftApps/adem-osg/adem-test.rb	2010-05-03 19:56:21 UTC (rev 3307)
@@ -67,7 +67,10 @@
       :app_directory => "/panfs/panasas/CMS/app",
       :storage_element => "gsiftp://ff-gridftp.unl.edu:2811"
     }
-    assert_equal("/opt/pacman/pacman-3.28", pacman_find(site, @conf))
+    assert_equal(
+      "/opt/pacman/pacman-3.28",
+      pacman_find(site, "/panfs/panasas/CMS/app/engage")
+    )
   end
 end
 

Modified: SwiftApps/adem-osg/adem.rb
===================================================================
--- SwiftApps/adem-osg/adem.rb	2010-05-03 19:56:19 UTC (rev 3306)
+++ SwiftApps/adem-osg/adem.rb	2010-05-03 19:56:21 UTC (rev 3307)
@@ -112,11 +112,11 @@
   `pacman -trust-all-caches -lc #{pacman_cache}`
 end
 
-def app_deploy(app, site, conf)
-  sites.each do |site|
-    root = site[:pacman] || pacman_find(site, conf)
-    site[:pacman] = root
-    pacman_install site, root, conf
+def app_deploy(app, conf)
+  conf[:sites].each do |site|
+    path = "#{site[:app_directory]}/#{conf[:virtual_organization]}"
+    site[:pacman] = pacman_find(site, path) if not site[:pacman] 
+    pacman_install site, path
   end
 end
 
@@ -124,10 +124,8 @@
   compute_element.gsub /jobmanager-.*$/, "jobmanager-fork"
 end
 
-def pacman_find(site, conf)
+def pacman_find(site, rootdir)
   contact = site_fork site[:compute_element]
-  storage = site[:storage_element].first
-  rootdir = site[:app_directory] + "/" + conf[:virtual_organization] 
   File.open("find_pacman.sh", "w") do |dump|
     dump.puts "#!/bin/bash"
     dump.puts "which pacman"




More information about the Swift-commit mailing list