提交 f5f77bf2 编写于 作者: E Eric Dalquist 提交者: Kohsuke Kawaguchi

[FIXED JENKINS-13826] Include file system path in error

Include the file system path that was checked in the low disk space
error message
上级 fa68f242
......@@ -57,6 +57,9 @@ Upcoming changes</a>
<ul class=image>
<li class=bug>
Fixed a possible race condition
<li class=rfe>
Improve the low disk space warning message.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13826">issue 13826</a>)
<li class=rfe>
Matrix custom workspace support is improved to allow configuration builds to share workspace
<li class=rfe>
......
......@@ -52,12 +52,25 @@ import org.kohsuke.stapler.export.Exported;
*/
@ExportedBean
public static final class DiskSpace extends OfflineCause implements Serializable {
private final String path;
@Exported
public final long size;
private boolean triggered;
/**
* @deprecated as of 1.467
*/
public DiskSpace(long size) {
this(".",size);
}
/**
* @param path
* Specify the file path that was monitored.
*/
public DiskSpace(String path, long size) {
this.path = path;
this.size = size;
}
......@@ -65,6 +78,14 @@ import org.kohsuke.stapler.export.Exported;
public String toString() {
return String.valueOf(size);
}
/**
* The path that was checked
*/
@Exported
public String getPath() {
return path;
}
/**
* Gets GB left.
......@@ -125,7 +146,7 @@ import org.kohsuke.stapler.export.Exported;
}
}
return new DiskSpace((long)(Double.parseDouble(size.trim())*multiplier));
return new DiskSpace("", (long)(Double.parseDouble(size.trim())*multiplier));
}
private static final long serialVersionUID = 2L;
......@@ -146,7 +167,7 @@ import org.kohsuke.stapler.export.Exported;
try {
long s = f.getUsableSpace();
if(s<=0) return null;
return new DiskSpace(s);
return new DiskSpace(f.getCanonicalPath(), s);
} catch (LinkageError e) {
// pre-mustang
return null;
......
......@@ -89,7 +89,7 @@ public class TemporarySpaceMonitor extends AbstractDiskSpaceMonitor {
f = new File(System.getProperty("java.io.tmpdir"));
long s = f.getUsableSpace();
if(s<=0) return null;
return new DiskSpace(s);
return new DiskSpace(f.getCanonicalPath(), s);
} catch (LinkageError e) {
// pre-mustang
return null;
......
......@@ -24,5 +24,5 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<p class="error">${%blurb(it.gbLeft)}</p>
<p class="error">${%blurb(it.gbLeft, it.path)}</p>
</j:jelly>
......@@ -19,4 +19,4 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=Disk space is too low. Only {0}GB left.
\ No newline at end of file
blurb=Disk space is too low. Only {0}GB left on {1}.
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册