-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

https://fedorahosted.org/freeipa/ticket/580

To test, simply run:
ipa automountlocation-add baltimore
ipa automountmap-add baltimore auto.share
ipa automountkey-add baltimore auto.master /share --info=auto.share
ipa automountkey-add baltimore auto.share man
- --info="-ro,soft,rsize=8192,wsize=8192 ipa.example.com:/shared/man"
ipa automountlocation-tofiles baltimore

Also the -import command was fixed:
ipa automountlocation-add testimport
ipa automountlocation-import testimport /etc/auto.master

Without this patch, the -tofiles or -import calls would blow up with
something like "ipa: ERROR: 'automountlocation' is required"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkz+McwACgkQHsardTLnvCWD7gCfd9Xlplv52VTqr2qaO0YM3CPb
Ov8An2OdWukIunZh3nK1jmOE4irXvq9o
=hO0Y
-----END PGP SIGNATURE-----
From eaaa45eff8684e7f51654227ad80ce04b1a7fa4d Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Tue, 7 Dec 2010 08:02:42 -0500
Subject: [PATCH] Fix kwargs usage in automount plugin

https://fedorahosted.org/freeipa/ticket/580
---
 ipalib/plugins/automount.py |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py
index df9b341..c3e7f94 100644
--- a/ipalib/plugins/automount.py
+++ b/ipalib/plugins/automount.py
@@ -247,9 +247,7 @@ class automountlocation_tofiles(LDAPQuery):
         location = self.api.Command['automountlocation_show'](args[0])
 
         maps = []
-        result = self.api.Command['automountkey_find'](
-            cn=args[0], automountmapname=u'auto.master'
-        )
+        result = self.api.Command['automountkey_find'](args[0], u'auto.master')
         truncated = result['truncated']
         maps = result['result']
 
@@ -261,9 +259,7 @@ class automountlocation_tofiles(LDAPQuery):
         for m in maps:
             info = m['automountinformation'][0]
             key = info.split(None)
-            result = self.api.Command['automountkey_find'](
-                cn=args[0], automountmapname=key[0]
-            )
+            result = self.api.Command['automountkey_find'](args[0], key[0])
             truncated = result['truncated']
             keys[info] = result['result']
             # TODO: handle truncated results, same as above
@@ -363,7 +359,7 @@ class automountlocation_import(LDAPQuery):
 
             # Add a new key to the auto.master map for the new map file
             try:
-                api.Command['automountkey_add'](cn=args[0], automountmapname=u'auto.master', automountkey=unicode(am[0]), automountinformation=unicode(' '.join(am[1:])))
+                api.Command['automountkey_add'](args[0], u'auto.master', unicode(am[0]), automountinformation=unicode(' '.join(am[1:])))
                 result['keys'].append([am[0], u'auto.master'])
             except errors.DuplicateEntry, e:
                 if options.get('continue', False):
@@ -374,7 +370,7 @@ class automountlocation_import(LDAPQuery):
             # Add the new map
             if not am[1].startswith('-'):
                 try:
-                    api.Command['automountmap_add'](cn=args[0], automountmapname=unicode(am[1]))
+                    api.Command['automountmap_add'](args[0], unicode(am[1]))
                     result['maps'].append(am[1])
                 except errors.DuplicateEntry, e:
                     if options.get('continue', False):
@@ -411,7 +407,7 @@ class automountlocation_import(LDAPQuery):
                 am = x.split(None)
                 key = unicode(am[0].replace('"',''))
                 try:
-                    api.Command['automountkey_add'](cn=args[0], automountmapname=unicode(m), automountkey=key, automountinformation=unicode(' '.join(am[1:])))
+                    api.Command['automountkey_add'](args[0], unicode(m), key, automountinformation=unicode(' '.join(am[1:])))
                     result['keys'].append([key,m])
                 except errors.DuplicateEntry, e:
                     if options.get('continue', False):
@@ -445,13 +441,14 @@ class automountlocation_import(LDAPQuery):
             )
         textui.print_plain('')
 
-        textui.print_plain('Ignored keys:')
-        for k in keys:
-            textui.print_plain(
-                'Ignored %s to %s' % (
-                    k[0], k[1]
+        if len(skipped) > 0:
+            textui.print_plain('Ignored keys:')
+            for k in skipped:
+                textui.print_plain(
+                    'Ignored %s to %s' % (
+                        k[0], k[1]
+                    )
                 )
-            )
 
 
         if options.get('continue', False) and len(duplicatemaps) > 0:
-- 
1.7.3.2

Attachment: freeipa-jhrozek-020-Fix-kwargs-usage-in-automount-plugin.patch.sig
Description: PGP signature

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to