Skip to content

Commit

Permalink
tox format
Browse files Browse the repository at this point in the history
  • Loading branch information
eaudetcobello committed May 31, 2024
1 parent fea6106 commit 3b9415f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""Charmed Machine Operator for Kubernetes Control Plane."""

import functools
import hashlib
import logging
import os
import re
Expand Down Expand Up @@ -51,6 +50,7 @@

OBSERVABILITY_ROLE = "system:cos"


class KubernetesControlPlaneCharm(ops.CharmBase):
"""Charmed Operator for Kubernetes Control Plane."""

Expand Down Expand Up @@ -110,7 +110,6 @@ def __init__(self, *args):
for action in actions:
self.framework.observe(action, self.charm_actions)


def charm_actions(self, event: ops.ActionEvent):
action_map = {
"upgrade_action": actions.upgrade.upgrade_action,
Expand Down
12 changes: 8 additions & 4 deletions src/cos_integration.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import hashlib
import logging
import os
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Union

import os
import ops
import hashlib
from pathlib import Path

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -39,7 +39,10 @@ class JobConfig:
class AlertManagerDefinitionsReadyEvent(ops.EventBase):
"""Event emitted when alert manager definitions are ready."""


class COSIntegrationEvents(ops.ObjectEvents):
"""Manages COSIntegration events."""

definitions_ready = ops.EventSource(AlertManagerDefinitionsReadyEvent)


Expand All @@ -52,6 +55,7 @@ class COSIntegration(ops.Object):
Attributes:
charm (CharmBase): Reference to the base charm instance.
"""

on = COSIntegrationEvents()
stored = ops.StoredState()

Expand Down Expand Up @@ -102,7 +106,7 @@ def _parse_metrics_rules_files(self):

replace_rules = {
"kubernetesControlPlane-prometheusRule.yaml": {
"[[- namespace -]]": 'namespace=~' + f'"{self.charm.config["namespace"]}"',
"[[- namespace -]]": "namespace=~" + f'"{self.charm.config["namespace"]}"',
},
}

Expand Down

0 comments on commit 3b9415f

Please sign in to comment.