summaryrefslogtreecommitdiffstats
path: root/ipa-admintools
diff options
context:
space:
mode:
authorKevin McCarthy <kmccarth@redhat.com>2007-08-20 10:50:11 -0700
committerKevin McCarthy <kmccarth@redhat.com>2007-08-20 10:50:11 -0700
commit66d3f1e730ed5e1bc80264b2a5d7f4fb16c1d22c (patch)
tree2d929adc00cad0701e87d96afc282733e7e6f0ef /ipa-admintools
parent5f0f192ae3c8aa44868b7b3b86e71523fc55515b (diff)
downloadfreeipa-66d3f1e730ed5e1bc80264b2a5d7f4fb16c1d22c.tar.gz
freeipa-66d3f1e730ed5e1bc80264b2a5d7f4fb16c1d22c.tar.xz
freeipa-66d3f1e730ed5e1bc80264b2a5d7f4fb16c1d22c.zip
Embed origiginal values inside user, and have update_user pass in a user
object. Based on rcrit's original patch. Push scalar to list value conversion inside funcs.py.
Diffstat (limited to 'ipa-admintools')
-rw-r--r--ipa-admintools/ipa-usermod14
1 files changed, 5 insertions, 9 deletions
diff --git a/ipa-admintools/ipa-usermod b/ipa-admintools/ipa-usermod
index cb221e446..bcd06821d 100644
--- a/ipa-admintools/ipa-usermod
+++ b/ipa-admintools/ipa-usermod
@@ -48,27 +48,23 @@ def parse_options():
return options, args
def main():
- olduser={}
- newuser={}
options, args = parse_options()
if len(args) != 2:
usage()
client = ipaclient.IPAClient()
- u = client.get_user(args[1])
- olduser = u.toDict()
- newuser = u.toDict()
+ user = client.get_user(args[1])
if options.gecos:
- newuser['gecos'] = [options.gecos]
+ user.setValue('gecos', options.gecos)
if options.directory:
- newuser['homedirectory'] = [options.directory]
+ user.setValue('homedirectory', options.directory)
if options.shell:
- newuser['loginshell'] = [options.shell]
+ user.setValue('loginshell', options.shell)
try:
- client.update_user(olduser, newuser)
+ client.update_user(user)
print args[1] + " successfully modified"
except xmlrpclib.Fault, f:
print f.faultString