Comment #6 on issue 928 by [email protected]: harep breaks when using (solely) extstorage
https://code.google.com/p/ganeti/issues/detail?id=928

pushed to stable-2.10

commit b9c2b59acb5575eab44ac969e38bec2610a44499
Author: Klaus Aehlig <[email protected]>
Date:   Tue Jun 16 11:15:48 2015 +0200

    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: Klaus Aehlig <[email protected]>
    Reviewed-by: Petr Pudlak <[email protected]>

    Cherry-picked-from: 49644203
    Signed-off-by: Klaus Aehlig <[email protected]>
    Reviewed-by: Hrvoje Ribicic <[email protected]>

diff --git a/src/Ganeti/HTools/Backend/Luxi.hs b/src/Ganeti/HTools/Backend/Luxi.hs
index a6fd582..771fcc5 100644
--- a/src/Ganeti/HTools/Backend/Luxi.hs
+++ b/src/Ganeti/HTools/Backend/Luxi.hs
@@ -236,8 +236,12 @@ parseNode ktg [ name, mtotal, mnode, mfree, dtotal, dfree
   xmtotal <- lvconvert 0.0 "mtotal" mtotal
   xmnode <- lvconvert 0 "mnode" mnode
   xmfree <- lvconvert 0 "mfree" mfree
-  xdtotal <- lvconvert 0.0 "dtotal" dtotal
-  xdfree <- lvconvert 0 "dfree" dfree
+  let xdtotal = genericResult (const 0.0) id
+                  $ 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
   xcnos <- lvconvert 0 "cnos" cnos
   let node = flip Node.setNodeTags xtags $


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

Reply via email to