Closed lorengordon closed 1 year ago
I have validated in my own project that this does cause the necessary failure during the plan phase...
pip_requirements_step(File(".terraform/modules/lambda/package.py", line 660, in pip_requirements_step
raise RuntimeError(
RuntimeError: Python interpreter version equal to defined lambda runtime
(python3.8) should be available in system PATH
And also, that it still does not fail if the runtime is available. π
Now that this PR is merged, I'm getting the following error:
Program: /opt/hostedtoolcache/Python/3.9.15/x64/bin/python3
Error Message: Traceback (most recent call last):
File "/home/runner/work/bernese/bernese/infrastructure/environments/staging/.terraform/modules/redefine_serverless.list_queries_lambda/package.py", line 1401, in <module>
main()
File "/home/runner/work/bernese/bernese/infrastructure/environments/staging/.terraform/modules/redefine_serverless.list_queries_lambda/package.py", line 1397, in main
exit(args.command(args))
File "/home/runner/work/bernese/bernese/infrastructure/environments/staging/.terraform/modules/redefine_serverless.list_queries_lambda/package.py", line 1204, in prepare_command
content_hash = bpm.hash(hash_extra_paths)
File "/home/runner/work/bernese/bernese/infrastructure/environments/staging/.terraform/modules/redefine_serverless.list_queries_lambda/package.py", line 636, in hash
content_hash = generate_content_hash(content_hash_paths,
File "/home/runner/work/bernese/bernese/infrastructure/environments/staging/.terraform/modules/redefine_serverless.list_queries_lambda/package.py", line 248, in generate_content_hash
update_hash(hash_obj, source_dir, source_file)
File "/home/runner/work/bernese/bernese/infrastructure/environments/staging/.terraform/modules/redefine_serverless.list_queries_lambda/package.py", line 263, in update_hash
with open(relative_path, 'rb') as open_file:
NotADirectoryError: [Errno 20] Not a directory:
'lambda_folder/main.py/requirements.txt'
Even though I didn't set the pip_requirements = true
option, and my path looks as follows:
source_path = "lambda_folder/list_queries/main.py"
An hour ago this exact same module
worked as expected, but now fails.
@lorengordon Could you please take a look at this issue?
Oh, I see the logic error. My apologies. One sec.
I'm going to lock this pull request because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Fixes #357
Description
Raises plan-time error if the python or nodejs runtime is not present in the PATH. This matches the apply-time behavior, but generates the error during the plan instead of waiting until the apply.
Motivation and Context
See #357
Breaking Changes
I don't think so, unless people were somehow exploiting the prior behavior. But I can't really think of a situation where anyone would want a plan-time success and an apply-time failure...
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request