Skip to content

Commit c244a07

Browse files
committed
Fix: Use atomic writes for Mongoose webhooks to prevent rule loading failures
1 parent 3b9f098 commit c244a07

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

pirogue-admin/debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
pirogue-admin (2.0.14) bookworm; urgency=medium
2+
3+
* Fix: Use atomic writes for Mongoose webhooks to prevent rule loading failures
4+
5+
-- Christophe Andral <christophe@andral.fr> Mon, 30 Mar 2026 18:53:44 +0200
6+
17
pirogue-admin (2.0.13) bookworm; urgency=medium
28

39
* Device monitoring management

pirogue-admin/pirogue_admin/daemon/servicers_impl.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,16 +719,20 @@ def AddDeviceMonitoring(self, request, context):
719719
payload = MessageToDict(request, preserving_proto_field_name=True)
720720
payload.pop('name', None)
721721

722-
yaml_file = Path(self._base_configuration_context.pirogue_working_root_dir,
723-
f"var/lib/mongoose/webhook.d/{monitoring_name}.yaml")
722+
tmp_yaml_file = Path(f"/tmp/{monitoring_name}.yaml")
724723

725-
with open(yaml_file, 'w') as out_fd:
724+
with open(tmp_yaml_file, 'w') as out_fd:
726725
yaml.safe_dump(payload, out_fd,
727726
sort_keys=False,
728727
default_flow_style=False,
729728
encoding="utf-8",
730729
allow_unicode=True)
731730

731+
yaml_file = Path(self._base_configuration_context.pirogue_working_root_dir,
732+
f"var/lib/mongoose/webhook.d/{monitoring_name}.yaml")
733+
734+
os.rename(tmp_yaml_file, yaml_file)
735+
732736
return EMPTY
733737

734738
def DeleteDeviceMonitoring(self, request, context):

pirogue-admin/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespaces = false
99

1010
[project]
1111
name = "pirogue-admin"
12-
version = "2.0.13"
12+
version = "2.0.14"
1313
description = "Admin management for the PiRogue"
1414
readme = "README.md"
1515
license = { text = "GPL-3.0-or-later" }

0 commit comments

Comments
 (0)