[node-patches] Change in ovirt-node[master]: update ovirt_store_config_atomic filelist

jboggs at redhat.com jboggs at redhat.com
Wed Jan 2 19:31:57 UTC 2013


Joey Boggs has uploaded a new change for review.

Change subject: update ovirt_store_config_atomic filelist
......................................................................

update ovirt_store_config_atomic filelist

rhbz#871212

Change-Id: I83a98ec05431057b21137c18d11654bada06a708
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirtnode/ovirtfunctions.py
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/83/10583/1

diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index 109549b..9dc71be 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -793,10 +793,9 @@
             # handle non-existent files that need to be created
             if source is not None:
                 open(filename, 'a+').close()
-            with open('/config/files', 'r') as f:
-                if not filename in f:
-                    with open('/config/files', 'a+') as f:
-                        f.write("%s\n" % filename)
+            if not filename in open('/config/files','r').read():
+                with open('/config/files', 'a+') as f:
+                    f.write("%s\n" % filename)
                     logger.info("Successfully persisted: " + filename)
         except:
             if tmp_destination is not None and os.path.exists(tmp_destination):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83a98ec05431057b21137c18d11654bada06a708
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list