Fix py34 error of indexing 'dict_keys' object
In python3, keys() of a dict isn't a list and cannot be indexed. Change-Id: Iddced3a8856f4c66235779a7dde65d2604fae244 Closes-Bug: #1550184
This commit is contained in:
parent
f8a263029d
commit
3f6b80f514
@ -52,7 +52,7 @@ class CompositeRule(wtypes.UserType):
|
||||
@staticmethod
|
||||
def valid_composite_rule(rules):
|
||||
if isinstance(rules, dict) and len(rules) == 1:
|
||||
and_or_key = rules.keys()[0]
|
||||
and_or_key = list(rules)[0]
|
||||
if and_or_key not in ('and', 'or'):
|
||||
raise base.ClientSideError(
|
||||
_('Threshold rules should be combined with "and" or "or"'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user