mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 08:32:45 +00:00
topogen: show pretty output for skipped messages
Format them properly instead of printing a dictionary.
This commit is contained in:
parent
333139b22e
commit
1eb633c012
@ -109,7 +109,8 @@ class Topogen(object):
|
|||||||
self.routern = 1
|
self.routern = 1
|
||||||
self.switchn = 1
|
self.switchn = 1
|
||||||
self.modname = modname
|
self.modname = modname
|
||||||
self.errors = {}
|
self.errorsd = {}
|
||||||
|
self.errors = ''
|
||||||
self.peern = 1
|
self.peern = 1
|
||||||
self._init_topo(cls)
|
self._init_topo(cls)
|
||||||
logger.info('loading topology: {}'.format(self.modname))
|
logger.info('loading topology: {}'.format(self.modname))
|
||||||
@ -357,13 +358,14 @@ class Topogen(object):
|
|||||||
|
|
||||||
# If no code is defined use a sequential number
|
# If no code is defined use a sequential number
|
||||||
if code is None:
|
if code is None:
|
||||||
code = len(self.errors)
|
code = len(self.errorsd)
|
||||||
|
|
||||||
self.errors[code] = message
|
self.errorsd[code] = message
|
||||||
|
self.errors += '\n{}: {}'.format(code, message)
|
||||||
|
|
||||||
def has_errors(self):
|
def has_errors(self):
|
||||||
"Returns whether errors exist or not."
|
"Returns whether errors exist or not."
|
||||||
return len(self.errors) > 0
|
return len(self.errorsd) > 0
|
||||||
|
|
||||||
def routers_have_failure(self):
|
def routers_have_failure(self):
|
||||||
"Runs an assertion to make sure that all routers are running."
|
"Runs an assertion to make sure that all routers are running."
|
||||||
|
Loading…
Reference in New Issue
Block a user