提交 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 ...@@ -1159,11 +1159,11 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
try { try {
InetAddress ia = InetAddress.getByName(address); InetAddress ia = InetAddress.getByName(address);
if(!(ia instanceof Inet4Address)) { if(!(ia instanceof Inet4Address)) {
LOGGER.fine(address+" is not an IPv4 address"); LOGGER.log(Level.FINE, "{0} is not an IPv4 address", address);
continue; continue;
} }
if(!ComputerPinger.checkIsReachable(ia, 3)) { 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; continue;
} }
cachedHostName = ia.getCanonicalHostName(); cachedHostName = ia.getCanonicalHostName();
...@@ -1171,7 +1171,10 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces ...@@ -1171,7 +1171,10 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
return cachedHostName; return cachedHostName;
} catch (IOException e) { } catch (IOException e) {
// if a given name fails to parse on this host, we get this error // 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 ...@@ -1195,27 +1198,29 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
} }
private static class ListPossibleNames extends MasterToSlaveCallable<List<String>,IOException> { 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 { public List<String> call() throws IOException {
List<String> names = new ArrayList<String>(); List<String> names = new ArrayList<String>();
Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces(); Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
while (nis.hasMoreElements()) { while (nis.hasMoreElements()) {
NetworkInterface ni = nis.nextElement(); 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(); Enumeration<InetAddress> e = ni.getInetAddresses();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
InetAddress ia = e.nextElement(); InetAddress ia = e.nextElement();
if(ia.isLoopbackAddress()) { if(ia.isLoopbackAddress()) {
LOGGER.fine(ia+" is a loopback address"); LOGGER.log(Level.FINE, "{0} is a loopback address", ia);
continue; continue;
} }
if(!(ia instanceof Inet4Address)) { if(!(ia instanceof Inet4Address)) {
LOGGER.fine(ia+" is not an IPv4 address"); LOGGER.log(Level.FINE, "{0} is not an IPv4 address", ia);
continue; continue;
} }
LOGGER.fine(ia+" is a viable candidate"); LOGGER.log(Level.FINE, "{0} is a viable candidate", ia);
names.add(ia.getHostAddress()); names.add(ia.getHostAddress());
} }
} }
......
...@@ -37,6 +37,8 @@ import java.math.BigDecimal; ...@@ -37,6 +37,8 @@ import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.util.Locale; 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.ExportedBean;
import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.Exported;
...@@ -81,6 +83,14 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito ...@@ -81,6 +83,14 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito
return path; 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. * Gets GB left.
*/ */
......
...@@ -29,7 +29,7 @@ THE SOFTWARE. ...@@ -29,7 +29,7 @@ THE SOFTWARE.
<td align="right" data="-1">N/A</td> <td align="right" data="-1">N/A</td>
</j:when> </j:when>
<j:otherwise> <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:otherwise>
</j:choose> </j:choose>
</j:jelly> </j:jelly>
\ No newline at end of file
...@@ -32,4 +32,4 @@ THE SOFTWARE. ...@@ -32,4 +32,4 @@ THE SOFTWARE.
<td align="right" data="${from.toMB(data)}"><j:out value="${from.toHtml(data)}"/></td> <td align="right" data="${from.toMB(data)}"><j:out value="${from.toHtml(data)}"/></td>
</j:otherwise> </j:otherwise>
</j:choose> </j:choose>
</j:jelly> </j:jelly>
\ No newline at end of file
...@@ -29,7 +29,7 @@ THE SOFTWARE. ...@@ -29,7 +29,7 @@ THE SOFTWARE.
<td align="right" data="-1">N/A</td> <td align="right" data="-1">N/A</td>
</j:when> </j:when>
<j:otherwise> <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:otherwise>
</j:choose> </j:choose>
</j:jelly> </j:jelly>
\ No newline at end of file
...@@ -176,7 +176,7 @@ THE SOFTWARE. ...@@ -176,7 +176,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>org.jenkins-ci.main</groupId> <groupId>org.jenkins-ci.main</groupId>
<artifactId>remoting</artifactId> <artifactId>remoting</artifactId>
<version>2.50</version> <version>2.52</version>
</dependency> </dependency>
<dependency> <dependency>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册