Merge branch 'stable-2.8' into stable-2.9
[ganeti-local] / lib / rapi / rlib2.py
index c7596c9..d8d9b8c 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -71,20 +71,21 @@ _COMMON_FIELDS = ["ctime", "mtime", "uuid", "serial_no", "tags"]
 I_FIELDS = ["name", "admin_state", "os",
             "pnode", "snodes",
             "disk_template",
-            "nic.ips", "nic.macs", "nic.modes",
-            "nic.links", "nic.networks", "nic.bridges",
+            "nic.ips", "nic.macs", "nic.modes", "nic.uuids", "nic.names",
+            "nic.links", "nic.networks", "nic.networks.names", "nic.bridges",
             "network_port",
-            "disk.sizes", "disk_usage",
+            "disk.sizes", "disk.spindles", "disk_usage", "disk.uuids",
+            "disk.names",
             "beparams", "hvparams",
             "oper_state", "oper_ram", "oper_vcpus", "status",
             "custom_hvparams", "custom_beparams", "custom_nicparams",
             ] + _COMMON_FIELDS
 
 N_FIELDS = ["name", "offline", "master_candidate", "drained",
-            "dtotal", "dfree",
+            "dtotal", "dfree", "sptotal", "spfree",
             "mtotal", "mnode", "mfree",
             "pinst_cnt", "sinst_cnt",
-            "ctotal", "cnodes", "csockets",
+            "ctotal", "cnos", "cnodes", "csockets",
             "pip", "sip", "role",
             "pinst_list", "sinst_list",
             "master_capable", "vm_capable",
@@ -94,11 +95,11 @@ N_FIELDS = ["name", "offline", "master_candidate", "drained",
 
 NET_FIELDS = ["name", "network", "gateway",
               "network6", "gateway6",
-              "mac_prefix", "network_type",
+              "mac_prefix",
               "free_count", "reserved_count",
               "map", "group_list", "inst_list",
-              "external_reservations", "tags",
-              ]
+              "external_reservations",
+              ] + _COMMON_FIELDS
 
 G_FIELDS = [
   "alloc_policy",
@@ -155,7 +156,7 @@ _NODE_MIGRATE_REQV1 = "node-migrate-reqv1"
 # Feature string for node evacuation with LU-generated jobs
 _NODE_EVAC_RES1 = "node-evac-res1"
 
-ALL_FEATURES = frozenset([
+ALL_FEATURES = compat.UniqueFrozenset([
   _INST_CREATE_REQV1,
   _INST_REINSTALL_REQV1,
   _NODE_MIGRATE_REQV1,
@@ -167,7 +168,7 @@ _WFJC_TIMEOUT = 10
 
 
 # FIXME: For compatibility we update the beparams/memory field. Needs to be
-#        removed in Ganeti 2.7
+#        removed in Ganeti 2.8
 def _UpdateBeparams(inst):
   """Updates the beparams dict of inst to support the memory field.
 
@@ -675,7 +676,7 @@ class R_2_networks(baserlib.OpcodeResource):
     """Returns a list of all networks.
 
     """
-    client = self.GetClient()
+    client = self.GetClient(query=True)
 
     if self.useBulk():
       bulkdata = client.QueryNetworks([], NET_FIELDS, False)
@@ -698,7 +699,7 @@ class R_2_networks_name(baserlib.OpcodeResource):
 
     """
     network_name = self.items[0]
-    client = self.GetClient()
+    client = self.GetClient(query=True)
 
     result = baserlib.HandleItemQueryErrors(client.QueryNetworks,
                                             names=[network_name],