[Swift-commit] cog r4020

swift at ci.uchicago.edu swift at ci.uchicago.edu
Fri Jul 11 22:40:03 CDT 2014


------------------------------------------------------------------------
r4020 | hategan | 2014-07-11 22:39:53 -0500 (Fri, 11 Jul 2014) | 1 line

changed environment to a map rather than a channel
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/compiled/nodes/grid/GridExec.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/compiled/nodes/grid/GridExec.java	(revision 4019)
+++ modules/karajan/src/org/globus/cog/karajan/compiled/nodes/grid/GridExec.java	(working copy)
@@ -66,7 +66,7 @@
 	protected ArgRef<Boolean> failOnJobError;
 	protected ArgRef<Boolean> batch;
 	
-	protected ChannelRef<Map.Entry<String, String>> c_environment;
+	protected ArgRef<Map<String, String>> environment;
 	protected ChannelRef<List<?>> c_stagein;
 	protected ChannelRef<List<?>> c_stageout;
 	protected ChannelRef<String> c_cleanup;
@@ -96,7 +96,7 @@
 						optional("attributes", Collections.EMPTY_MAP),
 						optional("failOnJobError", true),
 						optional("batch", false),
-						channel("environment"),
+						optional("environment", null),
 						channel("stagein"),
 						channel("stageout"),
 						channel("cleanup")
@@ -244,10 +244,12 @@
 
 	protected void addEnvironment(Stack stack, JobSpecificationImpl js)
 			throws ExecutionException {
-		Channel<Map.Entry<String, String>> env = this.c_environment.get(stack);
-		for (Map.Entry<String, String> e : env) {
-			js.addEnvironmentVariable(e.getKey(), e.getValue());
-		}
+	    Map<String, String> env = this.environment.getValue(stack);
+	    if (env != null) {
+    		for (Map.Entry<String, String> e : env.entrySet()) {
+    			js.addEnvironmentVariable(e.getKey(), e.getValue());
+    		}
+	    }
 	}
 	
 	private static final EnumSet<Mode> DEFAULT_STAGEOUT_MODE = EnumSet.of(Mode.IF_PRESENT, Mode.ON_SUCCESS);



More information about the Swift-commit mailing list