Commit 29c61371 authored by Klaus Aehlig's avatar Klaus Aehlig

Make htools tolerate missing "dtotal" and "dfree" on luxi

If a cluster allows sharedfile as only disk template, the amount of
total and free disk space might not be available. This is perfectly
normal, hence make the luxi backend handle it gracefully and just report
0 available disk on 0 total disk.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>

Cherry-picked-from: 49644203Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent 4ff1deda
...@@ -238,8 +238,12 @@ parseNode ktg [ name, mtotal, mnode, mfree, dtotal, dfree ...@@ -238,8 +238,12 @@ parseNode ktg [ name, mtotal, mnode, mfree, dtotal, dfree
xmtotal <- lvconvert 0.0 "mtotal" mtotal xmtotal <- lvconvert 0.0 "mtotal" mtotal
xmnode <- lvconvert 0 "mnode" mnode xmnode <- lvconvert 0 "mnode" mnode
xmfree <- lvconvert 0 "mfree" mfree xmfree <- lvconvert 0 "mfree" mfree
xdtotal <- lvconvert 0.0 "dtotal" dtotal let xdtotal = genericResult (const 0.0) id
xdfree <- lvconvert 0 "dfree" dfree $ lvconvert 0.0 "dtotal" dtotal
xdfree = genericResult (const 0) id
$ lvconvert 0 "dfree" dfree
-- "dtotal" and "dfree" might be missing, e.g., if sharedfile
-- is the only supported disk template
xctotal <- lvconvert 0.0 "ctotal" ctotal xctotal <- lvconvert 0.0 "ctotal" ctotal
xcnos <- lvconvert 0 "cnos" cnos xcnos <- lvconvert 0 "cnos" cnos
let node = flip Node.setCpuSpeed xcpu_speed . let node = flip Node.setCpuSpeed xcpu_speed .
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment