Merge remote branch 'google/stable-2.6' into stable-2.6-ippool-hotplug-esi
[ganeti-local] / lib / rpc.py
index 3164e5d..aad6905 100644 (file)
@@ -662,7 +662,7 @@ class RpcRunner(_RpcClientBase,
     encoders.update({
       # Encoders requiring configuration object
       rpc_defs.ED_INST_DICT: self._InstDict,
-      rpc_defs.ED_INST_DICT_HVP_BEP: self._InstDictHvpBep,
+      rpc_defs.ED_INST_DICT_HVP_BEP_DP: self._InstDictHvpBepDp,
       rpc_defs.ED_INST_DICT_OSP_DP: self._InstDictOspDp,
       rpc_defs.ED_NIC_DICT: self._NicDict,
 
@@ -742,9 +742,10 @@ class RpcRunner(_RpcClientBase,
         if net_uuid:
           nobj = self._cfg.GetNetwork(net_uuid)
           nic["netinfo"] = objects.Network.ToDict(nobj)
+    idict["disks"] = self._DisksDictDP((instance.disks, instance))
     return idict
 
-  def _InstDictHvpBep(self, (instance, hvp, bep)):
+  def _InstDictHvpBepDp(self, (instance, hvp, bep)):
     """Wrapper for L{_InstDict}.
 
     """
@@ -754,9 +755,7 @@ class RpcRunner(_RpcClientBase,
     """Wrapper for L{_InstDict}.
 
     """
-    updated_inst = self._InstDict(instance, osp=osparams)
-    updated_inst["disks"] = self._DisksDictDP((instance.disks, instance))
-    return updated_inst
+    return self._InstDict(instance, osp=osparams)
 
   def _DisksDictDP(self, (disks, instance)):
     """Wrapper for L{AnnotateDiskParams}.