commit 01857edf0faa4c8fc7009640d8a4f6ca11ba6682
Merge: 9f8f740 421ab83
Author: Klaus Aehlig <[email protected]>
Date:   Wed Oct 15 15:44:09 2014 +0200

    Merge branch 'stable-2.10' into stable-2.11
    
    * stable-2.10
      Check the return value of query in ConnectToInstanceConsole
    
    Conflicts:
        lib/client/gnt_instance.py
    Resolution:
        follow the switch to query socket
    
    Signed-off-by: Klaus Aehlig <[email protected]>

diff --cc lib/client/gnt_instance.py
index c0ed7a0,176d032..8edc4f0
--- a/lib/client/gnt_instance.py
+++ b/lib/client/gnt_instance.py
@@@ -862,19 -849,19 +862,22 @@@ def ConnectToInstanceConsole(opts, args
    instance_name = args[0]
  
    cl = GetClient()
 +  qcl = GetClient(query=True)
    try:
      cluster_name = cl.QueryConfigValues(["cluster_name"])[0]
-     ((console_data, oper_state), ) = \
-       qcl.QueryInstances([instance_name], ["console", "oper_state"], False)
 -    idata = cl.QueryInstances([instance_name], ["console", "oper_state"], 
False)
++    idata = qcl.QueryInstances([instance_name], ["console", "oper_state"], 
False)
+     if not idata:
+       raise errors.OpPrereqError("Instance '%s' does not exist" % 
instance_name,
+                                  errors.ECODE_NOENT)
    finally:
      # Ensure client connection is closed while external commands are run
      cl.Close()
 +    qcl.Close()
  
    del cl
 +  del qcl
  
+   ((console_data, oper_state), ) = idata
    if not console_data:
      if oper_state:
        # Instance is running


-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores

Reply via email to