From 21c8ab537bf96893d0f6bff42efb754efb7083a7 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Wed, 15 Nov 2017 15:40:32 -0500 Subject: [PATCH] getattr() with no default is an AttributeError if missing (#32946) --- bin/ansible-connection | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ansible-connection b/bin/ansible-connection index eed348f431..ced24ee47b 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -299,7 +299,7 @@ def main(): except Exception as exc: # Only network_cli has update_play context, so missing this is # not fatal e.g. netconf - if isinstance(exc, ConnectionError) and getattr(exc, 'code') == -32601: + if isinstance(exc, ConnectionError) and getattr(exc, 'code', None) == -32601: pass else: result.update({