git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding state RELEASED in EC to allow two stage termination from the experiment runner
[nepi.git]
/
src
/
nepi
/
execution
/
ec.py
diff --git
a/src/nepi/execution/ec.py
b/src/nepi/execution/ec.py
index
2e573dd
..
58ece22
100644
(file)
--- a/
src/nepi/execution/ec.py
+++ b/
src/nepi/execution/ec.py
@@
-90,7
+90,8
@@
class ECState(object):
"""
RUNNING = 1
FAILED = 2
"""
RUNNING = 1
FAILED = 2
- TERMINATED = 3
+ RELEASED = 3
+ TERMINATED = 4
class ExperimentController(object):
"""
class ExperimentController(object):
"""
@@
-1033,6
+1034,9
@@
class ExperimentController(object):
:type guids: list
"""
:type guids: list
"""
+ if self._state == ECState.RELEASED:
+ return
+
if isinstance(guids, int):
guids = [guids]
if isinstance(guids, int):
guids = [guids]
@@
-1050,7
+1054,10
@@
class ExperimentController(object):
for guid in guids:
if self.get(guid, "hardRelease"):
for guid in guids:
if self.get(guid, "hardRelease"):
- self.remove_resource(guid)
+ self.remove_resource(guid)\
+
+ # Mark the EC state as RELEASED
+ self._state = ECState.RELEASED
def shutdown(self):
""" Releases all resources and stops the ExperimentController
def shutdown(self):
""" Releases all resources and stops the ExperimentController