Skip to content

Commit

Permalink
chore: Made linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
alithethird committed Aug 28, 2024
1 parent f14b8f4 commit 266b2c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/charm_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,13 @@ def check_use_aproxy(cls, use_aproxy: bool, values: dict) -> bool:
Validated use_aproxy value.
"""
try:
if use_aproxy and not (values.data.get("http") or values.data.get("https")): # type: ignore
raise ValueError("aproxy requires http or https to be set")
except AttributeError as e: # noqa: F841
if use_aproxy:
values_data = values.data # type: ignore
if not (values_data.get("http") or values_data.get("https")):
raise ValueError("aproxy requires http or https to be set")
except AttributeError as exc: # noqa: F841
# when http or https are not passed, raises an AttributeError
raise ValueError("aproxy requires http or https to be set")
raise ValueError("aproxy requires http or https to be set") from exc

return use_aproxy

Expand Down

0 comments on commit 266b2c3

Please sign in to comment.