[node-patches] Change in ovirt-node[ovirt-3.6]: Remove hooks/on-shutdown/01-save-virtwho, add persistence to...

fabiand at redhat.com fabiand at redhat.com
Tue Dec 22 15:00:24 UTC 2015


Fabian Deutsch has uploaded a new change for review.

Change subject: Remove hooks/on-shutdown/01-save-virtwho, add persistence to inst
......................................................................

Remove hooks/on-shutdown/01-save-virtwho, add persistence to inst

Testing reveals that systemd's reverse ordering of services means
that shutdown hooks execute after /config is already umounted.

This appeared to work during development because the script was
tested (and triggered) before actually rebooting, so
/config/etc/virt-who.d/... already existed when persisting
individual (globbed) files.

Since /config is umounted, we need to just add this to the list
of files/folders which are persisted at install time.

Change-Id: I75df21a0e59fe8591a9989262344d1e872b278e2
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1209356
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M hooks/Makefile.am
D hooks/on-shutdown/01-save-virtwho.py
M src/ovirtnode/ovirtfunctions.py
3 files changed, 1 insertion(+), 31 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/18/50918/1

diff --git a/hooks/Makefile.am b/hooks/Makefile.am
index ff68c45..f008d35 100644
--- a/hooks/Makefile.am
+++ b/hooks/Makefile.am
@@ -16,15 +16,7 @@
 # also available at http://www.gnu.org/copyleft/gpl.html.
 
 onbootdir = $(libexecdir)/ovirt-node/hooks/on-boot
-onshutdowndir = $(libexecdir)/ovirt-node/hooks/on-shutdown
 
 dist_onboot_SCRIPTS = \
 	on-boot/03-validate-owner-ssh-keys \
 	$(NULL)
-
-dist_onshutdown_SCRIPTS = \
-	on-shutdown/01-save-virtwho.py
-
-install-data-hook:
-	mv $(DESTDIR)$(libexecdir)/ovirt-node/hooks/on-shutdown/01-save-virtwho.py \
-		$(DESTDIR)$(libexecdir)/ovirt-node/hooks/on-shutdown/01-save-virtwho
diff --git a/hooks/on-shutdown/01-save-virtwho.py b/hooks/on-shutdown/01-save-virtwho.py
deleted file mode 100755
index 9c5d6b1..0000000
--- a/hooks/on-shutdown/01-save-virtwho.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# 01-save-virtwho - Copyright (C) 2015 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-from glob import glob
-from ovirt.node.utils.fs import Config
-
-
-if __name__ == "__main__":
-    try:
-        Config().persist("/etc/virt-who.d/")
-    except:
-        "Couldn't persist %s!" % "/etc/virt-who.d"
-        raise
diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index d07eeb8..1194dde 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -84,6 +84,7 @@
                        "/var/lib/glusterd",
                        "/var/lib/rhsm",
                        "/etc/sysconfig/virt-who",
+                       "/etc/virt-who.d/",
                        "/etc/virt-who.conf"]
 
 OVIRT_VARS = {}


-- 
To view, visit https://gerrit.ovirt.org/50918
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75df21a0e59fe8591a9989262344d1e872b278e2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list