diff options
author | Klement Sekera <ksekera@cisco.com> | 2017-03-02 11:29:19 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-03-06 16:17:21 +0000 |
commit | 1b686409307d4c7b29ee3b065c4d010a275a0fd1 (patch) | |
tree | 04aefe1b97a95d1c7389d18a077e9360798996ba /test/vpp_object.py | |
parent | 80a7f0a81cf6bc58cd7567c7b5e1c75813b5fc0c (diff) |
make test: reset object registry if vpp dies
Change-Id: If0e30837e07a21f3912676f5147cb242d3d2b235
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/vpp_object.py')
-rw-r--r-- | test/vpp_object.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/vpp_object.py b/test/vpp_object.py index 61a96ec2993..a1cf42fce35 100644 --- a/test/vpp_object.py +++ b/test/vpp_object.py @@ -50,6 +50,12 @@ class VppObjectRegistry(object): 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 @@ -72,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: |