Backport/2.7/55083 (#55141)

* The Univention modules have a issue with an unassigned variable.

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 26fa97922a)

* Add a changelog fragment for PR 55083.

(cherry picked from commit b4ae654890)
pull/55235/head
Tobias Rüetschi 7 years ago committed by Toshio Kuratomi
parent 6814d1cb57
commit a79c57b1e1

@ -0,0 +1,6 @@
bugfixes:
- udm_user - Fix issues when state is absent with undefined variable diff at the module return.
- udm_group - Fix issues when state is absent with undefined variable diff at the module return.
- udm_share - Fix issues when state is absent with undefined variable diff at the module return.
- udm_dns_zone - Fix issues when state is absent with undefined variable diff at the module return.
- udm_dns_record - Fix issues when state is absent with undefined variable diff at the module return.

@ -122,6 +122,7 @@ def main():
data = module.params['data']
state = module.params['state']
changed = False
diff = None
obj = list(ldap_search(
'(&(objectClass=dNSZone)(zoneName={})(relativeDomainName={}))'.format(zone, name),

@ -169,6 +169,7 @@ def main():
mx = module.params['mx']
state = module.params['state']
changed = False
diff = None
obj = list(ldap_search(
'(&(objectClass=dNSZone)(zoneName={}))'.format(zone),

@ -111,6 +111,7 @@ def main():
subpath = module.params['subpath']
state = module.params['state']
changed = False
diff = None
groups = list(ldap_search(
'(&(objectClass=posixGroup)(cn={}))'.format(name),

@ -476,6 +476,7 @@ def main():
name = module.params['name']
state = module.params['state']
changed = False
diff = None
obj = list(ldap_search(
'(&(objectClass=univentionShare)(cn={}))'.format(name),

@ -410,6 +410,7 @@ def main():
subpath = module.params['subpath']
state = module.params['state']
changed = False
diff = None
users = list(ldap_search(
'(&(objectClass=posixAccount)(uid={}))'.format(username),

Loading…
Cancel
Save