[node-patches] Change in ovirt-node[master]: ovirtfunctions: Prevent recursion in safe_delete

fabiand at fedoraproject.org fabiand at fedoraproject.org
Wed May 7 14:28:29 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: ovirtfunctions: Prevent recursion in safe_delete
......................................................................

ovirtfunctions: Prevent recursion in safe_delete

Change-Id: Ic2e89492f4c18c1afd41e399e854fc9be4f091eb
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirtnode/ovirtfunctions.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/76/27476/1

diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index b46a42f..bb64ced 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -1091,7 +1091,11 @@
             ls_cmd = subprocess_closefds("ls -d '%s'" % filename, shell=True, stdout=PIPE, stderr=STDOUT)
             output, err = ls_cmd.communicate()
             for child in output:
-                ovirt_safe_delete_config(child)
+                if os.path.realpath(filename) == os.path.realpath(child):
+                    # Child == Parent - Don't recurse
+                    pass
+                else:
+                    ovirt_safe_delete_config(child)
             system("rm -rf /config'%s'" % filename)
             system("rm -rf '%s'" % filename)
         else:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2e89492f4c18c1afd41e399e854fc9be4f091eb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list