Fix type error in LUInstanceChangeGroup
authorIustin Pop <iustin@google.com>
Mon, 19 Mar 2012 09:26:29 +0000 (10:26 +0100)
committerIustin Pop <iustin@google.com>
Mon, 19 Mar 2012 09:48:28 +0000 (10:48 +0100)
If a specific list of groups has been requested, then the code used
that, without transforming it to a (frozen)set first, which results
in:

 unsupported operand type(s) for &: 'list' and 'frozenset'

Trivial fix is to do that in the 'then' branch.

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

lib/cmdlib.py

index fb49df1..b432794 100644 (file)
@@ -11377,7 +11377,7 @@ class LUInstanceChangeGroup(LogicalUnit):
 
     if self.req_target_uuids:
       # User requested specific target groups
-      self.target_uuids = self.req_target_uuids
+      self.target_uuids = frozenset(self.req_target_uuids)
     else:
       # All groups except those used by the instance are potential targets
       self.target_uuids = owned_groups - inst_groups