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

The Univention modules have a issue with an unassigned variable. #55083

Merged
merged 1 commit into from
Apr 10, 2019
Merged

The Univention modules have a issue with an unassigned variable. #55083

merged 1 commit into from
Apr 10, 2019

Conversation

keachi
Copy link
Contributor

@keachi keachi commented Apr 10, 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
}

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.
@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 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. owner_pr This PR is made by the module's maintainer. support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback. labels Apr 10, 2019
@gundalow gundalow merged commit ee25c34 into ansible:devel Apr 10, 2019
@gundalow
Copy link
Contributor

@keachi Thank you for fixing this

I've merged this PR into devel so it will be released in Ansible 2.8.

I see these modules exist in Ansible 2.7, so I wonder if a backport PR for the stable-2.7 branch should be created (including a changelog/fragment file)

https://docs.ansible.com/ansible/devel/community/development_process.html#making-your-pr-merge-worthy

@keachi keachi deleted the univention_diff branch April 11, 2019 08:18
@mkrizek mkrizek removed needs_triage Needs a first human triage before being processed. labels Apr 11, 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.8 This issue/PR affects Ansible v2.8 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. owner_pr This PR is made by the module's maintainer. 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