Juan Hernandez has posted comments on this change.

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


Patch Set 4: (1 inline comment)

....................................................
File packaging/fedora/setup/engine-cleanup.py
Line 173: def cleanPgpass(cleanBackupFile=True):
Line 174:     '''
Line 175:     This function cleans engine entries from pgpass file
Line 176:     '''
Line 177: 
What happens if the .pgpass file doesn't exist? Certainly unlikely, but if that 
happens you will get an exception when trying to open for read.

Can you please check for existence first thing, something like:

  # Nothing to do if the .pgpass file doesn't exist:
  if not os.path.exists(basedefs.DB_PASS_FILE):
     logging.debug("The .pgpass file doesn't exist.")
     return

Then you can run the rest of the code safely knowing that it does exist.
Line 178:     if os.path.exists(basedefs.DB_PASS_FILE):
Line 179:         backupFile = "%s.%s" % (basedefs.DB_PASS_FILE, 
utils.getCurrentDateTime())
Line 180:         logging.debug("Found pgpass file, backing current to %s" % 
(backupFile))
Line 181:         shutil.copyfile(basedefs.DB_PASS_FILE, backupFile)


--
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