Skip to content

Commit

Permalink
Replace os.path.join by f-strings with "/" separator
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
  • Loading branch information
simondeziel committed Jan 31, 2023
1 parent 15501b2 commit 94fc5ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""A Juju charm for Prometheus on Kubernetes."""
import hashlib
import logging
import os
import re
import socket
from typing import Dict, Optional, cast
Expand Down Expand Up @@ -472,7 +471,7 @@ def _push_alert_rules(self, alerts):
"""
for topology_identifier, rules_file in alerts.items():
filename = f"juju_{topology_identifier}.rules"
path = os.path.join(RULES_DIR, filename)
path = f"{RULES_DIR}/{filename}"

rules = yaml.safe_dump(rules_file)

Expand Down Expand Up @@ -689,7 +688,7 @@ def _generate_prometheus_config(self) -> bool:
"""
prometheus_config = {
"global": self._prometheus_global_config(),
"rule_files": [os.path.join(RULES_DIR, "juju_*.rules")],
"rule_files": [f"{RULES_DIR}/juju_*.rules"],
"scrape_configs": [],
}

Expand Down

0 comments on commit 94fc5ed

Please sign in to comment.