Python2/3 compatibility fixes
Results from runnig 2to3 tooling.
Change-Id: I7e029b46a66c3eecbea323c12722d5c5b36076e1
(cherry picked from commit 21946e6b85)
This commit is contained in:
@@ -43,11 +43,11 @@ class GBPResource(resource.Resource):
|
|||||||
Also ensures that shared and tenant_id is not specified
|
Also ensures that shared and tenant_id is not specified
|
||||||
in value_specs.
|
in value_specs.
|
||||||
'''
|
'''
|
||||||
if 'value_specs' in properties.keys():
|
if 'value_specs' in list(properties.keys()):
|
||||||
vs = properties.get('value_specs')
|
vs = properties.get('value_specs')
|
||||||
banned_keys = set(['shared', 'tenant_id']).union(
|
banned_keys = set(['shared', 'tenant_id']).union(
|
||||||
properties.keys())
|
list(properties.keys()))
|
||||||
for k in banned_keys.intersection(vs.keys()):
|
for k in banned_keys.intersection(list(vs.keys())):
|
||||||
return '%s not allowed in value_specs' % k
|
return '%s not allowed in value_specs' % k
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -74,13 +74,13 @@ class GBPResource(resource.Resource):
|
|||||||
Removes None values and value_specs, merges value_specs with the main
|
Removes None values and value_specs, merges value_specs with the main
|
||||||
values.
|
values.
|
||||||
'''
|
'''
|
||||||
props = dict((k, v) for k, v in properties.items()
|
props = dict((k, v) for k, v in list(properties.items())
|
||||||
if v is not None and k != 'value_specs')
|
if v is not None and k != 'value_specs')
|
||||||
|
|
||||||
if 'name' in properties.keys():
|
if 'name' in list(properties.keys()):
|
||||||
props.setdefault('name', name)
|
props.setdefault('name', name)
|
||||||
|
|
||||||
if 'value_specs' in properties.keys():
|
if 'value_specs' in list(properties.keys()):
|
||||||
props.update(properties.get('value_specs'))
|
props.update(properties.get('value_specs'))
|
||||||
|
|
||||||
return props
|
return props
|
||||||
@@ -94,7 +94,7 @@ class GBPResource(resource.Resource):
|
|||||||
as for prepare_properties.
|
as for prepare_properties.
|
||||||
'''
|
'''
|
||||||
p = definition.properties(self.properties_schema, self.context)
|
p = definition.properties(self.properties_schema, self.context)
|
||||||
update_props = dict((k, v) for k, v in p.items()
|
update_props = dict((k, v) for k, v in list(p.items())
|
||||||
if p.props.get(k).schema.update_allowed)
|
if p.props.get(k).schema.update_allowed)
|
||||||
|
|
||||||
props = self.prepare_properties(
|
props = self.prepare_properties(
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ class PolicyTargetTest(HeatTestCase):
|
|||||||
"description": "test policy target resource",
|
"description": "test policy target resource",
|
||||||
"port_id": "some-port-id",
|
"port_id": "some-port-id",
|
||||||
'fixed_ips': [
|
'fixed_ips': [
|
||||||
{'subnet_id': u'test-subnet', 'ip_address': u'10.0.3.21'}
|
{'subnet_id': 'test-subnet', 'ip_address': '10.0.3.21'}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -621,7 +621,7 @@ class PolicyTargetTest(HeatTestCase):
|
|||||||
"description": "test policy target resource",
|
"description": "test policy target resource",
|
||||||
"port_id": "some-port-id",
|
"port_id": "some-port-id",
|
||||||
'fixed_ips': [
|
'fixed_ips': [
|
||||||
{'subnet_id': u'test-subnet', 'ip_address': u'10.0.3.21'}
|
{'subnet_id': 'test-subnet', 'ip_address': '10.0.3.21'}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user