Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
resolve woke issues
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Oct 30, 2023
1 parent ad997f6 commit 9539ffd
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions reactive/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

from charms import layer

NRPE_PRIMARY = "nrpe-external-master" # wokeignore: master

Check failure on line 41 in reactive/docker.py

View workflow job for this annotation

GitHub Actions / Inclusive naming check

[Inclusive naming check] reactive/docker.py#L41

[warning] `master` may be insensitive, use `primary`, `main` instead
Raw output
reactive/docker.py:41:30: [warning] `master` may be insensitive, use `primary`, `main` instead

Check failure on line 41 in reactive/docker.py

View workflow job for this annotation

GitHub Actions / Inclusive naming check

[Inclusive naming check] reactive/docker.py#L41

[warning] `master` may be insensitive, use `primary`, `main` instead
Raw output
reactive/docker.py:41:53: [warning] `master` may be insensitive, use `primary`, `main` instead

# 2 Major events are emitted from this layer.
#
# `docker.ready` is an event intended to signal other layers that need to
Expand Down Expand Up @@ -609,18 +611,18 @@ def dockerhost_connected(dockerhost):
dockerhost.configure(Docker().socket)


@when("nrpe-external-master.available")
@when_not("nrpe-external-master.docker.initial-config")
@when(f"{NRPE_PRIMARY}.available")
@when_not(f"{NRPE_PRIMARY}.docker.initial-config")
def initial_nrpe_config():
"""
:return: None
"""
set_state("nrpe-external-master.docker.initial-config")
set_state(f"{NRPE_PRIMARY}.docker.initial-config")
update_nrpe_config()


@when("docker.ready")
@when("nrpe-external-master.available")
@when(f"{NRPE_PRIMARY}.available")
@when_any("config.changed.nagios_context", "config.changed.nagios_servicegroups")
def update_nrpe_config():
"""
Expand All @@ -638,13 +640,13 @@ def update_nrpe_config():
nrpe_setup.write()


@when_not("nrpe-external-master.available")
@when("nrpe-external-master.docker.initial-config")
@when_not(f"{NRPE_PRIMARY}.available")
@when(f"{NRPE_PRIMARY}.docker.initial-config")
def remove_nrpe_config():
"""
:return: None
"""
remove_state("nrpe-external-master.docker.initial-config")
remove_state(f"{NRPE_PRIMARY}.docker.initial-config")

# List of systemd services for which the checks will be removed.
services = ["docker"]
Expand Down

0 comments on commit 9539ffd

Please sign in to comment.