diff options
author | Marco Capitani <m.capitani@nextworks.it> | 2017-04-10 12:07:16 +0200 |
---|---|---|
committer | Marco Capitani <m.capitani@nextworks.it> | 2017-04-10 12:07:16 +0200 |
commit | 8797eff49aede4ad06ba668e4cee59accc12d1af (patch) | |
tree | bf3213073ff88ae3683acae5d3e2b9f2e07a0877 /rumba/model.py | |
parent | ae113f8d19eb29a0edb50bf790275414125f78ca (diff) | |
download | rumba-8797eff49aede4ad06ba668e4cee59accc12d1af.tar.gz rumba-8797eff49aede4ad06ba668e4cee59accc12d1af.zip |
Forced teardown. Ignores errors and makes sure that everything is pulled down.
Diffstat (limited to 'rumba/model.py')
-rw-r--r-- | rumba/model.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/rumba/model.py b/rumba/model.py index 99bf5ed..faf353c 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -615,12 +615,13 @@ class Experiment: raise Exception('run_prototype() method not implemented') def run(self): - # Realize the experiment testbed (testbed-specific) - self.testbed.swap_in(self) - - # Run the experiment using the prototype (prototype-specific) - self.run_prototype() - - # Undo the testbed (testbed-specific) - self.testbed.swap_out(self) + try: + # Realize the experiment testbed (testbed-specific) + self.testbed.swap_in(self) + + # Run the experiment using the prototype (prototype-specific) + self.run_prototype() + finally: + # No matter what happens, undo the testbed (testbed-specific) + self.testbed.swap_out(self) |