getattr() with no default is an AttributeError if missing (#32946)

pull/32949/head
Nathaniel Case 7 years ago committed by GitHub
parent 3089892e59
commit 21c8ab537b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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({

Loading…
Cancel
Save