diff --git a/changelogs/fragments/fips-ncclient-import-error.yaml b/changelogs/fragments/fips-ncclient-import-error.yaml new file mode 100644 index 00000000000..5a906d5be6c --- /dev/null +++ b/changelogs/fragments/fips-ncclient-import-error.yaml @@ -0,0 +1,2 @@ +bugfixes: + - netconf - catch and handle exception to prevent stack trace when running in FIPS mode diff --git a/lib/ansible/plugins/netconf/__init__.py b/lib/ansible/plugins/netconf/__init__.py index 95442e60e96..36d082b2c86 100644 --- a/lib/ansible/plugins/netconf/__init__.py +++ b/lib/ansible/plugins/netconf/__init__.py @@ -32,7 +32,10 @@ try: from ncclient.xml_ import to_xml, to_ele, NCElement HAS_NCCLIENT = True NCCLIENT_IMP_ERR = None -except (ImportError, AttributeError) as err: # paramiko and gssapi are incompatible and raise AttributeError not ImportError +# paramiko and gssapi are incompatible and raise AttributeError not ImportError +# When running in FIPS mode, cryptography raises InternalError +# https://bugzilla.redhat.com/show_bug.cgi?id=1778939 +except Exception as err: HAS_NCCLIENT = False NCCLIENT_IMP_ERR = err