[node-patches] Change in ovirt-node[ovirt-3.5]: Local kdump changes for EL7

fabiand at redhat.com fabiand at redhat.com
Thu Jan 8 16:41:55 UTC 2015


Hello Ryan Barry,

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

    http://gerrit.ovirt.org/36707

to review the following change.

Change subject: Local kdump changes for EL7
......................................................................

Local kdump changes for EL7

kdump continues to change, and kdumpctl wants the dump path to
exist.

Restarting the kdump service does things differently from
kdumpctl. Use kdumpctl.

Change-Id: I0279e23957f2297b6f544f0171c205897ef8e0b2
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1175967
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/config/defaults.py
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/07/36707/1

diff --git a/src/ovirt/node/config/defaults.py b/src/ovirt/node/config/defaults.py
index 08ec246..37801d5 100755
--- a/src/ovirt/node/config/defaults.py
+++ b/src/ovirt/node/config/defaults.py
@@ -1118,7 +1118,12 @@
             def commit(self):
                 vals = {"default": "reboot",
                         "ext4": "/dev/HostVG/Data",
-                        "path": "/core"}
+                        "path": "core"}
+
+                # kdumpctl on EL7 doesn't like it if the path doesn't
+                # exist
+                if not os.path.isdir(os.path.join("/data", vals["path"])):
+                        os.makedirs(os.path.join("/data", vals["path"]))
 
                 _set_values(vals)
 
@@ -1252,7 +1257,13 @@
                 from ovirtnode.ovirtfunctions import unmount_config
 
                 try:
-                    system.service("kdump", "restart")
+                    if system.which("kdumpctl"):
+                        with open("/dev/null", "wb") as DEVNULL:
+                            utils.process.check_call(["kdumpctl", "restart"],
+                                                     stdout=DEVNULL,
+                                                     stderr=DEVNULL)
+                    else:
+                        system.service("kdump", "restart")
                 except utils.process.CalledProcessError as e:
                     self.logger.info("Failure while restarting kdump: %s" % e)
                     unmount_config("/etc/kdump.conf")


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0279e23957f2297b6f544f0171c205897ef8e0b2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list