Skip to content

Commit

Permalink
Handle lambda => awslambda mapping in cfn2py (cloudtools#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
markpeek authored and covataamos committed Oct 24, 2016
1 parent 397439b commit 6eed969
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/cfn2py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,20 @@ def do_mappings(d):
print


def map_module(mod):
"""Map module names as needed"""
if mod == "lambda":
return "awslambda"
return mod


def generate_troposphere_object(typename):
"""Try to determine the troposphere object to create from the Type
specification from the Resource being converted.
"""
t = typename.split(':')
if len(t) == 5:
return (t[2].lower(), t[4])
return (map_module(t[2].lower()), t[4])
else:
return ('', typename)

Expand Down

0 comments on commit 6eed969

Please sign in to comment.