Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
arturo-seijas committed Jan 28, 2025
1 parent 742049e commit f3d203a
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src-docs/wazuh.py.md
Original file line number Diff line number Diff line change
@@ -196,7 +196,7 @@ Returns: the JWT token

---

<a href="../src/wazuh.py#L401"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/wazuh.py#L399"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `change_api_password`

@@ -223,7 +223,7 @@ Change Wazuh's API password for a given user.

---

<a href="../src/wazuh.py#L441"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/wazuh.py#L439"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `generate_api_password`

@@ -238,7 +238,7 @@ Returns: a string with a compliant password.

---

<a href="../src/wazuh.py#L454"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/wazuh.py#L452"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `create_readonly_api_user`

@@ -265,7 +265,7 @@ Create a new readonly user for Wazuh's API.

---

<a href="../src/wazuh.py#L505"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/wazuh.py#L503"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_version`

11 changes: 4 additions & 7 deletions src/charm.py
Original file line number Diff line number Diff line change
@@ -142,13 +142,10 @@ def reconcile(self, _: ops.HookEvent) -> None:
self._configure_installation()

container.add_layer("wazuh", self._wazuh_pebble_layer, combine=True)
# The prometheus exporter requires the users to be set up
logger.debug("Unconfigured API users %s", self.state.unconfigured_api_users)
if not self.state.unconfigured_api_users:
logger.debug("Adding prometheus pebble layer")
container.add_layer("prometheus", self._prometheus_pebble_layer, combine=True)
container.replan()

# The prometheus exporter requires the users to be set up
logger.debug("Unconfigured API users %s", self.state.unconfigured_api_users)
if self.state.unconfigured_api_users:
# Current credentials that will be updated on every successful operation
credentials = self.state.api_credentials
@@ -177,8 +174,8 @@ def reconcile(self, _: ops.HookEvent) -> None:
# Fetch the new wazuh layer, which has different env vars
logger.debug("Reconfiguring pebble layers")
container.add_layer("wazuh", self._wazuh_pebble_layer, combine=True)
container.add_layer("prometheus", self._prometheus_pebble_layer, combine=True)
container.replan()
container.add_layer("prometheus", self._prometheus_pebble_layer, combine=True)
container.replan()
self.unit.set_workload_version(wazuh.get_version(container))
self.unit.status = ops.ActiveStatus()

0 comments on commit f3d203a

Please # to comment.