Alex Lourie has posted comments on this change.

Change subject: packaging: allow interactive NFS exports cleanup during 
engine-cleanup
......................................................................


Patch Set 2: (3 inline comments)

....................................................
File packaging/fedora/setup/nfsutils.py
Line 36: def cleanNfsExports(comment, exportFilePath=basedefs.FILE_ETC_EXPORTS):
Line 37:     """
Line 38:     Remove all the lines added by engine-setup marked by comment from
Line 39:     exportFilePath.
Line 40:     """
if not "#" in comment:
  comment = "# " + comment
Line 41:     removed_exports = []
Line 42:     with open(exportFilePath, "r+") as exportFile:
Line 43:         lines = exportFile.readlines()
Line 44:         exportFile.seek(0, os.SEEK_SET)


Line 42:     with open(exportFilePath, "r+") as exportFile:
Line 43:         lines = exportFile.readlines()
Line 44:         exportFile.seek(0, os.SEEK_SET)
Line 45:         for line in lines:
Line 46:             if line.find(comment) != -1:
Why not

if comment in line: ?
Line 47:                 logging.debug("removing %s from %s" % (line, 
exportFilePath))
Line 48:                 path = line[:line.find("\t")]
Line 49:                 removed_exports.append(path)
Line 50:                 continue


Line 44:         exportFile.seek(0, os.SEEK_SET)
Line 45:         for line in lines:
Line 46:             if line.find(comment) != -1:
Line 47:                 logging.debug("removing %s from %s" % (line, 
exportFilePath))
Line 48:                 path = line[:line.find("\t")]
path = line.split('#')[0]
Line 49:                 removed_exports.append(path)
Line 50:                 continue
Line 51:             exportFile.write(line)
Line 52:         exportFile.truncate()


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0548ab358d0cbed32ceff3ceacefc57f1c068df4
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to