[Pkg-libvirt-commits] [libguestfs] 32/40: v2v: esx: Clarify that username can be specified in vpx:// URI (RHBZ#1141113).

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:44:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.44-1
in repository libguestfs.

commit 7bd7dabbd71583737e8d48536bb742be03988102
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Sep 12 22:06:06 2014 +0100

    v2v: esx: Clarify that username can be specified in vpx:// URI (RHBZ#1141113).
    
    If there is an authentication error when getting the session cookie,
    emphasize in the error message that the username can be specified in
    the URI.
    
    Unfortunately libvirt asks for the username previously, but we cannot
    access that.
---
 v2v/lib_esx.ml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/v2v/lib_esx.ml b/v2v/lib_esx.ml
index dde2b79..adee5c3 100644
--- a/v2v/lib_esx.ml
+++ b/v2v/lib_esx.ml
@@ -77,7 +77,7 @@ let rec map_path_to_uri verbose uri scheme server path format =
         string_find query "no_verify=1" = -1 in
 
     (* Now we have to query the server to get the session cookie. *)
-    let session_cookie = get_session_cookie verbose uri sslverify url in
+    let session_cookie = get_session_cookie verbose scheme uri sslverify url in
 
     (* Construct the JSON parameters. *)
     let json_params = [
@@ -132,7 +132,7 @@ and get_datacenter uri scheme =
   | _ ->                            (* Don't know, so guess. *)
     default_dc
 
-and get_session_cookie verbose uri sslverify url =
+and get_session_cookie verbose scheme uri sslverify url =
   (* Memoize the session cookie. *)
   if !session_cookie <> "" then
     Some !session_cookie
@@ -168,7 +168,11 @@ and get_session_cookie verbose uri sslverify url =
 
     if status = "401" then (
       dump_response stderr;
-      error (f_"esx: incorrect username or password")
+      if uri.uri_user <> None then
+        error (f_"esx: incorrect username or password")
+      else
+        error (f_"esx: incorrect username or password.  You might need to specify the username in the URI like this: %s://USERNAME@[etc]")
+          scheme
     );
 
     if status = "404" then (

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list