From c9902bf6972d9d7d2d7b3ffac5905ad92f095453 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 28 Aug 2017 12:08:29 +0200 Subject: [PATCH] library: don't print traceback for configuration error It makes the output confusing. It's not a bug, but a user-error. --- library/network_connections.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/network_connections.py b/library/network_connections.py index 09ca7ed..2e0b1b6 100755 --- a/library/network_connections.py +++ b/library/network_connections.py @@ -860,7 +860,7 @@ class ArgValidator_ListConnections(ArgValidatorList): if connection['state'] == 'up' and 'type' in connection: pass elif not ArgUtil.connection_find_by_name(connection['name'], result, idx): - raise ValidationError(name + '[' + str(idx) + '].name', 'references non-existing connection "%s"' % (connection['name'])) + raise ValidationError(name + '[' + str(idx) + '].name', 'state "%s" references non-existing connection "%s"' % (connection['state'], connection['name'])) if 'type' in connection: if connection['master']: c = ArgUtil.connection_find_by_name(connection['master'], result, idx) @@ -1702,7 +1702,7 @@ class _AnsibleUtil: c = self.ARGS_CONNECTIONS.validate(self.params['connections']) except ValidationError as e: self.fail_json('configuration error: %s' % (e), - warn_traceback = True) + warn_traceback = False) self._connections = c return c