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]