Skip to content
Browse files

Making shortening of jobnames when submitting to endpoint configurabl…

…e. Defaults to not shortening anymore.
  • Loading branch information...
1 parent 6a5462e commit 3756c2f539c1a0303489ba49696330014f57ecd4 @makkus makkus committed
View
21 grisu-commons/src/main/java/grisu/settings/ServerPropertiesManager.java
@@ -754,13 +754,32 @@ public static HierarchicalINIConfiguration getServerConfiguration()
return config;
}
+ public static boolean getShortenJobname() {
+ boolean shorten = false;
+
+ try {
+ try {
+ shorten = getServerConfiguration().getBoolean(
+ "General.shortenJobname");
+ } catch (final NoSuchElementException e) {
+ // doesn't matter
+ // myLogger.debug(e.getLocalizedMessage(), e);
+ }
+
+ } catch (final ConfigurationException e) {
+ // myLogger.error("Problem with config file: " + e.getMessage());
+ myLogger.debug(e.getLocalizedMessage());
+ }
+ return shorten;
+ }
+
+
public static TidGenerator getTidGenerator() {
return new SecureRandomTid();
}
-
public static boolean getVerifyAfterArchive() {
boolean verify = false;
View
14 grisu-core/src/main/java/grisu/backend/model/job/gt4/GT4Submitter.java
@@ -247,11 +247,15 @@ public static String createJobSubmissionDescription(final Document jsdl,
// jobname
final Element jobname = output.createElement("jobname");
final String jobname_string = JsdlHelpers.getJobname(jsdl);
- // because of some pbs restrictions we have to keep the jobname to 6
- // chars
- if (jobname_string.length() > 6) {
- jobname.setTextContent(jobname_string.substring(jobname_string
- .length() - 6));
+ if (ServerPropertiesManager.getShortenJobname()) {
+ // because of some pbs restrictions we have to keep the jobname to 6
+ // chars
+ if (jobname_string.length() > 6) {
+ jobname.setTextContent(jobname_string.substring(jobname_string
+ .length() - 6));
+ } else {
+ jobname.setTextContent(jobname_string);
+ }
} else {
jobname.setTextContent(jobname_string);
}
View
7 grisu-core/src/main/java/grisu/backend/model/job/gt5/RSLFactory.java
@@ -2,6 +2,7 @@
import grisu.jcommons.utils.JsdlHelpers;
import grisu.model.FileManager;
+import grisu.settings.ServerPropertiesManager;
import java.util.Map;
import java.util.regex.Pattern;
@@ -73,8 +74,10 @@ public RslNode create(final Document jsdl, final String fqan)
// job name
String jobname = JsdlHelpers.getJobname(jsdl);
- jobname = (jobname == null) ? "" : jobname.substring(Math.max(0,
- jobname.length() - 6));
+ if (ServerPropertiesManager.getShortenJobname()) {
+ jobname = (jobname == null) ? "" : jobname.substring(Math.max(0,
+ jobname.length() - 6));
+ }
addWhenNotBlank(result, "jobname", jobname);

0 comments on commit 3756c2f

Please sign in to comment.
Something went wrong with that request. Please try again.