Remove bridge and default_bridge from objects
authorGuido Trotter <ultrotter@google.com>
Tue, 9 Jun 2009 12:29:40 +0000 (13:29 +0100)
committerGuido Trotter <ultrotter@google.com>
Mon, 15 Jun 2009 10:52:12 +0000 (11:52 +0100)
These values are deprecated, and not used in 2.1 anymore.
The slots are still there to allow auto-upgrading from 2.0.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/objects.py

index 51ef992..cde0779 100644 (file)
@@ -339,6 +339,10 @@ class NIC(ConfigObject):
       if self.bridge is not None:
         self.nicparams[constants.NIC_MODE] = constants.NIC_MODE_BRIDGED
         self.nicparams[constants.NIC_LINK] = self.bridge
+    # bridge is no longer used it 2.1. The slot is left there to support
+    # upgrading, but will be removed in 2.2
+    if self.bridge is not None:
+      self.bridge = None
 
 
 class Disk(ConfigObject):
@@ -822,6 +826,11 @@ class Cluster(TaggableObject):
     if self.modify_etc_hosts is None:
       self.modify_etc_hosts = True
 
+    # default_bridge is no longer used it 2.1. The slot is left there to
+    # support auto-upgrading, but will be removed in 2.2
+    if self.default_bridge is not None:
+      self.default_bridge = None
+
   def ToDict(self):
     """Custom function for cluster.