Commit 929efcc3 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Gracefully handle queries for non-existing nodes

When adding a node, Ganeti checks whether the node is already
part of the cluster by querying for the node name. However,
as queries are meant to return all nodes with the given name,
it might well return the empty list when a new node is to be
added. Handle that case correctly.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarHrvoje Ribicic <>
parent fb8d8645
......@@ -253,7 +253,11 @@ def AddNode(opts, args):
fields=["name", "sip", "master",
node_exists, sip, is_master, ssh_port = output[0]
if len(output) == 0:
node_exists = ""
sip = None
node_exists, sip, is_master, ssh_port = output[0]
except (errors.OpPrereqError, errors.OpExecError):
node_exists = ""
sip = None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment