From 525f0f984eec8905b4dbf2b744db2c2882b84787 Mon Sep 17 00:00:00 2001 From: Christos Stavrakakis <cstavr@grnet.gr> Date: Fri, 18 Jan 2013 16:44:13 +0200 Subject: [PATCH] Fix type of 'node_whitelist' request parameter If opportunistic_locking is used, then 'node_whitelist' parameter passed to the allocator is set to the LU's owned node locks. However, LU owned_locks has type of 'set' while IReqInstanceAlloc expects type of 'ht.TMaybeListOf(ht.TNonEmptyString)'. Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr> Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- lib/cmdlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index cf4d90220..afc801f9a 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -10297,7 +10297,7 @@ class LUInstanceCreate(LogicalUnit): """ if self.op.opportunistic_locking: # Only consider nodes for which a lock is held - node_whitelist = self.owned_locks(locking.LEVEL_NODE) + node_whitelist = list(self.owned_locks(locking.LEVEL_NODE)) else: node_whitelist = None @@ -11241,7 +11241,7 @@ class LUInstanceMultiAlloc(NoHooksLU): if self.op.opportunistic_locking: # Only consider nodes for which a lock is held - node_whitelist = self.owned_locks(locking.LEVEL_NODE) + node_whitelist = list(self.owned_locks(locking.LEVEL_NODE)) else: node_whitelist = None -- GitLab