Permalink
Browse files

Fixes #69: Adding grisu client and client version information to env …

…of every job.
  • Loading branch information...
1 parent f7f93cc commit 6a5462e3d0ddb9e7fb3a49911caf52d00120bbf1 @makkus makkus committed Jun 27, 2012
@@ -307,7 +307,7 @@ public static ServiceInterface loginCommandline(String backend)
public static String setClientName(String name) {
if (StringUtils.isBlank(name)) {
- name = "Unknown";
+ name = "n/a";
}
CLIENT_NAME = name;
MDC.put("client", name);
@@ -12,6 +12,7 @@
import grisu.frontend.control.clientexceptions.FileTransactionException;
import grisu.frontend.control.fileTransfers.FileTransaction;
import grisu.frontend.control.fileTransfers.FileTransactionManager;
+import grisu.frontend.control.login.LoginManager;
import grisu.frontend.model.events.JobCleanedEvent;
import grisu.frontend.model.events.JobStatusEvent;
import grisu.frontend.model.events.NewJobEvent;
@@ -45,11 +46,12 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.bushe.swing.event.EventBus;
-import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
+import com.google.common.collect.Maps;
+
/**
* A model class that hides all the complexity of creating and submitting a job.
*
@@ -468,6 +470,12 @@ public final String createJob(final String fqan,
this.status, JobConstants.UNDEFINED));
}
+ myLogger.debug("Adding grisu client information to environment.");
+ String client = LoginManager.getClientName();
+ String version = LoginManager.getClientVersion();
+ addEnvironmentVariable("GRISU_CLIENT", client);
+ addEnvironmentVariable("GRISU_CLIENT_VERSION", version);
+
try {
setJobname(serviceInterface.createJob(
getJobDescriptionDocumentAsString(), fqan,

0 comments on commit 6a5462e

Please sign in to comment.