Ondřej Svoboda has posted comments on this change.
Change subject: hook: after_network_setup_fail
......................................................................
Patch Set 16:
(3 comments)
https://gerrit.ovirt.org/#/c/45085/16//COMMIT_MSG
Commit Message:
Line 11:
Line 12: This hook point triggers hooks right after setupNetworks fails and
Line 13: finishes its rollback.
Line 14:
Line 15: We need this for Open vSwitch hook.
This might be useful for other case as well, without giving any
examples, e
+1
Petr, it would be nice if you added this "but" :-)
Line 16:
Line 17: Change-Id: I8a5d086b15b72c13d2b390c1310c2279446ac14f
https://gerrit.ovirt.org/#/c/45085/16/vdsm/API.py
File vdsm/API.py:
Line 1488: self._cif._netConfigDirty = True
Line 1489: network_setup_failed = False
Line 1490:
Line 1491: with self._rollback() as rollbackCtx:
Line 1492: try:
the try an except won't work here IIUC, since
I think it
will do its job, which is just to set network_setup_failed to True and reraise any
exception.
But I guess you should do what Ido suggests: to look at rollbackCtx['status'] and
see if it matches doneCode (which is a very bad name for a constant, BTW).
Line 1493: supervdsm.getProxy().setupNetworks(networks, bondings,
Line 1494: options)
Line 1495: except:
Line 1496: network_setup_failed = True
Line 1495: except:
Line 1496: network_setup_failed = True
Line 1497: raise
Line 1498:
Line 1499: if network_setup_failed is not None:
how can this be None? you initialized it False
Yeah,
if network_setup_failed:
appears enough.
Line 1500: _after_network_setup_fail(networks, bondings, options)
Line 1501: return rollbackCtx
Line 1502: except hooks.HookError as e:
Line 1503: _after_network_setup_fail(networks, bondings, options)
--
To view, visit
https://gerrit.ovirt.org/45085
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8a5d086b15b72c13d2b390c1310c2279446ac14f
Gerrit-PatchSet: 16
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda(a)redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes