Avoid an error if ipadefaultemaildomain if not defined #1289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The IPA configuration
ipadefaultemaildomain
is optional (in this case, the key don't exist).It's usefull to unset the default email domain, because it disables the auto-generation of an email address when creating a new user. But when we have this type of configuration, the module
ipauser
always failed (with or without email) :While it's permitted by the FreeIPA server to have no default email domain, the module assumes that there must be one configured.
This PR simply check if this parameter exists. If not, AND if ever the module is called with a "short" email address that needs to be extended, so no miracle : it will failed with a message like this
But in this case I think it is a legitimate failure (the request is not compatible with the server configuration) and the message remains relatively understandable.