]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: Don't overwrite virAuthGet{Username|Password} errors
authorJohn Ferlan <jferlan@redhat.com>
Tue, 14 Aug 2018 16:31:52 +0000 (12:31 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 15 Aug 2018 19:42:17 +0000 (15:42 -0400)
Now that the virAuthGet*Path API's generate all the error messages
we can remove them from the callers. This means that we will no
longer overwrite the error from the API.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
src/hyperv/hyperv_driver.c

index 7ca145aef5c92cff3c8181572289a9bdee1f400f..f41cd1c939f7d3deba6f5f383d88278cb18127b3 100644 (file)
@@ -152,21 +152,15 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
         if (VIR_STRDUP(username, conn->uri->user) < 0)
             goto cleanup;
     } else {
-        username = virAuthGetUsername(conn, auth, "hyperv", "administrator", conn->uri->server);
-
-        if (username == NULL) {
-            virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Username request failed"));
+        if (!(username = virAuthGetUsername(conn, auth, "hyperv",
+                                            "administrator",
+                                            conn->uri->server)))
             goto cleanup;
-        }
     }
 
-    password = virAuthGetPassword(conn, auth, "hyperv", username, conn->uri->server);
-
-    if (password == NULL) {
-        virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed"));
+    if (!(password = virAuthGetPassword(conn, auth, "hyperv", username,
+                                        conn->uri->server)))
         goto cleanup;
-    }
-
 
     if (hypervInitConnection(conn, priv, username, password) < 0)
         goto cleanup;