Commit d9a51679 authored by Michael Hanselmann's avatar Michael Hanselmann

gnt-*: Print better error message for uninitialized cluster

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 02141fb1
......@@ -1219,13 +1219,21 @@ def GetClient():
try:
client = luxi.Client()
except luxi.NoMasterError:
master, myself = ssconf.GetMasterAndMyself()
ss = ssconf.SimpleStore()
# Try to read ssconf file
try:
ss.GetMasterNode()
except errors.ConfigurationError:
raise errors.OpPrereqError("Cluster not initialized or this machine is"
" not part of a cluster")
master, myself = ssconf.GetMasterAndMyself(ss=ss)
if master != myself:
raise errors.OpPrereqError("This is not the master node, please connect"
" to node '%s' and rerun the command" %
master)
else:
raise
raise
return client
......
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