-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DPE-3688 fix KeyError when no ca-chain #403
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #403 +/- ##
==========================================
+ Coverage 65.34% 65.90% +0.55%
==========================================
Files 17 17
Lines 3102 3103 +1
Branches 410 411 +1
==========================================
+ Hits 2027 2045 +18
+ Misses 948 929 -19
- Partials 127 129 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tnx for tests!
@@ -86,7 +86,8 @@ def upload_content_to_s3(content: str, content_path: str, s3_parameters: Dict) - | |||
) | |||
return False | |||
finally: | |||
ca_file.close() | |||
if ca_file: | |||
ca_file.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we close right after ca_file.flush() ? Do you also want to close temp_file
?
Anyway, this will work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NamedTemporaryFile
will be deleted once closed, hence closing it by the end.
The temp_file
is used within a context manager (with
), which closes it when exits the context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should use with
for ca_file
as well
@@ -86,7 +86,8 @@ def upload_content_to_s3(content: str, content_path: str, s3_parameters: Dict) - | |||
) | |||
return False | |||
finally: | |||
ca_file.close() | |||
if ca_file: | |||
ca_file.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should use with
for ca_file
as well
Issue
backup fail due to dict key error
Solution
Fixes #402