Introduce a CLI object

Instead of writing the CLI calls to stderr as INFO loglines, now add
them to a list of messages by prune/create/sync.

Always close the VPP connection after finishing, by adding a destructor
to the VPPApi class.

At the end of each phase, print out what was gathered to stdout. Later,
I will make this more advanced (output to file, output directly to a
pipe of a running vppctl binary, etc).
This commit is contained in:
Pim van Pelt
2022-03-29 14:04:53 +00:00
parent 7c8f36d1fe
commit f70bff400f
3 changed files with 150 additions and 78 deletions

View File

@ -56,6 +56,7 @@ class VPPApi():
if not self.connected:
return True
self.vpp.disconnect()
self.logger.debug('Disconnected from VPP')
self.connected = False
return True