From: Thomas Thrainer Date: Wed, 31 Jul 2013 13:41:43 +0000 (+0200) Subject: Check disk template in right dict when copying X-Git-Tag: v2.8.0rc1~5 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/f06af3cabaed9032f74cb979f065d89c0a1c6f66 Check disk template in right dict when copying Due to the structure of the code this condition can't possibly be true. We have to look in the new_diskparams dict instead, otherwise it'd be possible to try to update a non-existing entry. (The same patch is in stable-2.7 as 106441d already). Signed-off-by: Thomas Thrainer Reviewed-by: Guido Trotter --- diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py index c520530..8893eb2 100644 --- a/lib/cmdlib/cluster.py +++ b/lib/cmdlib/cluster.py @@ -803,7 +803,7 @@ class LUClusterSetParams(LogicalUnit): self.new_diskparams = objects.FillDict(cluster.diskparams, {}) if self.op.diskparams: for dt_name, dt_params in self.op.diskparams.items(): - if dt_name not in self.op.diskparams: + if dt_name not in self.new_diskparams: self.new_diskparams[dt_name] = dt_params else: self.new_diskparams[dt_name].update(dt_params)