[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-API] [PATCH] CA-30393: block extauth-enable if there are duplicate hostnames in the pool


  • To: Marcus Granado <Marcus.Granado@xxxxxxxxxxxxx>, xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
  • Date: Thu, 3 Dec 2009 22:00:20 +0000
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc:
  • Delivery-date: Thu, 03 Dec 2009 14:00:36 -0800
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
  • Thread-index: Acp0RJtI76o08qwTTM+8Qz4ULUqNVwAHwpcw
  • Thread-topic: [Xen-API] [PATCH] CA-30393: block extauth-enable if there are duplicate hostnames in the pool

Thanks for this one, Marcus. One minor request: could you add an extra sentence 
to the commit comment explaining what (roughly) goes wrong when you have 
duplicate hostnames + AD?

Thanks,
Dave

> -----Original Message-----
> From: xen-api-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-api-
> bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Marcus Granado
> Sent: 03 December 2009 18:14
> To: xen-api
> Subject: [Xen-API] [PATCH] CA-30393: block extauth-enable if there are
> duplicate hostnames in the pool
> 
> 1 file changed, 14 insertions(+)
> ocaml/xapi/xapi_pool.ml |   14 ++++++++++++++
> 
> 
> # HG changeset patch
> # User Marcus Granado <marcus.granado@xxxxxxxxxx> # Date 1259863960 0 #
> Node ID f9617197a99bc47e7bf4f12df6a6fe15dc990aa5
> # Parent  8335acd2219af19c6345d349690679dac2f5953a
> CA-30393: block extauth-enable if there are duplicate hostnames in the
> pool
> 
> Signed-off-by: Marcus Granado <marcus.granado@xxxxxxxxxxxxx>
> 
> diff -r 8335acd2219a -r f9617197a99b ocaml/xapi/xapi_pool.ml
> --- a/ocaml/xapi/xapi_pool.ml Thu Dec 03 15:33:34 2009 +0000
> +++ b/ocaml/xapi/xapi_pool.ml Thu Dec 03 18:12:40 2009 +0000
> @@ -1066,6 +1066,20 @@
>               end
>       with Not_found -> () (* that's expected, no host had
> external_auth enabled*)
>       ;
> +     (* 1b. assert that there are no duplicate hostnames in the pool *)
> +     if (List.length hosts)
> +             <>
> +             (List.length
> +                      (Listext.List.setify
> +                                     (List.map (fun h->Db.Host.get_hostname
> ~__context ~self:h) hosts))
> +             )
> +     then begin
> +             let errmsg = "At least two hosts in the pool have the same
> hostname" in
> +             debug "%s" errmsg;
> +             raise
> (Api_errors.Server_error(Api_errors.pool_auth_enable_failed,
> +                     [(Ref.string_of (List.hd hosts));errmsg]))
> +     end
> +     else
>       (* 2. tries to enable the external authentication in each host of
> the pool *)
>       let host_error_msg = ref ("","","") in
>       let rollback_list =

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.