use of com.cloudbees.jenkins.support.util.SystemPlatform in project support-core-plugin by jenkinsci.
the class AdvancedProcFilesRetriever method addUnixContents.
@Override
protected void addUnixContents(@NonNull Container container, @NonNull final Node node) {
Computer c = node.toComputer();
if (c == null || c.isOffline()) {
return;
}
// fast path bailout for Windows
if (!Boolean.TRUE.equals(c.isUnix())) {
return;
}
SystemPlatform nodeSystemPlatform = getSystemPlatform(node);
if (!SystemPlatform.LINUX.equals(nodeSystemPlatform)) {
return;
}
String name;
if (node instanceof Jenkins) {
name = "master";
} else {
name = "slave/" + node.getNodeName();
}
for (ProcFile procDescriptor : getProcFilesToRetrieve()) {
container.add(new FilePathContent("nodes/{0}/proc/{1}", new String[] { name, procDescriptor.getName() }, new FilePath(c.getChannel(), procDescriptor.getFile())) {
@Override
public boolean shouldBeFiltered() {
// Whether this specific file should be filtered or not
return procDescriptor.isFiltered();
}
});
}
afterAddUnixContents(container, node, name);
}
use of com.cloudbees.jenkins.support.util.SystemPlatform in project support-core-plugin by jenkinsci.
the class ProcFilesRetriever method addUnixContents.
protected void addUnixContents(@NonNull Container container, @NonNull final Node node) {
Computer c = node.toComputer();
if (c == null || c.isOffline()) {
return;
}
// fast path bailout for Windows
if (!Boolean.TRUE.equals(c.isUnix())) {
return;
}
SystemPlatform nodeSystemPlatform = getSystemPlatform(node);
if (!SystemPlatform.LINUX.equals(nodeSystemPlatform)) {
return;
}
String name;
if (node instanceof Jenkins) {
name = "master";
} else {
name = "slave/" + node.getNodeName();
}
for (Map.Entry<String, String> procDescriptor : getFilesToRetrieve().entrySet()) {
container.add(new FilePathContent("nodes/{0}/proc/{1}", new String[] { name, procDescriptor.getValue() }, new FilePath(c.getChannel(), procDescriptor.getKey())));
}
afterAddUnixContents(container, node, name);
}
Aggregations