Revision 41a776da lib/cmdlib.py

b/lib/cmdlib.py
2720 2720
                               "sda_size", "sdb_size", "vcpus", "tags",
2721 2721
                               "network_port", "beparams",
2722 2722
                               "(disk).(size)/([0-9]+)",
2723
                               "(disk).(sizes)",
2723 2724
                               "(nic).(mac|ip|bridge)/([0-9]+)",
2725
                               "(nic).(macs|ips|bridges)",
2724 2726
                               "(disk|nic).(count)",
2725 2727
                               "serial_no", "hypervisor", "hvparams",] +
2726 2728
                             ["hv/%s" % name
......
2885 2887
          if st_groups and st_groups[0] == "disk":
2886 2888
            if st_groups[1] == "count":
2887 2889
              val = len(instance.disks)
2890
            elif st_groups[1] == "sizes":
2891
              val = [disk.size for disk in instance.disks]
2888 2892
            elif st_groups[1] == "size":
2889 2893
              disk_idx = int(st_groups[2])
2890 2894
              if disk_idx >= len(instance.disks):
......
2896 2900
          elif st_groups[0] == "nic":
2897 2901
            if st_groups[1] == "count":
2898 2902
              val = len(instance.nics)
2903
            elif st_groups[1] == "macs":
2904
              val = [nic.mac for nic in instance.nics]
2905
            elif st_groups[1] == "ips":
2906
              val = [nic.ip for nic in instance.nics]
2907
            elif st_groups[1] == "bridges":
2908
              val = [nic.bridge for nic in instance.nics]
2899 2909
            else:
2900 2910
              # index-based item
2901 2911
              nic_idx = int(st_groups[2])

Also available in: Unified diff