From f8e4c103e9fd39aa8d9fd2d76cecae3e5e4b4625 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Fri, 7 Aug 2020 16:38:18 -0400 Subject: [PATCH] Fix UnboundLocalError on net_put (#71086) --- changelogs/fragments/net_put-unboundlocalerror.yaml | 4 ++++ lib/ansible/plugins/action/net_put.py | 1 + 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/net_put-unboundlocalerror.yaml diff --git a/changelogs/fragments/net_put-unboundlocalerror.yaml b/changelogs/fragments/net_put-unboundlocalerror.yaml new file mode 100644 index 00000000000..9e0e5606988 --- /dev/null +++ b/changelogs/fragments/net_put-unboundlocalerror.yaml @@ -0,0 +1,4 @@ +--- +bugfixes: + - net_put - Fixed UnboundLocalError when there is no change + This is a backport from U(https://github.com/ansible-collections/ansible.netcommon/pull/6) diff --git a/lib/ansible/plugins/action/net_put.py b/lib/ansible/plugins/action/net_put.py index bd844a12166..f236ed4a64f 100644 --- a/lib/ansible/plugins/action/net_put.py +++ b/lib/ansible/plugins/action/net_put.py @@ -35,6 +35,7 @@ display = Display() class ActionModule(ActionBase): def run(self, tmp=None, task_vars=None): + changed = False socket_path = None network_os = self._get_network_os(task_vars).split('.')[-1] persistent_connection = self._play_context.connection.split('.')[-1]