[node-patches] Change in ovirt-node[master]: ovirt-node-upgrade: catch exceptions that are being skipped ...

jboggs at redhat.com jboggs at redhat.com
Tue May 28 22:36:39 UTC 2013


Joey Boggs has posted comments on this change.

Change subject: ovirt-node-upgrade: catch exceptions that are being skipped over
......................................................................


Patch Set 1: (1 inline comment)

....................................................
File scripts/ovirt-node-upgrade.py
Line 297:             self._run_hooks("post-upgrade")
Line 298:             if self._options.reboot > 0:
Line 299:                 self._reboot(self._options.reboot)
Line 300:             self._logger.info("Upgrade Completed")
Line 301:             sys.exit(0)
Yes this actually kind've confusing, I did test it and python docs state:

A finally clause is always executed before leaving the try statement, whether an exception has occurred or not. When an exception has occurred in the try clause and has not been handled by an except clause (or it has occurred in a except or else clause), it is re-raised after the finally clause has been executed.

try:
    print "test"
#    raise RuntimeError("RE")
except:
    print "failed"
finally:
    print "run cleanup"


--------------

raising an exception:

failed

run cleanup

exception commented out

test

run cleanup
Line 302:         except Exception as e:
Line 303:             self._logger.exception('Error: Upgrade Failed: %s', e)
Line 304:             self._run_hooks("rollback")
Line 305:             self._logger.info("Upgrade Failed, Rollback Completed")


--
To view, visit http://gerrit.ovirt.org/14958
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iefde860477dc21ca231d5dc29d8b79ab364b2c3f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list