Alex Lourie has posted comments on this change.
Change subject: packaging: Clean pgpass file on engine-cleanup
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(3 inline comments)
Comments inside.
....................................................
File packaging/fedora/setup/engine-cleanup.py
Line 274: raise Exception(MSG_ERROR_DROP_DB % dbname)
Line 275: self.dropped = True
Line 276: logging.debug("DB Drop completed successfully")
Line 277:
Line 278: def cleanPgpass(self):
Suggestion: move this out of the class, make it stand alone utility function.
Line 279: '''
Line 280: This function cleans engine entries from pgpass file
Line 281: '''
Line 282:
Line 285: logging.debug("Found existing pgpass file, backing
current to %s" % (backupFile))
Line 286: shutil.copyfile(basedefs.DB_PASS_FILE, backupFile)
Line 287:
Line 288: lines = []
Line 289: with open (basedefs.DB_PASS_FILE, 'r') as f:
no need for space here
Line 290: lines = f.read().split('\n')
Line 291: inEngine = None
Line 292: newLines = lines[:]
Line 293: for line in newLines:
Line 298: lines.remove(line)
Line 299: inEngine=False
Line 300:
Line 301: if inEngine:
Line 302: lines.remove(line)
Please leave here one empty line, it would be more readable
Line 303: with open(basedefs.DB_PASS_FILE, 'w') as f:
Line 304: for line in lines:
Line 305: f.write("%s\n" % line)
Line 306:
--
To view, visit http://gerrit.ovirt.org/7320
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I21cbde71bf0a2181f8e0b8ed31205c26d16d2134
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Kiril Nesenko <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Kiril Nesenko <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches