Revision f965260c lib/client/gnt_instance.py

b/lib/client/gnt_instance.py
985 985
  return data
986 986

  
987 987

  
988
def _FormatBlockDevInfo(idx, top_level, dev, static, roman):
988
def _FormatBlockDevInfo(idx, top_level, dev, roman):
989 989
  """Show block device information.
990 990

  
991 991
  This is only used by L{ShowInstanceConfig}, but it's too big to be
......
997 997
  @param top_level: if this a top-level disk?
998 998
  @type dev: dict
999 999
  @param dev: dictionary with disk information
1000
  @type static: boolean
1001
  @param static: wheter the device information doesn't contain
1002
      runtime information but only static data
1003 1000
  @type roman: boolean
1004 1001
  @param roman: whether to try to use roman integers
1005 1002
  @return: a list of either strings, tuples or lists
......
1087 1084
  elif dev["physical_id"] is not None:
1088 1085
    data.append("physical_id:")
1089 1086
    data.append([dev["physical_id"]])
1090
  if not static:
1087

  
1088
  if dev["pstatus"]:
1091 1089
    data.append(("on primary", helper(dev["dev_type"], dev["pstatus"])))
1092
  if dev["sstatus"] and not static:
1090

  
1091
  if dev["sstatus"]:
1093 1092
    data.append(("on secondary", helper(dev["dev_type"], dev["sstatus"])))
1094 1093

  
1095 1094
  if dev["children"]:
1096 1095
    data.append("child devices:")
1097 1096
    for c_idx, child in enumerate(dev["children"]):
1098
      data.append(_FormatBlockDevInfo(c_idx, False, child, static, roman))
1097
      data.append(_FormatBlockDevInfo(c_idx, False, child, roman))
1099 1098
  d1.append(data)
1100 1099
  return d1
1101 1100

  
......
1169 1168
    buf.write("Creation time: %s\n" % utils.FormatTime(instance["ctime"]))
1170 1169
    buf.write("Modification time: %s\n" % utils.FormatTime(instance["mtime"]))
1171 1170
    buf.write("State: configured to be %s" % instance["config_state"])
1172
    if not opts.static:
1171
    if instance["run_state"]:
1173 1172
      buf.write(", actual state is %s" % instance["run_state"])
1174 1173
    buf.write("\n")
1175 1174
    ##buf.write("Considered for memory checks in cluster verify: %s\n" %
......
1223 1222
    buf.write("  Disks:\n")
1224 1223

  
1225 1224
    for idx, device in enumerate(instance["disks"]):
1226
      _FormatList(buf, _FormatBlockDevInfo(idx, True, device, opts.static,
1225
      _FormatList(buf, _FormatBlockDevInfo(idx, True, device,
1227 1226
                  opts.roman_integers), 2)
1228 1227

  
1229 1228
  ToStdout(buf.getvalue().rstrip('\n'))

Also available in: Unified diff