(grnet) Remove deprecated physical_id if found
authorDimitris Aragiorgis <dimara@grnet.gr>
Thu, 8 May 2014 07:58:05 +0000 (10:58 +0300)
committerDimitris Aragiorgis <dimara@grnet.gr>
Thu, 29 May 2014 11:08:07 +0000 (14:08 +0300)
In 2.8 disks have been added to runtime files for hotplug support.
Back then physical_id slot existed. Remove this slot in the early
stage of Disk.FromDict() otherwise an exception will be raised.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

lib/objects.py

index 815506c..a3fe466 100644 (file)
@@ -769,6 +769,8 @@ class Disk(ConfigObject):
     """Custom function for Disks
 
     """
+    if "physical_id" in val:
+      del val["physical_id"]
     obj = super(Disk, cls).FromDict(val)
     if obj.children:
       obj.children = outils.ContainerFromDicts(obj.children, list, Disk)