提交 fea12f76 编写于 作者: K Kohsuke Kawaguchi

Merge branch 'stable-1.609' of github.com:jenkinsci/jenkins into stable-1.609

......@@ -1159,11 +1159,11 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
try {
InetAddress ia = InetAddress.getByName(address);
if(!(ia instanceof Inet4Address)) {
LOGGER.fine(address+" is not an IPv4 address");
LOGGER.log(Level.FINE, "{0} is not an IPv4 address", address);
continue;
}
if(!ComputerPinger.checkIsReachable(ia, 3)) {
LOGGER.fine(address+" didn't respond to ping");
LOGGER.log(Level.FINE, "{0} didn't respond to ping", address);
continue;
}
cachedHostName = ia.getCanonicalHostName();
......@@ -1171,7 +1171,10 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
return cachedHostName;
} catch (IOException e) {
// if a given name fails to parse on this host, we get this error
LOGGER.log(Level.FINE, "Failed to parse "+address,e);
LogRecord lr = new LogRecord(Level.FINE, "Failed to parse {0}");
lr.setThrown(e);
lr.setParameters(new Object[]{address});
LOGGER.log(lr);
}
}
......@@ -1195,27 +1198,29 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
}
private static class ListPossibleNames extends MasterToSlaveCallable<List<String>,IOException> {
private static final Logger LOGGER = Logger.getLogger(ListPossibleNames.class.getName());
public List<String> call() throws IOException {
List<String> names = new ArrayList<String>();
Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
while (nis.hasMoreElements()) {
NetworkInterface ni = nis.nextElement();
LOGGER.fine("Listing up IP addresses for "+ni.getDisplayName());
LOGGER.log(Level.FINE, "Listing up IP addresses for {0}", ni.getDisplayName());
Enumeration<InetAddress> e = ni.getInetAddresses();
while (e.hasMoreElements()) {
InetAddress ia = e.nextElement();
if(ia.isLoopbackAddress()) {
LOGGER.fine(ia+" is a loopback address");
LOGGER.log(Level.FINE, "{0} is a loopback address", ia);
continue;
}
if(!(ia instanceof Inet4Address)) {
LOGGER.fine(ia+" is not an IPv4 address");
LOGGER.log(Level.FINE, "{0} is not an IPv4 address", ia);
continue;
}
LOGGER.fine(ia+" is a viable candidate");
LOGGER.log(Level.FINE, "{0} is a viable candidate", ia);
names.add(ia.getHostAddress());
}
}
......
......@@ -37,6 +37,8 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Locale;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.export.Exported;
......@@ -81,6 +83,14 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito
return path;
}
// Needed for jelly that does not seem to be able to access properties
// named 'size' as it confuses it with built-in size method and fails
// to parse the expression expecting '()'.
@Restricted(DoNotUse.class)
public long getFreeSize() {
return size;
}
/**
* Gets GB left.
*/
......
......@@ -29,7 +29,7 @@ THE SOFTWARE.
<td align="right" data="-1">N/A</td>
</j:when>
<j:otherwise>
<td align="right" data="${data}"><j:out value="${data.toHtml()}"/></td>
<td align="right" data="${data.freeSize}"><j:out value="${data.toHtml()}"/></td>
</j:otherwise>
</j:choose>
</j:jelly>
\ No newline at end of file
</j:jelly>
......@@ -32,4 +32,4 @@ THE SOFTWARE.
<td align="right" data="${from.toMB(data)}"><j:out value="${from.toHtml(data)}"/></td>
</j:otherwise>
</j:choose>
</j:jelly>
\ No newline at end of file
</j:jelly>
......@@ -29,7 +29,7 @@ THE SOFTWARE.
<td align="right" data="-1">N/A</td>
</j:when>
<j:otherwise>
<td align="right" data="${data}"><j:out value="${data.toHtml()}"/></td>
<td align="right" data="${data.freeSize}"><j:out value="${data.toHtml()}"/></td>
</j:otherwise>
</j:choose>
</j:jelly>
\ No newline at end of file
</j:jelly>
......@@ -176,7 +176,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>remoting</artifactId>
<version>2.50</version>
<version>2.52</version>
</dependency>
<dependency>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册