Ensure that disk.params is always defined (and a dict)
authorIustin Pop <iustin@google.com>
Wed, 18 Jul 2012 12:18:12 +0000 (14:18 +0200)
committerIustin Pop <iustin@google.com>
Wed, 18 Jul 2012 12:47:49 +0000 (14:47 +0200)
Commit cce46164 fixed upgrading from other 2.6 versions, but
accidentally broke upgrading from 2.5 (disk.params was left as None,
which breaks FillDict). The simplest way to handle params is to always
set them to an empty dict (disregarding what they currently contain).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>

lib/objects.py

index 2c74e9c..40c76ae 100644 (file)
@@ -845,8 +845,7 @@ class Disk(ConfigObject):
         child.UpgradeConfig()
 
     # FIXME: Make this configurable in Ganeti 2.7
-    if self.params:
-      self.params = {}
+    self.params = {}
     # add here config upgrade for this disk
 
   @staticmethod