Petr Horáček has uploaded a new change for review. Change subject: networkTests: assertBondDoesntExist with nics=None ......................................................................
networkTests: assertBondDoesntExist with nics=None When assertBondDoesntExist is used with nics=None, it raises an error "'NoneType' object is not iterable". I changed it to assert nics only when defined. Change-Id: I43da6b2b6d7cfb79a64c37600477a69831acbf94 Signed-off-by: Petr Horáček <[email protected]> --- M tests/functional/networkTests.py 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/31334/1 diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py index 038dde2..35f6eb4 100644 --- a/tests/functional/networkTests.py +++ b/tests/functional/networkTests.py @@ -241,9 +241,12 @@ def assertBondDoesntExist(self, bondName, nics=None): netinfo = self.vdsm_net.netinfo config = self.vdsm_net.config - self.assertTrue(bondName not in netinfo.bondings or (set(nics) != - set(netinfo.bondings[bondName]['slaves'])), - '%s found unexpectedly' % bondName) + self.assertNotIn(bondName, netinfo.bondings, + '%s found unexpectedly' % bondName) + if nics is not None: + self.assertNotEqual(set(nics), + set(netinfo.bondings[bondName]['slaves']), + '%s found unexpectedly' % bondName) if config is not None: self.assertTrue(bondName not in config.bonds or (set(nics) != set(config.bonds[bondName].get('nics'))), -- To view, visit http://gerrit.ovirt.org/31334 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43da6b2b6d7cfb79a64c37600477a69831acbf94 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Petr Horáček <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
