Commit 3fb1e1c5 authored by Alexander Schreiber's avatar Alexander Schreiber
Browse files

merge r1568 from branches/ganeti/ganeti-1.2

Add more fields to gnt-instance list

Reviewed-by: imsnah
parent 6291574d
......@@ -2472,7 +2472,12 @@ class LUQueryInstances(NoHooksLU):
_CheckOutputFields(static=["name", "os", "pnode", "snodes",
"admin_state", "admin_ram",
"disk_template", "ip", "mac", "bridge",
"sda_size", "sdb_size", "vcpus", "tags"],
"sda_size", "sdb_size", "vcpus", "tags",
"auto_balance",
"network_port", "kernel_path", "initrd_path",
"hvm_boot_order", "hvm_acpi", "hvm_pae",
"hvm_cdrom_image_path", "hvm_nic_type",
"hvm_disk_type", "vnc_bind_address"],
dynamic=self.dynamic_fields,
selected=self.op.output_fields)
......@@ -2593,6 +2598,18 @@ class LUQueryInstances(NoHooksLU):
val = instance.vcpus
elif field == "tags":
val = list(instance.GetTags())
elif field in ("network_port", "kernel_path", "initrd_path",
"hvm_boot_order", "hvm_acpi", "hvm_pae",
"hvm_cdrom_image_path", "hvm_nic_type",
"hvm_disk_type", "vnc_bind_address"):
val = getattr(instance, field, None)
if val is not None:
pass
elif field in ("hvm_nic_type", "hvm_disk_type",
"kernel_path", "initrd_path"):
val = "default"
else:
val = "-"
else:
raise errors.ParameterError(field)
iout.append(val)
......
......@@ -184,10 +184,20 @@ def ListInstances(opts, args):
"snodes": "Secondary_Nodes", "admin_state": "Autostart",
"oper_state": "Running", "admin_ram": "Configured_memory",
"oper_ram": "Memory", "disk_template": "Disk_template",
"ip": "IP Address", "mac": "MAC Address",
"ip": "IP_address", "mac": "MAC_address",
"bridge": "Bridge", "vcpus": "VCPUs",
"sda_size": "Disk/0", "sdb_size": "Disk/1",
"status": "Status", "tags": "Tags",
"network_port": "Network_port",
"kernel_path": "Kernel_path",
"initrd_path": "Initrd_path",
"hvm_boot_order": "HVM_boot_order",
"hvm_acpi": "HVM_ACPI",
"hvm_pae": "HVM_PAE",
"hvm_cdrom_image_path": "HVM_CDROM_image_path",
"hvm_nic_type": "HVM_NIC_type",
"hvm_disk_type": "HVM_disk_type",
"vnc_bind_address": "VNC_bind_address",
}
else:
headers = None
......
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