summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2009-11-30 12:10:06 +0100
committerRob Crittenden <rcritten@redhat.com>2010-01-20 16:54:02 -0500
commit41a7a8d3d4d79cf15dac5583fc5aa8c301282c98 (patch)
tree8a32b9c57422b9c4ce1b6943fad79a01d18552c1 /ipalib
parentba0e7b9c68f48f8b5f4e4cc59c1fad1d80726275 (diff)
downloadfreeipa-41a7a8d3d4d79cf15dac5583fc5aa8c301282c98.tar.gz
freeipa-41a7a8d3d4d79cf15dac5583fc5aa8c301282c98.tar.xz
freeipa-41a7a8d3d4d79cf15dac5583fc5aa8c301282c98.zip
Add --enable-migration option in config plugin.
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/config.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/ipalib/plugins/config.py b/ipalib/plugins/config.py
index 82eea97b..3030ce7c 100644
--- a/ipalib/plugins/config.py
+++ b/ipalib/plugins/config.py
@@ -22,7 +22,7 @@ IPA configuration
"""
from ipalib import api
-from ipalib import Int, Str
+from ipalib import Bool, Int, Str
from ipalib.plugins.baseldap import *
@@ -35,6 +35,7 @@ class config(LDAPObject):
'ipamaxusernamelength', 'ipahomesrootdir', 'ipadefaultloginshell',
'ipadefaultprimarygroup', 'ipadefaultdomain', 'ipasearchtimelimit',
'ipasearchrecordslimit', 'ipausersearchfields', 'ipagroupsearchfields',
+ 'ipamigrationenabled',
]
attribute_names = {
'ipamaxusernamelength': 'maximum username length',
@@ -46,6 +47,7 @@ class config(LDAPObject):
'ipasearchrecordslimit': 'result count limit for search queries',
'ipausersearchfields': 'search fields for users',
'ipagroupsearchfields': 'search fields for groups',
+ 'ipamigrationenabled': 'enable migration mode',
}
takes_params = (
@@ -88,6 +90,10 @@ class config(LDAPObject):
cli_name='groupsearch',
doc='A comma-separated list of fields to search when searching for groups',
),
+ Bool('ipamigrationenabled?',
+ cli_name='enable_migration',
+ doc='Enabled migration mode',
+ ),
)
def get_dn(self, *keys, **kwargs):
@@ -100,6 +106,13 @@ class config_mod(LDAPUpdate):
"""
Modify configuration options.
"""
+ def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
+ if 'ipamigrationenabled' in entry_attrs:
+ if entry_attrs['ipamigrationenabled']:
+ entry_attrs['ipamigrationenabled'] = 'TRUE'
+ else:
+ entry_attrs['ipamigrationenabled'] = 'FALSE'
+ return dn
api.register(config_mod)