X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_object.py;h=a1cf42fce35385e74cb8a028ad9a1cd39af2d148;hb=b795bd0c5cadfc6734ee8b2355cbc3965be0a1c1;hp=0d74baa53aba86350d95ac4581ba3876ba1e72b2;hpb=acb9b8e8c3394d06964ad0f8387b764c01f43152;p=vpp.git diff --git a/test/vpp_object.py b/test/vpp_object.py index 0d74baa53ab..a1cf42fce35 100644 --- a/test/vpp_object.py +++ b/test/vpp_object.py @@ -46,9 +46,16 @@ class VppObjectRegistry(object): if obj.object_id() not in self._object_dict: self._object_registry.append(obj) self._object_dict[obj.object_id()] = obj + logger.debug("REG: registering %s" % obj) else: logger.debug("REG: duplicate add, ignoring (%s)" % obj) + def unregister_all(self, logger): + """ Remove all object registrations from registry. """ + logger.debug("REG: removing all object registrations") + self._object_registry = [] + self._object_dict = dict() + def remove_vpp_config(self, logger): """ Remove configuration (if present) from vpp and then remove all objects @@ -71,8 +78,7 @@ class VppObjectRegistry(object): for obj in self._object_registry: if obj.query_vpp_config(): failed.append(obj) - self._object_registry = [] - self._object_dict = dict() + self.unregister_all(logger) if failed: logger.error("REG: Couldn't remove configuration for object(s):") for obj in failed: