Skip to content
Snippets Groups Projects
Commit a83bab94 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

ipaautomountmap: Allows clearing description attribute with "".

This change allows clearing automountmap 'description' attribute by
passing an empty string ("") as the playbook parameter.

New test cases were added to check this behavior.
parent 70f4b7d6
Branches
Tags
No related merge requests found
...@@ -126,7 +126,8 @@ class AutomountMap(IPAAnsibleModule): ...@@ -126,7 +126,8 @@ class AutomountMap(IPAAnsibleModule):
_args = {} _args = {}
if mapname: if mapname:
_args["automountmapname"] = mapname _args["automountmapname"] = mapname
if desc: # An empty string is valid and will clear the attribute.
if desc is not None:
_args["description"] = desc _args["description"] = desc
return _args return _args
......
...@@ -71,6 +71,24 @@ ...@@ -71,6 +71,24 @@
register: result register: result
failed_when: result.failed or result.changed failed_when: result.failed or result.changed
- name: ensure map TestMap has an empty description
ipaautomountmap:
ipaadmin_password: SomeADMINpassword
name: TestMap
location: TestLocation
desc: ""
register: result
failed_when: result.failed or not result.changed
- name: ensure map TestMap has an empty description, again
ipaautomountmap:
ipaadmin_password: SomeADMINpassword
name: TestMap
location: TestLocation
desc: ""
register: result
failed_when: result.failed or result.changed
- name: ensure map TestMap is removed - name: ensure map TestMap is removed
ipaautomountmap: ipaautomountmap:
ipaadmin_password: SomeADMINpassword ipaadmin_password: SomeADMINpassword
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment