[PATCH 10/11] test: Don't overwrite virAuthGet{Username|Password} errors

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

 



Now that the virAuthGet*Path API's generate all the error messages
we can remove them from the callers.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/test/test_driver.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index dfca95c981..6697a7dfe6 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1374,12 +1374,9 @@ testConnectAuthenticate(virConnectPtr conn,
     /* Authentication is required because the test XML contains a
      * non-empty <auth/> section.  First we must ask for a username.
      */
-    username = virAuthGetUsername(conn, auth, "test", NULL, "localhost"/*?*/);
-    if (!username) {
-        virReportError(VIR_ERR_AUTH_FAILED, "%s",
-                       _("authentication failed when asking for username"));
+    if (!(username = virAuthGetUsername(conn, auth, "test", NULL,
+                                        "localhost"/*?*/)))
         goto cleanup;
-    }
 
     /* Does the username exist? */
     for (i = 0; i < privconn->numAuths; ++i) {
@@ -1391,13 +1388,9 @@ testConnectAuthenticate(virConnectPtr conn,
  found_user:
     /* Even if we didn't find the user, we still ask for a password. */
     if (i == -1 || privconn->auths[i].password != NULL) {
-        password = virAuthGetPassword(conn, auth, "test",
-                                      username, "localhost");
-        if (password == NULL) {
-            virReportError(VIR_ERR_AUTH_FAILED, "%s",
-                           _("authentication failed when asking for password"));
+        if (!(password = virAuthGetPassword(conn, auth, "test", username,
+                                            "localhost")))
             goto cleanup;
-        }
     }
 
     if (i == -1 ||
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux