Merge branch 'stable-2.9' into stable-2.10
authorHrvoje Ribicic <riba@google.com>
Mon, 30 Nov 2015 15:49:09 +0000 (16:49 +0100)
committerHrvoje Ribicic <riba@google.com>
Mon, 30 Nov 2015 16:11:13 +0000 (17:11 +0100)
* stable-2.9
  QA: Ensure the DRBD secret is not retrievable via RAPI
  Redact the DRBD secret in instance queries
  Do not attempt to use the DRBD secret in gnt-instance info

Conflicts:
  lib/cmdlib/instance_query.py - removed physical_id changes

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

1  2 
lib/client/gnt_instance.py
lib/cmdlib/instance_query.py
qa/ganeti-qa.py
qa/qa_rapi.py

Simple merge
@@@ -348,24 -341,24 +348,26 @@@ class LUInstanceQueryData(NoHooksLU)
  
      """
      drbd_info = None
+     output_logical_id = dev.logical_id
 -    output_physical_id = dev.physical_id
      if dev.dev_type in constants.DTS_DRBD:
        # we change the snode then (otherwise we use the one passed in)
        if dev.logical_id[0] == instance.primary_node:
          snode_uuid = dev.logical_id[1]
 +        snode_minor = dev.logical_id[4]
 +        pnode_minor = dev.logical_id[3]
        else:
          snode_uuid = dev.logical_id[0]
 +        snode_minor = dev.logical_id[3]
 +        pnode_minor = dev.logical_id[4]
        drbd_info = {
          "primary_node": node_uuid2name_fn(instance.primary_node),
 -        "primary_minor": dev.logical_id[3],
 +        "primary_minor": pnode_minor,
          "secondary_node": node_uuid2name_fn(snode_uuid),
 -        "secondary_minor": dev.logical_id[4],
 +        "secondary_minor": snode_minor,
          "port": dev.logical_id[2],
-         "secret": dev.logical_id[5],
        }
+       # replace the secret present at the end of the ids with None
+       output_logical_id = dev.logical_id[:-1] + (None,)
 -      output_physical_id = dev.physical_id[:-1] + (None,)
  
      dev_pstatus = self._ComputeBlockdevStatus(instance.primary_node,
                                                instance, dev)
      return {
        "iv_name": dev.iv_name,
        "dev_type": dev.dev_type,
-       "logical_id": dev.logical_id,
+       "logical_id": output_logical_id,
        "drbd_info": drbd_info,
 -      "physical_id": output_physical_id,
        "pstatus": dev_pstatus,
        "sstatus": dev_sstatus,
        "children": dev_children,
diff --cc qa/ganeti-qa.py
Simple merge
diff --cc qa/qa_rapi.py
Simple merge