Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport/2.7/55083 #55141

Merged
merged 2 commits into from
Apr 12, 2019
Merged

Backport/2.7/55083 #55141

merged 2 commits into from
Apr 12, 2019

Conversation

keachi
Copy link
Contributor

@keachi keachi commented Apr 11, 2019

SUMMARY

The variable diff is only assigned if state is 'present', else the
variable is unused. But the module will return the diff variable as a
return value. If the state isn't 'present' the module will fail with an
python UnboundLocalError exception.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • udm_user
  • udm_group
  • udm_share
  • udm_dns_zone
  • udm_dns_record
ADDITIONAL INFORMATION
The full traceback is:
Traceback (most recent call last):
 File "/tmp/ansible_Id1UGE/ansible_module_udm_user.py", line 522, in <module>
   main()
 File "/tmp/ansible_Id1UGE/ansible_module_udm_user.py", line 517, in main
   diff=diff,
UnboundLocalError: local variable 'diff' referenced before assignment

fatal: [srv-ucs-01]: FAILED! => {
   "changed": false,  
   "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_Id1UGE/ansible_module_udm_user.py\", line 522, in <module>\n    main()\n  File \"/tmp/ansible_Id1UGE/ansible_module_udm_user.py\",
line 517, in main\n    diff=diff,\nUnboundLocalError: local variable 'diff' referenced before assignment\n",                                                                                                      
   "module_stdout": "",  
   "msg": "MODULE FAILURE",  
   "rc": 1
}

Tobias Rueetschi added 2 commits April 11, 2019 12:37
The variable diff is only assigned if state is 'present', else the
variable is unused. But the module will return the diff variable as a
return value. If the state isn't 'present' the module will fail with an
python UnboundLocalError exception.

(cherry picked from commit 26fa979)
(cherry picked from commit b4ae654)
@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 backport This PR does not target the devel branch. bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback. labels Apr 11, 2019
@abadger abadger merged commit a79c57b into ansible:stable-2.7 Apr 12, 2019
@abadger
Copy link
Contributor

abadger commented Apr 12, 2019

Merged for 2.7.11

@keachi keachi deleted the backport/2.7/55083 branch April 15, 2019 08:03
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Apr 15, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 backport This PR does not target the devel branch. bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants