Dan Kenigsberg has posted comments on this change.

Change subject: v2v: cleanup v2v directory leftovers
......................................................................


Patch Set 12:

(4 comments)

https://gerrit.ovirt.org/#/c/39789/12/vdsm/v2v.py
File vdsm/v2v.py:

Line 214: 
Line 215: 
Line 216: def clean_leftovers():
Line 217:     logging.debug('Cleaning v2v leftovers')
Line 218:     for ovf in glob.iglob('%s/*.ovf' % _V2V_DIR):
os.path.join() is nicer
Line 219:         try:
Line 220:             logging.info('Removing ovf file %r', ovf)
Line 221:             os.remove(ovf)
Line 222:         except Exception as e:


Line 216: def clean_leftovers():
Line 217:     logging.debug('Cleaning v2v leftovers')
Line 218:     for ovf in glob.iglob('%s/*.ovf' % _V2V_DIR):
Line 219:         try:
Line 220:             logging.info('Removing ovf file %r', ovf)
logging.info() should not sit in the try-block
Line 221:             os.remove(ovf)
Line 222:         except Exception as e:
Line 223:             logging.error('Cannot remove file: %s, err: %s', ovf, e)
Line 224: 


Line 219:         try:
Line 220:             logging.info('Removing ovf file %r', ovf)
Line 221:             os.remove(ovf)
Line 222:         except Exception as e:
Line 223:             logging.error('Cannot remove file: %s, err: %s', ovf, e)
if we want to remove the ovf, we should not ignore this failure. if we don't 
care about the failure, we should not attempt to remove.
Line 224: 
Line 225:     for tmp in glob.glob('%s/*.tmp' % _V2V_DIR):
Line 226:         try:
Line 227:             logging.warn('Removing password file %r', tmp)


Line 221:             os.remove(ovf)
Line 222:         except Exception as e:
Line 223:             logging.error('Cannot remove file: %s, err: %s', ovf, e)
Line 224: 
Line 225:     for tmp in glob.glob('%s/*.tmp' % _V2V_DIR):
glob.glob -> glob.iglob
Line 226:         try:
Line 227:             logging.warn('Removing password file %r', tmp)
Line 228:             os.remove(tmp)
Line 229:         except Exception as e:


-- 
To view, visit https://gerrit.ovirt.org/39789
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic2f5b63863f4f7dc85d6af0ca015099274715441
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Shahar Havivi <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to