LGTM, thanks. On Thu, Oct 22, 2015 at 4:07 PM, 'Klaus Aehlig' via ganeti-devel < [email protected]> wrote:
> 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]> > --- > src/Ganeti/HTools/Backend/Luxi.hs | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > 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 $ > -- > 2.6.0.rc2.230.g3dd15c0 > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
