88from werkzeug .routing import BaseConverter
99
1010from samcli .commands .local .lib .exceptions import UnsupportedInlineCodeError
11- from samcli .lib .utils .name_utils import InvalidFunctionNameException , normalize_lambda_function_name
1211from samcli .lib .utils .stream_writer import StreamWriter
1312from samcli .local .docker .exceptions import DockerContainerCreationFailedException
1413from samcli .local .lambdafn .exceptions import FunctionNotFound
@@ -152,7 +151,7 @@ def _invoke_request_handler(self, function_name):
152151 Parameters
153152 ----------
154153 function_name str
155- Name or ARN of the function to invoke
154+ Name of the function to invoke
156155
157156 Returns
158157 -------
@@ -167,24 +166,15 @@ def _invoke_request_handler(self, function_name):
167166
168167 request_data = request_data .decode ("utf-8" )
169168
170- # Normalize function name from ARN if provided
171- try :
172- normalized_function_name = normalize_lambda_function_name (function_name )
173- except InvalidFunctionNameException as e :
174- LOG .error ("Invalid function name: %s" , str (e ))
175- return LambdaErrorResponses .validation_exception (str (e ))
176-
177169 stdout_stream_string = io .StringIO ()
178170 stdout_stream_bytes = io .BytesIO ()
179171 stdout_stream_writer = StreamWriter (stdout_stream_string , stdout_stream_bytes , auto_flush = True )
180172
181173 try :
182- self .lambda_runner .invoke (
183- normalized_function_name , request_data , stdout = stdout_stream_writer , stderr = self .stderr
184- )
174+ self .lambda_runner .invoke (function_name , request_data , stdout = stdout_stream_writer , stderr = self .stderr )
185175 except FunctionNotFound :
186- LOG .debug ("%s was not found to invoke." , normalized_function_name )
187- return LambdaErrorResponses .resource_not_found (normalized_function_name )
176+ LOG .debug ("%s was not found to invoke." , function_name )
177+ return LambdaErrorResponses .resource_not_found (function_name )
188178 except UnsupportedInlineCodeError :
189179 return LambdaErrorResponses .not_implemented_locally (
190180 "Inline code is not supported for sam local commands. Please write your code in a separate file."
0 commit comments