mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 13:53:23 +00:00
ipaautomountmap: Force setting automountmapname in IPA API calls.
The usage of 'automountmapname' is required in all automount map IPA API calls, and this change ensures that the value is always set as an argument.
This commit is contained in:
@@ -123,9 +123,10 @@ class AutomountMap(IPAAnsibleModule):
|
||||
self.params_fail_used_invalid(invalid, state)
|
||||
|
||||
def get_args(self, mapname, desc): # pylint: disable=no-self-use
|
||||
_args = {}
|
||||
if mapname:
|
||||
_args["automountmapname"] = mapname
|
||||
# automountmapname is required for all automountmap operations.
|
||||
if not mapname:
|
||||
self.fail_json(msg="automountmapname cannot be None or empty.")
|
||||
_args = {"automountmapname": mapname}
|
||||
# An empty string is valid and will clear the attribute.
|
||||
if desc is not None:
|
||||
_args["description"] = desc
|
||||
|
||||
Reference in New Issue
Block a user