[bug#77041,12/16] services: ganeti: Update to Shepherd 1.0 interface.

Message ID 8719086cc46a85760d78bf1515b2b0684462bcb9.1742073920.git.ludo@gnu.org
State New
Headers
Series Replacing mcron jobs by Shepherd timers |

Commit Message

Ludovic Courtès March 15, 2025, 9:37 p.m. UTC
  * gnu/services/ganeti.scm (shepherd-wconfd-force-start-action)[procedure]:
Use ‘enable-service’ and ‘perform-service-action’ instead of ‘action’,
which was deprecated in 0.10.x and replaced in 1.0.

Change-Id: I2ba7d973b95f17f6ce093185fec7b246cf427be9
---
 gnu/services/ganeti.scm | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
  

Patch

diff --git a/gnu/services/ganeti.scm b/gnu/services/ganeti.scm
index ee72946c88..f905ab8395 100644
--- a/gnu/services/ganeti.scm
+++ b/gnu/services/ganeti.scm
@@ -329,18 +329,17 @@  (define shepherd-wconfd-force-start-action
     "Forcefully start wconfd even on non-master nodes (dangerous!).")
    (procedure #~(lambda _
                   (format #t "Forcefully starting the wconfd daemon...~%")
-                  (action 'ganeti-wconfd 'enable)
-                  (dynamic-wind
-                    (lambda ()
-                      (false-if-exception
-                       (call-with-output-file #$%wconfd-force-node-hint
-                         (lambda (port)
-                           (const #t)))))
-                    (lambda ()
-                      (action 'ganeti-wconfd 'restart))
+                  (enable-service (lookup-service 'ganeti-wconfd))
+                  (call-with-output-file #$%wconfd-force-node-hint
+                    (const #t))
+                  (catch #t
                     (lambda ()
+                      (perform-service-action (lookup-service 'ganeti-wconfd)
+                                              'restart)
+                      (delete-file #$%wconfd-force-node-hint))
+                    (lambda _
                       (delete-file #$%wconfd-force-node-hint)))
-                    #t))))
+                  #t))))
 
 (define ganeti-wconfd-service
   (match-lambda