Skip to content

Commit

Permalink
Fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
adferrand committed Nov 16, 2023
1 parent bf607c5 commit b31171f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ profile = "black"

[tool.flake8]
max-line-length = 88
extend-ignore = ["E203", "E501"]
extend-ignore = ["E203", "E501", "E231", "E221"]
2 changes: 1 addition & 1 deletion src/dnsrobocert/core/certbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _issue(config_path: str, directory_path: str, lock: threading.Lock):
)
except BaseException as error:
LOGGER.error(
f"An error occurred while processing certificate config `{certificate}`:\n{error}"
f"An error occurred while processing certificate config {certificate}:\n{error}"
)

LOGGER.info("Revoke and delete certificates if needed")
Expand Down
12 changes: 6 additions & 6 deletions src/dnsrobocert/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ def find_profile_for_lineage(config: Dict[str, Any], lineage: str) -> Dict[str,
certificate = get_certificate(config, lineage)
if not certificate:
raise RuntimeError(
f"Error, certificate named `{lineage}` could not be found in configuration."
f"Error, certificate named {lineage} could not be found in configuration."
)
profile_name = certificate.get("profile")
if not profile_name:
raise RuntimeError(
f"Error, profile named `{lineage}` could not be found in configuration."
f"Error, profile named {lineage} could not be found in configuration."
)

return get_profile(config, profile_name)
Expand Down Expand Up @@ -179,11 +179,11 @@ def _business_check(config: Dict[str, Any]):
if lineage:
if profile_name not in profile_names:
raise ValueError(
f"Profile `{profile_name}` used by certificate `{lineage}` does not exist."
f"Profile {profile_name} used by certificate {lineage} does not exist."
)

if lineage in lineages:
raise ValueError(f"Certificate with name `{lineage}` is duplicated.")
raise ValueError(f"Certificate with name {lineage} is duplicated.")
lineages.add(lineage)

# Emit warning for deprecated delegated_subdomain field in profile section
Expand All @@ -198,7 +198,7 @@ def _business_check(config: Dict[str, Any]):
# Check that each files_mode and dirs_mode is a valid POSIX mode
files_mode = config.get("acme", {}).get("certs_permissions", {}).get("files_mode")
if files_mode and files_mode > 511:
raise ValueError("Invalid files_mode `{0}` provided.".format(oct(files_mode)))
raise ValueError("Invalid files_mode {0} provided.".format(oct(files_mode)))
dirs_mode = config.get("acme", {}).get("certs_permissions", {}).get("dirs_mode")
if dirs_mode and dirs_mode > 511:
raise ValueError("Invalid dirs_mode `{0}` provided.".format(oct(files_mode)))
raise ValueError("Invalid dirs_mode {0} provided.".format(oct(files_mode)))
4 changes: 2 additions & 2 deletions src/dnsrobocert/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main(args: Optional[List[str]] = None) -> int:

if not dnsrobocert_config:
print(
f"Error occured while loading the configuration file, aborting the `{parsed_args.type}` hook.",
f"Error occured while loading the configuration file, aborting the {parsed_args.type} hook.",
file=sys.stderr,
)
return 1
Expand All @@ -40,7 +40,7 @@ def main(args: Optional[List[str]] = None) -> int:
globals()[parsed_args.type](dnsrobocert_config, parsed_args.lineage)
except BaseException as e:
print(
f"Error while executing the `{parsed_args.type}` hook:",
f"Error while executing the {parsed_args.type} hook:",
file=sys.stderr,
)
print(e, file=sys.stderr)
Expand Down
6 changes: 3 additions & 3 deletions src/dnsrobocert/core/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ def migrate(config_path: str) -> str | None:
"for more details. "
)
LOGGER.warning(
f"New configuration file is available at `{example_config_path}`"
f"New configuration file is available at {example_config_path}"
)
LOGGER.warning(
f"Quick fix (if directory `{os.path.dirname(config_path)}` is persisted): "
f"rename this file to `{os.path.basename(config_path)}`"
f"Quick fix (if directory {os.path.dirname(config_path)} is persisted): "
f"rename this file to {os.path.basename(config_path)}"
)

os.makedirs(os.path.dirname(example_config_path), exist_ok=True)
Expand Down

0 comments on commit b31171f

Please sign in to comment.