From 4bd105cfaf7f6601947fdfe02fc43925b5e8e049 Mon Sep 17 00:00:00 2001 From: Kate Case Date: Wed, 1 Mar 2023 17:19:49 -0500 Subject: [PATCH] Fix potential UnboundLocalError on docs (#513) * Fix potential NameError on docs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- changelogs/fragments/ule-docs.yaml | 4 ++++ galaxy.yml | 2 +- plugins/action/network_resource.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ule-docs.yaml diff --git a/changelogs/fragments/ule-docs.yaml b/changelogs/fragments/ule-docs.yaml new file mode 100644 index 000000000..35240a6de --- /dev/null +++ b/changelogs/fragments/ule-docs.yaml @@ -0,0 +1,4 @@ +--- +bugfixes: + - network_resource - fix a potential UnboundLocalError if the module fails to import a + Resource Module. (https://github.com/ansible-collections/ansible.netcommon/pull/513) diff --git a/galaxy.yml b/galaxy.yml index 85e5fc2a2..73bfc665b 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -13,4 +13,4 @@ readme: README.md repository: https://github.com/ansible-collections/ansible.netcommon issues: https://github.com/ansible-collections/ansible.netcommon/issues tags: [networking, security, cloud, network_cli, netconf, httpapi, grpc] -version: 5.0.0 +version: 5.0.1-dev diff --git a/plugins/action/network_resource.py b/plugins/action/network_resource.py index 51996edea..3283820c2 100644 --- a/plugins/action/network_resource.py +++ b/plugins/action/network_resource.py @@ -238,6 +238,7 @@ def _list_resource_modules(self): for module_path in module_paths: module_name = os.path.basename(module_path).split(".")[0] + docs = None try: display.vvvv( "reading 'DOCUMENTATION' from path %s" % (module_path)