diff options
| -rw-r--r-- | bitbake/lib/bb/monitordisk.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py index dff57ad878..d3d2106841 100644 --- a/bitbake/lib/bb/monitordisk.py +++ b/bitbake/lib/bb/monitordisk.py | |||
| @@ -129,7 +129,7 @@ def getDiskData(BBDirs, configuration): | |||
| 129 | bb.utils.mkdirhier(path) | 129 | bb.utils.mkdirhier(path) |
| 130 | dev = getMountedDev(path) | 130 | dev = getMountedDev(path) |
| 131 | # Use path/action as the key | 131 | # Use path/action as the key |
| 132 | devDict[os.path.join(path, action)] = [dev, minSpace, minInode] | 132 | devDict[(path, action)] = [dev, minSpace, minInode] |
| 133 | 133 | ||
| 134 | return devDict | 134 | return devDict |
| 135 | 135 | ||
| @@ -205,16 +205,13 @@ class diskMonitor: | |||
| 205 | """ Take action for the monitor """ | 205 | """ Take action for the monitor """ |
| 206 | 206 | ||
| 207 | if self.enableMonitor: | 207 | if self.enableMonitor: |
| 208 | for k in self.devDict: | 208 | for k, attributes in self.devDict.items(): |
| 209 | path = os.path.dirname(k) | 209 | path, action = k |
| 210 | action = os.path.basename(k) | 210 | dev, minSpace, minInode = attributes |
| 211 | dev = self.devDict[k][0] | ||
| 212 | minSpace = self.devDict[k][1] | ||
| 213 | minInode = self.devDict[k][2] | ||
| 214 | 211 | ||
| 215 | st = os.statvfs(path) | 212 | st = os.statvfs(path) |
| 216 | 213 | ||
| 217 | # The free space, float point number | 214 | # The available free space, integer number |
| 218 | freeSpace = st.f_bavail * st.f_frsize | 215 | freeSpace = st.f_bavail * st.f_frsize |
| 219 | 216 | ||
| 220 | if minSpace and freeSpace < minSpace: | 217 | if minSpace and freeSpace < minSpace: |
| @@ -235,7 +232,7 @@ class diskMonitor: | |||
| 235 | rq.finish_runqueue(True) | 232 | rq.finish_runqueue(True) |
| 236 | bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration) | 233 | bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration) |
| 237 | 234 | ||
| 238 | # The free inodes, float point number | 235 | # The free inodes, integer number |
| 239 | freeInode = st.f_favail | 236 | freeInode = st.f_favail |
| 240 | 237 | ||
| 241 | if minInode and freeInode < minInode: | 238 | if minInode and freeInode < minInode: |
