LGTM

On Tue, Aug 18, 2015, 7:27 PM 'Hrvoje Ribicic' via ganeti-devel <
[email protected]> wrote:

> As a result of an additional bit of code introduced by patch fa3c0df5,
> queries for instance disks sent to the configuration daemon required
> additional information about the instance. This information was fetched
> through a manual search of the list of instances, rather than the
> function capable of searching by name or by uuid.
>
> This made the burnin tool used by our tests fail when inquiring for
> information and broke QA, and this patch fixes the problem.
>
> Signed-off-by: Hrvoje Ribicic <[email protected]>
> ---
>  src/Ganeti/Confd/Server.hs | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/src/Ganeti/Confd/Server.hs b/src/Ganeti/Confd/Server.hs
> index 7af7f0a..b7edb34 100644
> --- a/src/Ganeti/Confd/Server.hs
> +++ b/src/Ganeti/Confd/Server.hs
> @@ -242,13 +242,15 @@ buildResponse cdata req@(ConfdRequest { confdRqType
> = ReqNodeInstances }) = do
>  -- | Return the list of disks for an instance given the instance uuid.
>  buildResponse cdata req@(ConfdRequest { confdRqType = ReqInstanceDisks
> }) = do
>    let cfg = fst cdata
> -  inst_uuid <-
> +  inst_name <-
>      case confdRqQuery req of
>        PlainQuery str -> return str
>        _ -> fail $ "Invalid query type " ++ show (confdRqQuery req)
> -  inst <- lookupContainer (Bad $ "unknown instance: " ++ inst_uuid)
> -            inst_uuid $ configInstances cfg
> -  case getInstDisks cfg inst_uuid of
> +  inst <-
> +    case getInstance cfg inst_name of
> +      Ok i -> return i
> +      Bad e -> fail $ "Instance not found in the configuration: " ++ show
> e
> +  case getInstDisks cfg . instUuid $ inst of
>      Ok disks -> return (ReplyStatusOk, J.showJSON disks, instSerial inst)
>      Bad e -> fail $ "Could not retrieve disks: " ++ show e
>
> --
> 2.5.0.276.gf5e568e
>
> --

Helga Velroyen
Software Engineer
[email protected]

Google Germany GmbH
Dienerstraße 12
80331 München

Geschäftsführer: Graham Law, Christine Elizabeth Flores
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.

Reply via email to