Fix using map() for python2,3 compatibility

In python3, map() returns an iterator that caused error:
AttributeError: 'map' object has no attribute 'insert'

Targets blueprint: murano-python-3-support
Change-Id: Id0b1e545bf2ce11c0e4fd29faa5d19bad29c2173
This commit is contained in:
Bo Wang 2016-01-20 19:26:55 +08:00
parent b50564d65d
commit c4b3340847
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class ModelPolicyEnforcer(object):
def _execute_simulation(self, package_loader, env_id, model, query):
rules = congress_rules.CongressRulesManager().convert(
model, package_loader, self._environment.tenant_id)
rules_str = map(str, rules)
rules_str = list(map(str, rules))
# cleanup of data populated by murano driver
rules_str.insert(0, 'deleteEnv("{0}")'.format(env_id))
rules_line = " ".join(rules_str)