cmdlib: Adding annotation helper for special cases
authorRené Nussbaumer <rn@google.com>
Tue, 8 May 2012 08:10:35 +0000 (10:10 +0200)
committerRené Nussbaumer <rn@google.com>
Thu, 10 May 2012 11:30:41 +0000 (13:30 +0200)
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/cmdlib.py

index b672fdd..e368f5b 100644 (file)
@@ -599,6 +599,21 @@ def _MakeLegacyNodeInfo(data):
     })
 
 
+def _AnnotateDiskParams(instance, devs, cfg):
+  """Little helper wrapper to the rpc annotation method.
+
+  @param instance: The instance object
+  @type devs: List of L{objects.Disk}
+  @param devs: The root devices (not any of its children!)
+  @param cfg: The config object
+  @returns The annotated disk copies
+  @see L{rpc.AnnotateDiskParams}
+
+  """
+  return rpc.AnnotateDiskParams(instance.disk_template, devs,
+                                cfg.GetInstanceDiskParams(instance))
+
+
 def _CheckInstancesNodeGroups(cfg, instances, owned_groups, owned_nodes,
                               cur_group_uuid):
   """Checks if node groups for locked instances are still correct.