Alex Lourie has posted comments on this change.

Change subject: packaging: Clean pgpass file on engine-cleanup
......................................................................


Patch Set 4: I would prefer that you didn't submit this

(4 inline comments)

....................................................
File packaging/fedora/setup/engine-cleanup.py
Line 180:         logging.debug("Found pgpass file, backing current to %s" % 
(backupFile))
Line 181:         shutil.copyfile(basedefs.DB_PASS_FILE, backupFile)
Line 182: 
Line 183:     lines = []
Line 184:     with open(basedefs.DB_PASS_FILE, 'r') as f:
This will fail if the file doesn't exist. So I think you should move all the 
lines here into the "if" block.
Line 185:         lines = f.read().split('\n')
Line 186:         inEngine = None
Line 187:         newLines = lines[:]
Line 188:         for line in newLines:


Line 200:         for line in lines:
Line 201:             f.write("%s\n" % line)
Line 202: 
Line 203:     if cleanBackupFile:
Line 204:         logging.debug("Removing %s" % backupFile)
better use info here
Line 205:         os.remove(backupFile)
Line 206: 
Line 207:     logging.debug("Cleaning %s completed successfully" % 
basedefs.DB_PASS_FILE)
Line 208: 


Line 203:     if cleanBackupFile:
Line 204:         logging.debug("Removing %s" % backupFile)
Line 205:         os.remove(backupFile)
Line 206: 
Line 207:     logging.debug("Cleaning %s completed successfully" % 
basedefs.DB_PASS_FILE)
same
Line 208: 
Line 209: 
Line 210: class CA():
Line 211: 


Line 407:     # Backup and drop DB (only if 'basedefs.DB_NAME' db exists)
Line 408:     if db.exists() and options.drop_db:
Line 409:         runFunc([db.backup, db.drop, cleanPgpass], MSG_INFO_REMOVE_DB)
Line 410:     else:
Line 411:         cleanPgpass(False)
1. Use runFunc for consistency. To provide params for a function, run as double 
list
   runFunc([[cleanPgpass, False]], msg)
2. Do we need to clean .pgpass at all when DB is selected to be saved?
Line 412: 
Line 413:     # Remove CA
Line 414:     if ca.exists() and options.remove_ca:
Line 415:         runFunc([ca.backup, ca.remove], MSG_INFO_REMOVE_CA)


--
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: 4
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]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to