From 66e3d706784b41132f3b084159febb9e1873214a Mon Sep 17 00:00:00 2001 From: Patrick Greenwell Date: Tue, 28 Jan 2020 12:16:25 -0500 Subject: [PATCH] fix: fix issue when referencing RestApiId by Ref (#1396) This handles the error of when referencing an API via Ref so that the dictionary check actually occurs. This makes the type checks equivalent and isn't as restrictive as the OrderedDict class --- samtranslator/translator/translator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/samtranslator/translator/translator.py b/samtranslator/translator/translator.py index 5655b92df..4204d9fa4 100644 --- a/samtranslator/translator/translator.py +++ b/samtranslator/translator/translator.py @@ -1,6 +1,5 @@ import copy from samtranslator.model import ResourceTypeResolver, sam_resources -from collections import OrderedDict from samtranslator.translator.verify_logical_id import verify_unique_logical_id from samtranslator.model.preferences.deployment_preference_collection import DeploymentPreferenceCollection from samtranslator.model.exceptions import ( @@ -52,7 +51,7 @@ def _get_function_names(self, resource_dict, intrinsics_resolver): # adds to the function_names dict with key as the api_name and value as the function_name if item.get("Type") == "Api" and item.get("Properties") and item.get("Properties").get("RestApiId"): rest_api = item.get("Properties").get("RestApiId") - if type(rest_api) == dict or isinstance(rest_api, OrderedDict): + if type(rest_api) == dict or isinstance(rest_api, dict): api_name = item.get("Properties").get("RestApiId").get("Ref") else: api_name = item.get("Properties").get("RestApiId")