Merge ~freyes/charm-nrpe:add-jammy-support into charm-nrpe:master

Proposed by Felipe Reyes
Status: Merged
Approved by: Eric Chen
Approved revision: dcbb810204c886b3418f53bd15dc2c8a5aa03ec2
Merged at revision: 12724fd22f98cd3d52a65b977d17895526784be8
Proposed branch: ~freyes/charm-nrpe:add-jammy-support
Merge into: charm-nrpe:master
Diff against target: 146 lines (+75/-3)
6 files modified
charmcraft.yaml (+4/-0)
hooks/nrpe_helpers.py (+5/-0)
metadata.yaml (+2/-1)
tests/functional/tests/bundles/jammy.yaml (+23/-0)
tests/functional/tests/tests.yaml (+5/-1)
tests/unit/test_nrpe_helpers.py (+36/-1)
Reviewer Review Type Date Requested Status
Eric Chen Approve
Corey Bryant (community) Approve
Przemyslaw Lal Approve
BootStack Reviewers Pending
Review via email: mp+425257@code.launchpad.net

Commit message

Add Jammy support.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

Revision history for this message
Eric Chen (eric-chen) :
review: Needs Fixing
Revision history for this message
Przemyslaw Lal (przemeklal) wrote :

Apart from Eric's comment about ordering this change LGTM. Rebase might be needed since we've recently bumped the charmhelpers version in the master branch.

review: Needs Fixing
Revision history for this message
Felipe Reyes (freyes) wrote :

Hi, I just pushed a new version that addresses the feedback left.

- Rebased on top of master
- Sorted the list of series from newest to oldest

Best,

Revision history for this message
Przemyslaw Lal (przemeklal) wrote :

Thanks, LGTM

review: Approve
Revision history for this message
Corey Bryant (corey.bryant) wrote :

LGTM. This is blocking a bunch of our tests so would be nice to get this support merged.

review: Approve
Revision history for this message
Eric Chen (eric-chen) :
review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 12724fd22f98cd3d52a65b977d17895526784be8

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/charmcraft.yaml b/charmcraft.yaml
index d45d038..bda5184 100644
--- a/charmcraft.yaml
+++ b/charmcraft.yaml
@@ -23,6 +23,10 @@ bases:
23 architectures: ["amd64"]23 architectures: ["amd64"]
24 run-on:24 run-on:
25 - name: ubuntu25 - name: ubuntu
26 channel: "22.04"
27 architectures:
28 - amd64
29 - name: ubuntu
26 channel: "20.04"30 channel: "20.04"
27 architectures:31 architectures:
28 - amd6432 - amd64
diff --git a/hooks/nrpe_helpers.py b/hooks/nrpe_helpers.py
index 9249905..b980912 100644
--- a/hooks/nrpe_helpers.py
+++ b/hooks/nrpe_helpers.py
@@ -818,6 +818,11 @@ def get_partitions_to_check():
818 continue818 continue
819 if child.get("mountpoint", ""):819 if child.get("mountpoint", ""):
820 partitions_to_check.add(child.get("mountpoint"))820 partitions_to_check.add(child.get("mountpoint"))
821 # Jammy returns a list of "mountpoints" instead of a single value
822 # in the key "mountpoint"
823 for mountpoint in child.get("mountpoints", []):
824 if mountpoint:
825 partitions_to_check.add(mountpoint)
821826
822 skipped_partitions = {"[SWAP]", "/boot/efi"}827 skipped_partitions = {"[SWAP]", "/boot/efi"}
823828
diff --git a/metadata.yaml b/metadata.yaml
index e3b05f5..342168f 100644
--- a/metadata.yaml
+++ b/metadata.yaml
@@ -27,6 +27,7 @@ requires:
27 interface: local-monitors27 interface: local-monitors
28 scope: container28 scope: container
29series:29series:
30 - bionic30 - jammy
31 - focal31 - focal
32 - bionic
32 - xenial33 - xenial
diff --git a/tests/functional/tests/bundles/jammy.yaml b/tests/functional/tests/bundles/jammy.yaml
33new file mode 10064434new file mode 100644
index 0000000..163b381
--- /dev/null
+++ b/tests/functional/tests/bundles/jammy.yaml
@@ -0,0 +1,23 @@
1local_overlay_enabled: true
2series: jammy
3applications:
4 rabbitmq-server:
5 charm: ch:rabbitmq-server
6 channel: 3.9/stable
7 num_units: 1
8 constraints: root-disk=8G
9 container:
10 charm: ch:ubuntu
11 num_units: 1
12 to: ["lxd:rabbitmq-server/0"]
13 nagios:
14 charm: ch:nagios
15 num_units: 1
16 series: bionic
17relations:
18 - - rabbitmq-server:nrpe-external-master
19 - nrpe:nrpe-external-master
20 - - container:juju-info
21 - nrpe:general-info
22 - - nrpe:monitors
23 - nagios:monitors
diff --git a/tests/functional/tests/tests.yaml b/tests/functional/tests/tests.yaml
index 45c660f..c281785 100644
--- a/tests/functional/tests/tests.yaml
+++ b/tests/functional/tests/tests.yaml
@@ -1,5 +1,6 @@
1charm_name: nrpe1charm_name: nrpe
2gate_bundles:2gate_bundles:
3 - jammy
3 - focal4 - focal
4 - bionic5 - bionic
5 - xenial6 - xenial
@@ -10,4 +11,7 @@ tests:
10target_deploy_status:11target_deploy_status:
11 container:12 container:
12 workload-status: active13 workload-status: active
13 workload-status-message-prefix: ""
14\ No newline at end of file14\ No newline at end of file
15 workload-status-message-prefix: ""
16tests_options:
17 force_deploy:
18 - jammy # https://github.com/juju-solutions/charm-ubuntu/issues/44
diff --git a/tests/unit/test_nrpe_helpers.py b/tests/unit/test_nrpe_helpers.py
index 96d1ae4..fa5a54f 100644
--- a/tests/unit/test_nrpe_helpers.py
+++ b/tests/unit/test_nrpe_helpers.py
@@ -242,7 +242,41 @@ class TestDiskSpaceCheck(unittest.TestCase):
242 "mountpoint": "/srv/instances"242 "mountpoint": "/srv/instances"
243 }243 }
244 ]244 ]
245 }245 },
246 {
247 "name": "vda",
248 "maj:min": "252:0",
249 "rm": false,
250 "size": "20G",
251 "ro": false,
252 "type": "disk",
253 "mountpoints": [
254 null
255 ],
256 "children": [
257 {
258 "name": "vda1",
259 "maj:min": "252:1",
260 "rm": false,
261 "size": "19.9G",
262 "ro": false,
263 "type": "part",
264 "mountpoints": [
265 "/srv/jammy"
266 ]
267 },{
268 "name": "vda14",
269 "maj:min": "252:14",
270 "rm": false,
271 "size": "4M",
272 "ro": false,
273 "type": "part",
274 "mountpoints": [
275 null
276 ]
277 }
278 ]
279 }
246 ]280 ]
247 }"""281 }"""
248282
@@ -254,3 +288,4 @@ class TestDiskSpaceCheck(unittest.TestCase):
254 self.assertEqual("/boot/efi" in result, False)288 self.assertEqual("/boot/efi" in result, False)
255 self.assertEqual("/" in result, True)289 self.assertEqual("/" in result, True)
256 self.assertEqual("/srv/instances" in result, True)290 self.assertEqual("/srv/instances" in result, True)
291 self.assertEqual("/srv/jammy" in result, True)

Subscribers

People subscribed via source and target branches

to all changes: