Fail the setup if we can't connect to VPP; exit the daemon with non-zero value to force restart by systemd

This commit is contained in:
Pim van Pelt
2022-03-14 23:14:59 +00:00
parent 86512dd66b
commit 968c0abe2f
2 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,9 @@ class Agent(object):
def run(self): def run(self):
self.logger.info('Calling setup') self.logger.info('Calling setup')
self.setup() if not self.setup():
self.logger.error('Setup failed - exiting')
return
self.logger.info('Initial update') self.logger.info('Initial update')
self._update() self._update()

View File

@ -238,5 +238,7 @@ def main():
except KeyboardInterrupt: except KeyboardInterrupt:
a.stop() a.stop()
sys.exit(-1)
if __name__ == "__main__": if __name__ == "__main__":
main() main()