lib: checkRouterVersion to determine version

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
Martin Winter 2018-09-06 15:52:43 -07:00 committed by Donald Sharp
parent 9ac2326ed0
commit 6bfe4b8bfc

View File

@ -970,6 +970,12 @@ class Router(Node):
Usage example: router.checkRouterVersion('>', '1.0')
"""
# Make sure we have version information first
if self.version == None:
self.version = self.cmd(os.path.join(self.daemondir, 'bgpd')+' -v').split()[2]
logger.info('{}: running version: {}'.format(self.name,self.version))
rversion = self.version
if rversion is None:
return False