Commit d6aa2cd2 authored by Antoine Kaufmann's avatar Antoine Kaufmann Committed by Hejing Li
Browse files

orchestration/nodeconfig.py: pass node cfg to app cfg prepare cmds

parent f2ed27e5
...@@ -35,11 +35,11 @@ class AppConfig(): ...@@ -35,11 +35,11 @@ class AppConfig():
"""Commands to run for this application.""" """Commands to run for this application."""
return [] return []
def prepare_pre_cp(self) -> tp.List[str]: def prepare_pre_cp(self, node: NodeConfig) -> tp.List[str]:
"""Commands to run to prepare this application before checkpointing.""" """Commands to run to prepare this application before checkpointing."""
return [] return []
def prepare_post_cp(self) -> tp.List[str]: def prepare_post_cp(self, node: NodeConfig) -> tp.List[str]:
"""Commands to run to prepare this application after the checkpoint is """Commands to run to prepare this application after the checkpoint is
restored.""" restored."""
return [] return []
...@@ -110,8 +110,8 @@ class NodeConfig(): ...@@ -110,8 +110,8 @@ class NodeConfig():
cp_es = ['echo ready to checkpoint'] cp_es = ['echo ready to checkpoint']
exit_es = ['poweroff -f'] exit_es = ['poweroff -f']
es = self.prepare_pre_cp() + self.app.prepare_pre_cp() + cp_es + \ es = self.prepare_pre_cp() + self.app.prepare_pre_cp(self) + cp_es + \
self.prepare_post_cp() + self.app.prepare_post_cp() + \ self.prepare_post_cp() + self.app.prepare_post_cp(self) + \
self.run_cmds() + self.cleanup_cmds() + exit_es self.run_cmds() + self.cleanup_cmds() + exit_es
return '\n'.join(es) return '\n'.join(es)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment