added warnings list to module and autoadd

added better way of adding warnings to return data
backwards compatible if warnings key already exists
added deprecations made iface more generic
changed to enforce type per item
added logging of warnings/deprecations
also display deprecations by default
This commit is contained in:
Brian Coca
2016-11-16 21:29:30 -05:00
committed by Brian Coca
parent d6ea400efb
commit 7e6758873c
2 changed files with 62 additions and 14 deletions

View File

@@ -99,9 +99,13 @@ class CallbackBase:
def _handle_warnings(self, res):
''' display warnings, if enabled and any exist in the result '''
if C.COMMAND_WARNINGS and 'warnings' in res and res['warnings']:
for warning in res['warnings']:
self._display.warning(warning)
if C.COMMAND_WARNINGS:
if 'warnings' in res and res['warnings']:
for warning in res['warnings']:
self._display.warning(warning)
if 'deprecations' in res and res['deprecations']:
for warning in res['deprecations']:
self._display.deprecated(warning)
def _get_diff(self, difflist):