Skip to content

Commit

Permalink
Merge pull request #2452 from fviale/master
Browse files Browse the repository at this point in the history
fix for #2448 add wildcard of addons dir to the classpath instead of …
  • Loading branch information
fviale committed Jan 28, 2016
2 parents 887bd7d + d0b528b commit cafa92d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,15 @@
*/
package org.ow2.proactive.resourcemanager.utils;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import org.objectweb.proactive.core.config.xml.ProActiveConfigurationParser;
import org.ow2.proactive.resourcemanager.core.properties.PAResourceManagerProperties;
import org.ow2.proactive.utils.PAProperties;
import org.ow2.proactive.utils.Tools;

import java.io.File;
import java.io.IOException;
import java.util.*;


/**
* CommandLineBuilder is an utility class that provide users with the capability to automatise
Expand Down Expand Up @@ -293,21 +287,10 @@ public List<String> buildCommandLineAsList(boolean displayCredentials) throws IO

// add the content of addons dir on the classpath
classpath.append(os.ps).append(rmHome).append(ADDONS_DIR);
// add jars inside the addons directory
classpath.append(os.ps).append(rmHome).append(ADDONS_DIR).append(os.fs).append("*");
classpath.append(os.ps).append(libRoot).append("*");

// add jars inside the addons directory
File addonsAbsolute = new File(rmHome + ADDONS_DIR);
File[] files = addonsAbsolute.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.getName().matches(".*[.]jar");
}
});
if (files != null) {
for (File file : files) {
classpath.append(os.ps).append(file.getAbsolutePath());
}
}
command.add(classpath.toString());
command.add(RMNodeStarter.class.getName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,10 @@
*/
package org.ow2.proactive.resourcemanager.nodesource.infrastructure;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.security.KeyException;
import java.util.ArrayList;
import java.util.Properties;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import org.apache.log4j.Logger;
import org.objectweb.proactive.core.config.CentralPAPropertyRepository;
import org.objectweb.proactive.core.node.Node;
Expand All @@ -64,10 +53,14 @@
import org.ow2.proactive.resourcemanager.utils.RMNodeStarter;
import org.ow2.proactive.utils.Formatter;

import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.security.KeyException;
import java.util.ArrayList;
import java.util.Properties;
import java.util.concurrent.*;


/**
Expand Down Expand Up @@ -178,6 +171,8 @@ protected void startNodeImpl(final InetAddress host) throws RMException {
clb.setJavaPath(this.javaPath);
clb.setRmHome(this.schedulingPath);
clb.setPaProperties(sb);
// Target Operating System is necessary linux (while host os can be windows)
clb.setTargetOS(OperatingSystem.UNIX);
// current rmcore shortID should be added to ensure uniqueness
final String nodeName = "SSH-" + this.nodeSource.getName() + "-" + ProActiveCounter.getUniqID();
clb.setNodeName(nodeName);
Expand Down

0 comments on commit cafa92d

Please sign in to comment.