Alon Bar-Lev has uploaded a new change for review.
Change subject: bootstrap: remove temporary files even if some missing ......................................................................
bootstrap: remove temporary files even if some missing
Current code simply skip the whole process if one temporary file is missing.
We need to remove as much temporary files as possible, so ignore single file exception.
Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Signed-off-by: Alon Bar-Lev alonbl@redhat.com --- M vdsm_reg/deployUtil.py.in 1 file changed, 22 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/7302/1
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in index 5521fed..0f31b27 100644 --- a/vdsm_reg/deployUtil.py.in +++ b/vdsm_reg/deployUtil.py.in @@ -189,33 +189,36 @@ logging.debug("setCoreDumpPath end:" + str(fReturn)) return fReturn
+def _removeNoError(file): + try: + os.remove(file) + except OSError: + pass + def cleanAll(random_num): """ Remove temp files. """ - fReturn = True - try: - for f in ( - '/vds_bootstrap_%s.py' % random_num, - '/vds_bootstrap_complete_%s.py' % random_num, - '/deployUtil.py' - ): - os.unlink(_WORK_DIR + f) - os.unlink(_WORK_DIR + f + "c")
- for f in ( - '/req_%s.conf' % random_num, - '/cert_%s.req' % random_num, - '/cert_%s.pem' % random_num, - '/CA_%s.pem' % random_num - ): - os.unlink(_WORK_DIR + f) - except: - pass + for f in ( + '/vds_bootstrap_%s.py' % random_num, + '/vds_bootstrap_complete_%s.py' % random_num, + '/deployUtil.py' + ): + _removeNoError(_WORK_DIR + f) + _removeNoError(_WORK_DIR + f + "c") + + for f in ( + '/req_%s.conf' % random_num, + '/cert_%s.req' % random_num, + '/cert_%s.pem' % random_num, + '/CA_%s.pem' % random_num + ): + _removeNoError(_WORK_DIR + f)
print "<BSTRAP component='cleanAll' status='OK'/>" logging.debug("cleanAll end:" + str(fReturn))
- return fReturn + return True
def setVdsConf(configStr, confFile): """
-- To view, visit http://gerrit.ovirt.org/7302 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: bootstrap: remove temporary files even if some missing ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/509/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7302 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: bootstrap: remove temporary files even if some missing ......................................................................
Patch Set 2: Verified
-- To view, visit http://gerrit.ovirt.org/7302 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: bootstrap: remove temporary files even if some missing ......................................................................
Patch Set 2:
I can live with a more brutal remove.
-- To view, visit http://gerrit.ovirt.org/7302 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: bootstrap: remove temporary files even if some missing ......................................................................
Patch Set 2: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/7302 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: bootstrap: remove temporary files even if some missing ......................................................................
bootstrap: remove temporary files even if some missing
Current code simply skip the whole process if one temporary file is missing.
We need to remove as much temporary files as possible, so ignore single file exception.
Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Signed-off-by: Alon Bar-Lev alonbl@redhat.com --- M vdsm_reg/deployUtil.py.in 1 file changed, 23 insertions(+), 20 deletions(-)
Approvals: Alon Bar-Lev: Verified Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/7302 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I7f69af679e798846e15faa0b9674aeeadc6d01e4 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org