Hello Sandro Bonazzola,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/28880

to review the following change.

Change subject: packaging: setup: ensure restarted services survive reboot
......................................................................

packaging: setup: ensure restarted services survive reboot

Ensure that hostile services restarted while upgrading
are started also after reboot.

Change-Id: I2333590beb9f4cabcc7eb68cbbacac85b453318d
Bug-Url: https://bugzilla.redhat.com/1083551
Signed-off-by: Sandro Bonazzola <[email protected]>
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M packaging/setup/plugins/ovirt-engine-common/base/system/hostile_services.py
1 file changed, 19 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/80/28880/1

diff --git 
a/packaging/setup/plugins/ovirt-engine-common/base/system/hostile_services.py 
b/packaging/setup/plugins/ovirt-engine-common/base/system/hostile_services.py
index 58bbe30..f110cbd 100644
--- 
a/packaging/setup/plugins/ovirt-engine-common/base/system/hostile_services.py
+++ 
b/packaging/setup/plugins/ovirt-engine-common/base/system/hostile_services.py
@@ -28,6 +28,7 @@
 from otopi import util
 from otopi import plugin
 
+
 from ovirt_engine_setup import constants as osetupcons
 
 
@@ -82,21 +83,30 @@
                     )
 
     @plugin.event(
-        stage=plugin.Stages.STAGE_CLEANUP,
+        stage=plugin.Stages.STAGE_CLOSEUP,
         condition=lambda self: (
             self._enabled and
-            self.environment.get(
-                osetupcons.CoreEnv.REMOVE,
-                False
-            )
+            self.environment[
+                osetupcons.CoreEnv.ACTION
+            ] != osetupcons.Const.ACTION_REMOVE
         ),
     )
     def _closeup(self):
+        """
+        Ensure that services we stopped while upgrading are
+        restarted and will start at reboot.
+        """
         for service in self._toStart:
-            self.services.state(
-                name=service,
-                state=True
-            )
+            if self.services.exists(service):
+                self.services.state(
+                    name=service,
+                    state=True
+                )
+                # See https://bugzilla.redhat.com/1083551
+                self.services.startup(
+                    name=service,
+                    state=True
+                )
 
 
 # vim: expandtab tabstop=4 shiftwidth=4


-- 
To view, visit http://gerrit.ovirt.org/28880
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2333590beb9f4cabcc7eb68cbbacac85b453318d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to