Skip to content

Commit 4c72419

Browse files
authored
Merge pull request road-core#302 from tisnik/dont-redeclare-outer-scope-var-by-local-one
Dont redeclare outer scope var by local one
2 parents 641cc8b + ddd8c67 commit 4c72419

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

ols/app/endpoints/feedback.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ def feedback_status() -> StatusResponse:
8484
Response indicating the status of the feedback.
8585
"""
8686
logger.debug("feedback status request received")
87-
feedback_status = is_feedback_enabled()
88-
return StatusResponse(functionality="feedback", status={"enabled": feedback_status})
87+
feedback_status_enabled = is_feedback_enabled()
88+
return StatusResponse(
89+
functionality="feedback", status={"enabled": feedback_status_enabled}
90+
)
8991

9092

9193
post_feedback_responses: dict[int | str, dict[str, Any]] = {

ols/utils/tls.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ def min_tls_version(
113113
tls_profile: TLSProfiles,
114114
) -> Optional[ssl.TLSVersion]:
115115
"""Retrieve minimal TLS version for the profile or for the current profile configuration."""
116-
min_tls_version = specified_tls_version
117-
if min_tls_version is None:
116+
min_tls_version_specified = specified_tls_version
117+
if min_tls_version_specified is None:
118118
return MIN_TLS_VERSIONS[tls_profile]
119-
return min_tls_version
119+
return min_tls_version_specified
120120

121121

122122
def ciphers_from_list(ciphers: Optional[list[str]]) -> Optional[str]:
@@ -136,7 +136,7 @@ def ciphers_as_string(
136136
ciphers: Optional[list[str]], tls_profile: TLSProfiles
137137
) -> Optional[str]:
138138
"""Retrieve ciphers as one string for custom list of TLS profile-based list."""
139-
ciphers_as_string = ciphers_from_list(ciphers)
140-
if ciphers_as_string is None:
139+
ciphers_as_str = ciphers_from_list(ciphers)
140+
if ciphers_as_str is None:
141141
return ciphers_for_tls_profile(tls_profile)
142-
return ciphers_as_string
142+
return ciphers_as_str

tests/e2e/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def teardown_module(module):
9191
must_gather()
9292

9393

94-
@pytest.fixture(scope="module")
95-
def postgres_connection():
94+
@pytest.fixture(name="postgres_connection", scope="module")
95+
def fixture_postgres_connection():
9696
"""Fixture with Postgres connection."""
9797
return retrieve_connection()
9898

0 commit comments

Comments
 (0)