Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
VPP-1299: Reset uid/gid on shared memory segment if client starts first.
[vpp.git]
/
test
/
vpp_object.py
diff --git
a/test/vpp_object.py
b/test/vpp_object.py
index
61a96ec
..
088cc39
100644
(file)
--- 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)
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
def remove_vpp_config(self, logger):
"""
Remove configuration (if present) from vpp and then remove all objects
@@
-60,20
+66,18
@@
class VppObjectRegistry(object):
return
logger.info("REG: Removing VPP configuration for registered objects")
# remove the config in reverse order as there might be dependencies
return
logger.info("REG: Removing VPP configuration for registered objects")
# remove the config in reverse order as there might be dependencies
+ failed = []
for obj in reversed(self._object_registry):
if obj.query_vpp_config():
logger.info("REG: Removing configuration for %s" % obj)
obj.remove_vpp_config()
for obj in reversed(self._object_registry):
if obj.query_vpp_config():
logger.info("REG: Removing configuration for %s" % obj)
obj.remove_vpp_config()
+ if obj.query_vpp_config():
+ failed.append(obj)
else:
logger.info(
"REG: Skipping removal for %s, configuration not present" %
obj)
else:
logger.info(
"REG: Skipping removal for %s, configuration not present" %
obj)
- failed = []
- 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:
if failed:
logger.error("REG: Couldn't remove configuration for object(s):")
for obj in failed: