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:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user