diff options
author | ahothan <ahothan@cisco.com> | 2017-09-16 00:17:22 -0700 |
---|---|---|
committer | ahothan <ahothan@cisco.com> | 2017-10-20 00:37:13 -0700 |
commit | a304887b78e7d3d4786ecbe367c681d2f5d3926a (patch) | |
tree | 2bfd77144f4a206cefd31519bf70b425c5d0e492 /nfvbench/chain_managers.py | |
parent | ca96a3aa9ccb88f2b041506b46bb628df74e64f8 (diff) |
StatsManager must clean up self when there is an exception in __init__
ALso remove unused connection.py
Change-Id: I1bf688ade511f2054e9d67edf8938df1988e4cb2
Signed-off-by: ahothan <ahothan@cisco.com>
Diffstat (limited to 'nfvbench/chain_managers.py')
-rw-r--r-- | nfvbench/chain_managers.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nfvbench/chain_managers.py b/nfvbench/chain_managers.py index fe3a2d4..033eb7a 100644 --- a/nfvbench/chain_managers.py +++ b/nfvbench/chain_managers.py @@ -85,8 +85,14 @@ class StatsManager(object): WORKER_CLASS = self.factory.get_chain_worker(self.specs.openstack.encaps, self.config.service_chain) self.worker = WORKER_CLASS(self.config, self.clients, self.specs) - self.worker.set_vlans(self.vlans) - self._config_interfaces() + try: + self.worker.set_vlans(self.vlans) + self._config_interfaces() + except Exception as exc: + # since the wrorker is up and running, we need to close it + # in case of exception + self.close() + raise exc def _get_data(self): return self.worker.get_data() |