Change in vdsm[master]: v2v: cleanup v2v directory leftovers

nsoffer at redhat.com nsoffer at redhat.com
Wed Apr 15 11:40:02 UTC 2015


Nir Soffer has posted comments on this change.

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


Patch Set 2:

(2 comments)

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

Line 216: def clean_leftovers():
Line 217:     for f in glob('%s/*.ovf' % _V2V_DIR):
Line 218:         try:
Line 219:             os.remove(f)
Line 220:         except Exception as e:
> Mayb narrow down to (OSError, IOError) and also check errno?
If we use specific exception, we will fail to cleanup the next files, and then we are left with partial cleanup.

Since this must be called before starting the protocol acceptor, faling hard here will create zombie vdsm that does not respond to requests.
Line 221:             logging.warn('Cannot remove file: %s, err: %s', f, e)
Line 222: 
Line 223:     for f in glob('%s/*.tmp' % _V2V_DIR):
Line 224:         try:


Line 222: 
Line 223:     for f in glob('%s/*.tmp' % _V2V_DIR):
Line 224:         try:
Line 225:             os.remove(f)
Line 226:         except Exception as e:
> same
Here it is even more important to remove *all* found files even if one of them raises, we cannot use specific exception.
Line 227:             logging.warn('Cannot remove file: %s, err: %s', f, e)
Line 228: 
Line 229: 
Line 230: def _read_ovf(job_id):


-- 
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: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list