提交 4914494e 编写于 作者: E Erik Skultety

virt-admin: Fix the error when an invalid URI has been provided

After commit 9d479dd1 fiddled with the cmdConnect's output which used to be a
bit more verbose prior to the mentioned commit, the program flow would result
in a quite confusing error if an invalid URI has been provided:

    error: Failed to connect to the admin server
    Connected to the admin server
    error: <some error>

The problem is that the commit mentioned above relied on the fact that
connect routine always succeeds which is not true.
Signed-off-by: NErik Skultety <eskultet@redhat.com>
上级 300f668c
......@@ -351,7 +351,7 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
}
vshAdmReconnect(ctl);
if (!connected)
if (!connected && priv->conn)
vshPrint(ctl, "%s\n", _("Connected to the admin server"));
return !!priv->conn;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册