Dan Kenigsberg has posted comments on this change.

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


Patch Set 3: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/27476/3/src/ovirtnode/ovirtfunctions.py
File src/ovirtnode/ovirtfunctions.py:

Line 1090:         if os.path.isdir(filename):
Line 1091:             ls_cmd = subprocess_closefds("ls -d '%s'" % filename, 
shell=True, stdout=PIPE, stderr=STDOUT)
Line 1092:             output, err = ls_cmd.communicate()
Line 1093:             for child in output:
Line 1094:                 is_same = os.path.realpath(filename) == 
os.path.realpath(child)
there's no need for the extra "is_same" check: if the child is "the same" as 
the parent, it can only be that it's a softlink to the parent.
Line 1095:                 is_link = os.path.islink(child)
Line 1096:                 if is_same or is_link:
Line 1097:                     # Child == Parent OR symlink - Don't recurse
Line 1098:                     pass


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic2e89492f4c18c1afd41e399e854fc9be4f091eb
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
node-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/node-patches

Reply via email to