Rename config transformation method for easier understanding

This commit is contained in:
Kristóf Tóth 2018-07-06 12:31:25 +01:00
parent 7f583d8d1f
commit 7cfa63bacf

View File

@ -21,7 +21,7 @@ class YamlFSM(FSMBase):
return yaml.safe_load(ifile)
def setup_states(self):
self.for_config_states_and_transitions_do(self.patch_config_callbacks)
self.for_config_states_and_transitions_do(self.wrap_callbacks_with_subprocess_call)
self.states = [State(**state) for state in self.config['states']]
def setup_transitions(self):
@ -35,7 +35,7 @@ class YamlFSM(FSMBase):
what(json_obj)
@staticmethod
def patch_config_callbacks(json_obj):
def wrap_callbacks_with_subprocess_call(json_obj):
topatch = ('on_enter', 'on_exit', 'prepare', 'before', 'after')
for key in json_obj:
if key in topatch: