Revision 5018a335 lib/cmdlib.py

b/lib/cmdlib.py
2609 2609
      "admin_state", "admin_ram",
2610 2610
      "disk_template", "ip", "mac", "bridge",
2611 2611
      "sda_size", "sdb_size", "vcpus", "tags",
2612
      "network_port", "kernel_path", "initrd_path",
2613
      "hvm_boot_order", "hvm_acpi", "hvm_pae",
2614
      "hvm_cdrom_image_path", "hvm_nic_type",
2615
      "hvm_disk_type", "vnc_bind_address",
2616
      "serial_no", "hypervisor",
2617
      ])
2612
      "network_port",
2613
      "serial_no", "hypervisor", "hvparams",
2614
      ] + ["hv/%s" % name for name in constants.HVS_PARAMETERS])
2618 2615
    _CheckOutputFields(static=self.static_fields,
2619 2616
                       dynamic=self.dynamic_fields,
2620 2617
                       selected=self.op.output_fields)
......
2683 2680

  
2684 2681
    # end data gathering
2685 2682

  
2683
    HVPREFIX = "hv/"
2686 2684
    output = []
2687 2685
    for instance in instance_list:
2688 2686
      iout = []
2687
      i_hv = self.cfg.GetClusterInfo().FillHV(instance)
2689 2688
      for field in self.op.output_fields:
2690 2689
        if field == "name":
2691 2690
          val = instance.name
......
2746 2745
          val = list(instance.GetTags())
2747 2746
        elif field == "serial_no":
2748 2747
          val = instance.serial_no
2749
        elif field in ("network_port", "kernel_path", "initrd_path",
2750
                       "hvm_boot_order", "hvm_acpi", "hvm_pae",
2751
                       "hvm_cdrom_image_path", "hvm_nic_type",
2752
                       "hvm_disk_type", "vnc_bind_address"):
2753
          val = getattr(instance, field, None)
2754
          if val is not None:
2755
            pass
2756
          elif field in ("hvm_nic_type", "hvm_disk_type",
2757
                         "kernel_path", "initrd_path"):
2758
            val = "default"
2759
          else:
2760
            val = "-"
2748
        elif field == "network_port":
2749
          val = instance.network_port
2750
        elif (field.startswith(HVPREFIX) and
2751
              field[len(HVPREFIX):] in constants.HVS_PARAMETERS):
2752
          val = i_hv.get(field[len(HVPREFIX):], None)
2753
        elif field == "hvparams":
2754
          val = i_hv
2761 2755
        elif field == "hypervisor":
2762 2756
          val = instance.hypervisor
2763 2757
        else:

Also available in: Unified diff