MRN-511 - exception raised when arguments from workflow merged with stack arguments taken from Heat

Change-Id: Ie6988b650b828b2165017fccda8b9d89b8ea0ad7
This commit is contained in:
Stan Lagun 2013-07-19 18:55:14 +04:00
parent e3a34f0246
commit 14f7d3cfe3
2 changed files with 16 additions and 3 deletions

View File

@ -59,8 +59,8 @@ class HeatExecutor(CommandBase):
if command == 'CreateOrUpdate':
return self._execute_create_update(
kwargs['template'],
kwargs.get('mappings') or {},
kwargs.get('arguments') or {},
conductor.helpers.str2unicode(kwargs.get('mappings') or {}),
conductor.helpers.str2unicode(kwargs.get('arguments') or {}),
callback)
elif command == 'Delete':
return self._execute_delete(callback)

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import types
import deep
import types
def transform_json(json, mappings):
@ -87,3 +87,16 @@ def find(f, seq):
return item, index
index += 1
return None, -1
def str2unicode(obj):
if isinstance(obj, str):
return unicode(obj)
elif isinstance(obj, types.DictionaryType):
result = {}
for key, value in obj.items():
result[str2unicode(key)] = str2unicode(value)
return result
elif isinstance(obj, types.ListType):
return [str2unicode(t) for t in obj]
return obj