Ido Barkan has uploaded a new change for review.

Change subject: net: always persist owned ifcfg files on ovirt node
......................................................................

net: always persist owned ifcfg files on ovirt node

Change-Id: Ibc717b86194a32c050d346e235a5c35fd318e1ff
Signed-off-by: Ido Barkan <ibar...@redhat.com>
---
M vdsm/network/configurators/ifcfg.py
M vdsm/vdsm-store-net-config.in
2 files changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/44112/1

diff --git a/vdsm/network/configurators/ifcfg.py 
b/vdsm/network/configurators/ifcfg.py
index f2dbd5e..83b95f9 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -479,10 +479,6 @@
         self._backup(fileName)
         configuration = self.CONFFILE_HEADER + '\n' + configuration
 
-        # make sure that ifcfg files are never persisted by the node
-        if self.unifiedPersistence and utils.isOvirtNode():
-            node_fs.Config().unpersist(fileName)
-
         logging.debug('Writing to file %s configuration:\n%s', fileName,
                       configuration)
         with open(fileName, 'w') as confFile:
diff --git a/vdsm/vdsm-store-net-config.in b/vdsm/vdsm-store-net-config.in
index c19d5e0..4e84fb7 100755
--- a/vdsm/vdsm-store-net-config.in
+++ b/vdsm/vdsm-store-net-config.in
@@ -37,8 +37,17 @@
     rm -rf "$NET_CONF_BACK_DIR"/*
 }
 
+node_persist_owned_ifcfgs() {
+    for f in $(find "$NET_CONF_DIR" -type f); do
+        if grep -q "# Generated by VDSM version" $f; then
+            ovirt_store_config "$f"
+        fi
+    done
+}
+
 unified_node_persist() {
     unified_nonnode_persist
+    node_persist_owned_ifcfgs
 
     # oVirt node ovirt_store_config puts the dir in persistent storage and
     # bind mounts it in the original place. So that's all we really need to do.


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc717b86194a32c050d346e235a5c35fd318e1ff
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibar...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to