Replace dict.iteritems with six.iteritems to make PY3 compatible
Python3 do not use dict.iteritems, which would raise AttributeError: 'dict' object has no attribute 'iteritems'. Change-Id: I75f5954ce0d5573f69a22799dacb74b918028115 Closes-Bug: #1596124
This commit is contained in:
parent
b89f2c59e2
commit
e84621ecc0
@ -48,7 +48,7 @@ class OpenStackClientTestBase(base.ClientTestBase):
|
|||||||
items = self.parser.listing(output)
|
items = self.parser.listing(output)
|
||||||
for item in items:
|
for item in items:
|
||||||
obj[item['Field']] = six.text_type(item['Value'])
|
obj[item['Field']] = six.text_type(item['Value'])
|
||||||
return dict((self._key_name(k), v) for k, v in obj.iteritems())
|
return dict((self._key_name(k), v) for k, v in six.iteritems(obj))
|
||||||
|
|
||||||
def _key_name(self, key):
|
def _key_name(self, key):
|
||||||
return key.lower().replace(' ', '_')
|
return key.lower().replace(' ', '_')
|
||||||
@ -60,7 +60,7 @@ class OpenStackClientTestBase(base.ClientTestBase):
|
|||||||
if item['ID'] == id:
|
if item['ID'] == id:
|
||||||
obj = item
|
obj = item
|
||||||
break
|
break
|
||||||
return dict((self._key_name(k), v) for k, v in obj.iteritems())
|
return dict((self._key_name(k), v) for k, v in six.iteritems(obj))
|
||||||
|
|
||||||
def _stack_create(self, name, template, parameters=[], wait=True):
|
def _stack_create(self, name, template, parameters=[], wait=True):
|
||||||
cmd = 'stack create ' + name
|
cmd = 'stack create ' + name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user