diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2009-11-19 19:34:28 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-11-20 11:18:48 -0500 |
commit | eb78b771fe2beefef84295673e36eb3fbb11730a (patch) | |
tree | 97c4ecd316914da0495712ba6b5526c651a47352 /server | |
parent | b8e454a678fb2cacf98f0cfb6f7b7657e5f3c0e3 (diff) | |
download | sssd-eb78b771fe2beefef84295673e36eb3fbb11730a.tar.gz sssd-eb78b771fe2beefef84295673e36eb3fbb11730a.tar.xz sssd-eb78b771fe2beefef84295673e36eb3fbb11730a.zip |
upgrade_config fixes for SSSD 0.6 and later
Incorporates changes we made to v2 after 0.6, or that were missed by the
original upgrade script:
* removes magic_private_groups option
* removes libPath option
* changes provider=files to provider=proxy proxy_lib_name=files
* changes store-legacy-passwords to store_legacy_passwords
Diffstat (limited to 'server')
-rw-r--r-- | server/config/upgrade_config.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/server/config/upgrade_config.py b/server/config/upgrade_config.py index 71af6daab..09758211a 100644 --- a/server/config/upgrade_config.py +++ b/server/config/upgrade_config.py @@ -69,6 +69,10 @@ class SSSDConfigFile(SSSDChangeConf): srvlist['value'] = ", ".join([srv for srv in services]) self.delete_option('section', 'dp') + # remove magic_private_groups from all domains + for domain in [ s for s in self.sections() if s['name'].startswith("domain/") ]: + self.delete_option_subtree(domain['value'], 'option', 'magic_private_groups') + def _update_option(self, to_section_name, from_section_name, opts): to_section = [ s for s in self.sections() if s['name'].strip() == to_section_name ] from_section = [ s for s in self.sections() if s['name'].strip() == from_section_name ] @@ -120,6 +124,7 @@ class SSSDConfigFile(SSSDChangeConf): 'access_provider' : 'access-module', 'chpass_provider' : 'chpass-module', 'use_fully_qualified_names' : 'useFullyQualifiedNames', + 'store_legacy_passwords' : 'store-legacy-passwords', } # Proxy options proxy_kw = { 'proxy_pam_target' : 'pam-target', @@ -183,21 +188,34 @@ class SSSDConfigFile(SSSDChangeConf): self.rename_opts(domain['name'], ldap_kw) self.rename_opts(domain['name'], krb5_kw) + # remove obsolete libPath option + self.delete_option_subtree(domain['value'], 'option', 'libPath') + # configuration files before 0.5.0 did not enforce provider= in local domains # it did special-case by domain name (LOCAL) - prv = self.findOpts(domain['value'], 'option', 'id_provider')[1] + prvindex, prv = self.findOpts(domain['value'], 'option', 'id_provider') if not prv and domain['name'] == 'domain/LOCAL': prv = { 'type' : 'option', 'name' : 'id_provider', 'value' : 'local', } domain['value'].insert(0, prv) + # if domain was local, update with parameters from [user_defaults] if prv['value'] == 'local': self._update_option(domain['name'], 'user_defaults', user_defaults_kw.values()) self.delete_option('section', 'user_defaults') self.rename_opts(domain['name'], user_defaults_kw) + # if domain had provider = files, unroll that into provider=proxy, proxy_lib_name=files + if prv['value'] == 'files': + prv['value'] = 'proxy' + libkw = { 'type' : 'option', + 'name' : 'proxy_lib_name', + 'value' : 'files', + } + domain['value'].insert(prvindex+1, libkw) + def _migrate_domains(self): for domain in [ s for s in self.sections() if s['name'].startswith("domains/") ]: self._migrate_domain(domain) |