URL:
https://github.com/SSSD/sssd/pull/851
Title: #851: Update __init__.py.in
pbrezina commented:
"""
Yes, some providers are still not handled (session, chpass and access). Also could you
change the code to use dictionary and for loop instead of duplicating the code?
Additionally I think it is not needed to call `domain.add_provider(id_provider_value,
"auth")` (or is it?), but amend the `provider` dictionary as its going to set
the options on next line. Something like this:
```python
# Handle default provider values when not set.
default_providers = {
'id_provider': None,
'auth_provider': 'id_provider',
'chpass_provider': 'auth_provider',
'sudo_provider': 'id_provider',
'selinux_provider': 'id_provider',
'subdomains_provider': 'id_provider',
'session_provider': 'id_provider',
'autofs_provider': 'id_provider',
'hostid_provider': 'id_provider'
}
if 'access_provider' not in providers:
providers['access_provider'] = 'permit'
for provider, default_provider in default_providers.items():
if provider in providers:
continue
value = providers.get(default_provider, None)
providers[provider] = value
```
I did not test this. Perhaps the `None` case needs to be handled differently.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/851#issuecomment-527062588