Skip to content

Commit

Permalink
Prepare _respawn_when_dead method
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceaulinic committed Mar 31, 2017
1 parent 8e78092 commit 8184c2b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion napalm_logs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def _verify_config(self):
self._verify_config_dict(VALID_CONFIG, dev_config, dev_os)
log.debug('Read the config without error \o/')


def _build_config(self):
'''
Build the config of the napalm syslog parser.
Expand Down Expand Up @@ -208,6 +207,20 @@ def _build_config(self):
continue
self.config_dict[nos].update(nos_config)

def _respawn_when_dead(self, pid, start_fun, shut_fun=None):
'''
Restart a process when dead.
Requires a thread checking the status using the PID:
if not alive anymore, restart.
:param pid: The process ID.
:param start_fun: The process start function.
:param shut_fun: the process shutdown function. Not mandatory.
'''
# TODO
# TODO requires a fun per process type: server, listener, device
pass

def start_engine(self):
'''
Start the child processes (one per device OS),
Expand Down

0 comments on commit 8184c2b

Please sign in to comment.