Skip to content
Snippets Groups Projects
Commit 7228ca91 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

gnt-group add: Fix diskparam fill


This was a pretty non-obvious bug. A cluster looks sane after
gnt-cluster init, however on a daemon restart the diskparameters had the
default filled in. The same applies to gnt-group add. This is due to the
nature that UpgradeConfig() from NodeGroups did just populate them with
defaults if something was set on it.

Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b3230b32
No related branches found
No related tags found
No related merge requests found
......@@ -13589,7 +13589,7 @@ class LUGroupAdd(LogicalUnit):
constants.DISK_DT_TYPES)
self.new_diskparams = self.op.diskparams
else:
self.new_diskparams = None
self.new_diskparams = {}
 
if self.op.ipolicy:
cluster = self.cfg.GetClusterInfo()
......
......@@ -1496,7 +1496,8 @@ class NodeGroup(TaggableObject):
if self.mtime is None:
self.mtime = time.time()
self.diskparams = UpgradeDiskParams(self.diskparams)
if self.diskparams is None:
self.diskparams = {}
if self.ipolicy is None:
self.ipolicy = MakeEmptyIPolicy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment