~vultaire/charm-nagios:skip-dedupe-prefix-for-same-model

Last commit made on 2021-08-26
Get this branch:
git clone -b skip-dedupe-prefix-for-same-model https://git.launchpad.net/~vultaire/charm-nagios
Only Paul Goins can upload to this branch. If you are Paul Goins please log in for upload directions.

Branch merges

Branch information

Name:
skip-dedupe-prefix-for-same-model
Repository:
lp:~vultaire/charm-nagios

Recent commits

bfe338c... by Paul Goins

Fixed deduping to skip the prefix if not needed

Deduplication is only performed if there are 2 or more related units
with the same target hostname from different models. If there are
"duplicates" but they are from the same model (e.g. multiple nrpe units
associated with different principal apps on the same host), it is
probably preferable to have those "coalesce" into a single host, rather
than having distinct records with redundant checks.

fcba656... by Paul Goins

Removed import for removed function

038f963... by Paul Goins

Removed fallback deduping methodology

On reflection, I don't believe this provided much benefit. The needed
updates to charm-nrpe were provided at nearly the same time as
charm-nagios to support the main deduping methodology. Rather than
maintaining 2 methods, we should probably maintain just one.

5026bed... by Paul Goins

Re-linted, with some tweaks

Set the flake8-import-order setting "application-import-names" to
specify modules we consider local to our app, so they won't be
considered 3rd party libraries.

b1df8eb... by Paul Goins

Re-blackened

13c1b38... by Paul Goins

Since charm runs using py2, updated unit tests to use py2

534010c... by Paul Goins

Added unit tests, plus a few fixes for py3.

3242a28... by Paul Goins

Small fix: relation_data can return None

b9f905f... by Paul Goins

Changes based on code review

* One dict.setdefault simplification
* Some changes to the host/hostgroup template paths to better indicate
  that they're managed by Juju
* Changes to reduce indentation of one particularly long indented block

11235de... by Paul Goins

Adding cleanup logic

This handles a corner case where the last remaining host of a
duplicate set ends up with multiple host files due to the way that the
code minimizes writing of host files. Any hosts which lack files in
expected locations will have them created, but removal of existing
files is only done for units directly related to a relation hook - thus
hosts which are renamed due to addition/removal of a different unit
are having new files written but not necessarily having their old files
removed.