Skip to content

Commit

Permalink
Merge pull request #302 from tisnik/dont-redeclare-outer-scope-var-by…
Browse files Browse the repository at this point in the history
…-local-one

Dont redeclare outer scope var by local one
  • Loading branch information
tisnik authored Jan 22, 2025
2 parents 641cc8b + ddd8c67 commit 4c72419
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions ols/app/endpoints/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ def feedback_status() -> StatusResponse:
Response indicating the status of the feedback.
"""
logger.debug("feedback status request received")
feedback_status = is_feedback_enabled()
return StatusResponse(functionality="feedback", status={"enabled": feedback_status})
feedback_status_enabled = is_feedback_enabled()
return StatusResponse(
functionality="feedback", status={"enabled": feedback_status_enabled}
)


post_feedback_responses: dict[int | str, dict[str, Any]] = {
Expand Down
12 changes: 6 additions & 6 deletions ols/utils/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def min_tls_version(
tls_profile: TLSProfiles,
) -> Optional[ssl.TLSVersion]:
"""Retrieve minimal TLS version for the profile or for the current profile configuration."""
min_tls_version = specified_tls_version
if min_tls_version is None:
min_tls_version_specified = specified_tls_version
if min_tls_version_specified is None:
return MIN_TLS_VERSIONS[tls_profile]
return min_tls_version
return min_tls_version_specified


def ciphers_from_list(ciphers: Optional[list[str]]) -> Optional[str]:
Expand All @@ -136,7 +136,7 @@ def ciphers_as_string(
ciphers: Optional[list[str]], tls_profile: TLSProfiles
) -> Optional[str]:
"""Retrieve ciphers as one string for custom list of TLS profile-based list."""
ciphers_as_string = ciphers_from_list(ciphers)
if ciphers_as_string is None:
ciphers_as_str = ciphers_from_list(ciphers)
if ciphers_as_str is None:
return ciphers_for_tls_profile(tls_profile)
return ciphers_as_string
return ciphers_as_str
4 changes: 2 additions & 2 deletions tests/e2e/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def teardown_module(module):
must_gather()


@pytest.fixture(scope="module")
def postgres_connection():
@pytest.fixture(name="postgres_connection", scope="module")
def fixture_postgres_connection():
"""Fixture with Postgres connection."""
return retrieve_connection()

Expand Down

0 comments on commit 4c72419

Please sign in to comment.