summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/monitordisk.py
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2012-04-05 20:58:57 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-11 00:04:40 +0100
commit0d5e808777cfe007d879e3b31a3e6f2e533f104c (patch)
tree215c4fd47e02897e5775a2b8e943eb73e8c36510 /bitbake/lib/bb/monitordisk.py
parentc0a812c22272887390e44734fb426fd47c05e346 (diff)
downloadopenembedded-core-contrib-0d5e808777cfe007d879e3b31a3e6f2e533f104c.tar.gz
diskspace monitor: assign a default value when only of the interval is set
Assign a default value to the other one when either disk space interval or amount of inodes interval value is set for example: BB_DISKMON_WARNINTERVAL = "50M," or BB_DISKMON_WARNINTERVAL = ",5K" The diskspace monitor would not enable in the past, that seemed unreasonable, assign a default value to the other one currently, so the monitor will be enabled, and will warn both of diskspace and free amount of inode if they have been set in BB_DISKMON_DIRS. (Bitbake rev: 09592c119550550edcc59c871f754536d5b7bf65) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/monitordisk.py')
-rw-r--r--bitbake/lib/bb/monitordisk.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py
index 9baba5e73b..946919396b 100644
--- a/bitbake/lib/bb/monitordisk.py
+++ b/bitbake/lib/bb/monitordisk.py
@@ -136,10 +136,13 @@ def getInterval(configuration):
""" Get the disk space interval """
+ # The default value is 50M and 5K.
+ spaceDefault = 50 * 1024 * 1024
+ inodeDefault = 5 * 1024
+
interval = configuration.getVar("BB_DISKMON_WARNINTERVAL", True)
if not interval:
- # The default value is 50M and 5K.
- return 50 * 1024 * 1024, 5 * 1024
+ return spaceDefault, inodeDefault
else:
# The disk space or inode interval is optional, but it should
# have a correct value once it is specified
@@ -151,12 +154,16 @@ def getInterval(configuration):
if not intervalSpace:
printErr("Invalid disk space interval value in BB_DISKMON_WARNINTERVAL: %s" % intervalRe.group(1))
return None, None
+ else:
+ intervalSpace = spaceDefault
intervalInode = intervalRe.group(2)
if intervalInode:
intervalInode = convertGMK(intervalInode)
if not intervalInode:
printErr("Invalid disk inode interval value in BB_DISKMON_WARNINTERVAL: %s" % intervalRe.group(2))
return None, None
+ else:
+ intervalInode = inodeDefault
return intervalSpace, intervalInode
else:
printErr("Invalid interval value in BB_DISKMON_WARNINTERVAL: %s" % interval)