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:
Rafael Guterres Jeffman
2022-04-27 11:20:55 -03:00
parent 1276e38895
commit 23e07a9a17

View File

@@ -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