Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-08-19 Thread Rob Crittenden

Martin Kosek wrote:

On Thu, 2011-07-28 at 11:49 +0200, Martin Kosek wrote:

On Wed, 2011-07-27 at 14:53 -0400, Rob Crittenden wrote:

Martin Kosek wrote:

On Wed, 2011-07-27 at 12:11 -0400, Dmitri Pal wrote:

On 07/27/2011 12:00 PM, Martin Kosek wrote:

On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:

Martin Kosek wrote:

Fix automountkey-mod so that automountkey attribute is correctly
updated. Add this test case to the unit tests.

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

It fixes the problem but I've found another: --key isn't required so if
you don't pass it in then a backtrace will occur:

Traceback (most recent call last):
 File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line
220, in wsgi_execute
   result = self.Command[name](*args, **options)
 File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
425, in __call__
   ret = self.run(*args, **options)
 File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
731, in run
   return self.execute(*args, **options)
 File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py",
line 873, in execute
   keys += (self.obj.get_pk(options['automountkey'],
KeyError: 'automountkey'

Also, automountinformation is already required. This may be a leftover
from when we used it in description, this can probably be lifted too.

rob

Good catch. I fixed this bug too and I also made --newinfo optional so
that automountkey may be just renamed without changing its info
attribute.

I didn't bump up API VERSION as these are either compatible changes or
they caused server internal error.

Martin


Should the ticket be moved into 2.1 July sprint then?


Yes, I would like this to be included in 2.1. I will move ticket to
correct milestone (2.1) if we manage to review&push it before release.

Martin


nack. Something is up with _mod. I can't be sure it is this patch or it
was always here.

In the UI every change wanted to try to rename the entry. On the
command-line I wasn't able to update the info at all.

rob


Hm, I think this problem was in the _mod command all the time.
'description' field was being filled every time which triggered rename
operation. This caused problems.

I rewrote _mod command so that 'description' (i.e. rename) is filled
only when needed.

I checked UI and automountkey_mod command worked OK for me.

Martin


I revisited automountkey_mod command as there was another corner case.
get_pk() was changed to include automountinfo in RDN only for direct
maps.

All tests are OK, even Rob's extended automount test preview. Web UI
behaved ok too.

Martin


ack, pushed to master and ipa-2-1

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


Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-08-01 Thread Martin Kosek
On Thu, 2011-07-28 at 11:49 +0200, Martin Kosek wrote:
> On Wed, 2011-07-27 at 14:53 -0400, Rob Crittenden wrote:
> > Martin Kosek wrote:
> > > On Wed, 2011-07-27 at 12:11 -0400, Dmitri Pal wrote:
> > >> On 07/27/2011 12:00 PM, Martin Kosek wrote:
> > >>> On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:
> >  Martin Kosek wrote:
> > > Fix automountkey-mod so that automountkey attribute is correctly
> > > updated. Add this test case to the unit tests.
> > >
> > > https://fedorahosted.org/freeipa/ticket/1528
> >  It fixes the problem but I've found another: --key isn't required so if
> >  you don't pass it in then a backtrace will occur:
> > 
> >  Traceback (most recent call last):
> >  File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", 
> >  line
> >  220, in wsgi_execute
> >    result = self.Command[name](*args, **options)
> >  File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
> >  425, in __call__
> >    ret = self.run(*args, **options)
> >  File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
> >  731, in run
> >    return self.execute(*args, **options)
> >  File 
> >  "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py",
> >  line 873, in execute
> >    keys += (self.obj.get_pk(options['automountkey'],
> >  KeyError: 'automountkey'
> > 
> >  Also, automountinformation is already required. This may be a leftover
> >  from when we used it in description, this can probably be lifted too.
> > 
> >  rob
> > >>> Good catch. I fixed this bug too and I also made --newinfo optional so
> > >>> that automountkey may be just renamed without changing its info
> > >>> attribute.
> > >>>
> > >>> I didn't bump up API VERSION as these are either compatible changes or
> > >>> they caused server internal error.
> > >>>
> > >>> Martin
> > >>
> > >> Should the ticket be moved into 2.1 July sprint then?
> > >
> > > Yes, I would like this to be included in 2.1. I will move ticket to
> > > correct milestone (2.1) if we manage to review&push it before release.
> > >
> > > Martin
> > 
> > nack. Something is up with _mod. I can't be sure it is this patch or it 
> > was always here.
> > 
> > In the UI every change wanted to try to rename the entry. On the 
> > command-line I wasn't able to update the info at all.
> > 
> > rob
> 
> Hm, I think this problem was in the _mod command all the time.
> 'description' field was being filled every time which triggered rename
> operation. This caused problems.
> 
> I rewrote _mod command so that 'description' (i.e. rename) is filled
> only when needed.
> 
> I checked UI and automountkey_mod command worked OK for me.
> 
> Martin

I revisited automountkey_mod command as there was another corner case.
get_pk() was changed to include automountinfo in RDN only for direct
maps.

All tests are OK, even Rob's extended automount test preview. Web UI
behaved ok too.

Martin
>From c6cb967272aeb85ef3cdecf7ef848c16a87c53fb Mon Sep 17 00:00:00 2001
From: Martin Kosek 
Date: Mon, 1 Aug 2011 16:41:28 +0200
Subject: [PATCH] Fix automountkey-mod

Fix automountkey-mod so that automountkey attribute is correctly
updated. Add this test case to the unit tests.

Make automountkey required for automountkey-mod, otherwise it would
cause internal server error.

Make --newinfo optional so that automountkey may be just renamed
without changing its info attribute.

https://fedorahosted.org/freeipa/ticket/1528
---
 API.txt|8 ++--
 ipalib/crud.py |4 ++
 ipalib/plugins/automount.py|   53 +++-
 tests/test_xmlrpc/test_automount_plugin.py |7 +++-
 4 files changed, 49 insertions(+), 23 deletions(-)

diff --git a/API.txt b/API.txt
index d78e3529c66e63c7c2e4d6a8676603d3f857ae1a..49b352a4b6995a55cae28361cd7d70205a63f0c2 100644
--- a/API.txt
+++ b/API.txt
@@ -103,7 +103,7 @@ command: automountkey_add
 args: 2,7,3
 arg: Str('automountlocationcn', cli_name='automountlocation', label=Gettext('Location', domain='ipa', localedir=None), query=True, required=True)
 arg: IA5Str('automountmapautomountmapname', cli_name='automountmap', label=Gettext('Map', domain='ipa', localedir=None), query=True, required=True)
-option: IA5Str('automountkey', attribute=True, cli_name='key', label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, required=True)
+option: IA5Str('automountkey', attribute=True, cli_name='key', flags=('req_update',), label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, required=True)
 option: IA5Str('automountinformation', attribute=True, cli_name='info', label=Gettext('Mount information', domain='ipa', localedir=None), multivalue=False, required=True)
 option: Str('addattr*', validate_add_attribute, cli_name='addattr', exclude='webui')
 option: Str('setattr*', validate_set_attr

Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-07-28 Thread Martin Kosek
On Wed, 2011-07-27 at 14:53 -0400, Rob Crittenden wrote:
> Martin Kosek wrote:
> > On Wed, 2011-07-27 at 12:11 -0400, Dmitri Pal wrote:
> >> On 07/27/2011 12:00 PM, Martin Kosek wrote:
> >>> On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:
>  Martin Kosek wrote:
> > Fix automountkey-mod so that automountkey attribute is correctly
> > updated. Add this test case to the unit tests.
> >
> > https://fedorahosted.org/freeipa/ticket/1528
>  It fixes the problem but I've found another: --key isn't required so if
>  you don't pass it in then a backtrace will occur:
> 
>  Traceback (most recent call last):
>  File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line
>  220, in wsgi_execute
>    result = self.Command[name](*args, **options)
>  File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
>  425, in __call__
>    ret = self.run(*args, **options)
>  File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
>  731, in run
>    return self.execute(*args, **options)
>  File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py",
>  line 873, in execute
>    keys += (self.obj.get_pk(options['automountkey'],
>  KeyError: 'automountkey'
> 
>  Also, automountinformation is already required. This may be a leftover
>  from when we used it in description, this can probably be lifted too.
> 
>  rob
> >>> Good catch. I fixed this bug too and I also made --newinfo optional so
> >>> that automountkey may be just renamed without changing its info
> >>> attribute.
> >>>
> >>> I didn't bump up API VERSION as these are either compatible changes or
> >>> they caused server internal error.
> >>>
> >>> Martin
> >>
> >> Should the ticket be moved into 2.1 July sprint then?
> >
> > Yes, I would like this to be included in 2.1. I will move ticket to
> > correct milestone (2.1) if we manage to review&push it before release.
> >
> > Martin
> 
> nack. Something is up with _mod. I can't be sure it is this patch or it 
> was always here.
> 
> In the UI every change wanted to try to rename the entry. On the 
> command-line I wasn't able to update the info at all.
> 
> rob

Hm, I think this problem was in the _mod command all the time.
'description' field was being filled every time which triggered rename
operation. This caused problems.

I rewrote _mod command so that 'description' (i.e. rename) is filled
only when needed.

I checked UI and automountkey_mod command worked OK for me.

Martin
>From dc5f5dd303957697ba26a5590c922a065fe2785b Mon Sep 17 00:00:00 2001
From: Martin Kosek 
Date: Wed, 27 Jul 2011 15:26:57 +0200
Subject: [PATCH] Fix automountkey-mod

Fix automountkey-mod so that automountkey attribute is correctly
updated. Add this test case to the unit tests.

Make automountkey required for automountkey-mod, otherwise it would
cause internal server error.

Make --newinfo optional so that automountkey may be just renamed
without changing its info attribute.

https://fedorahosted.org/freeipa/ticket/1528
---
 API.txt|8 
 ipalib/crud.py |4 
 ipalib/plugins/automount.py|   27 +++
 tests/test_xmlrpc/test_automount_plugin.py |7 +--
 4 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/API.txt b/API.txt
index 42a212b1ebda0f8e1f45b016c5ba421f16ffb24c..cdbf111eb32c950d29a5d1bc9791e7b14e401c3c 100644
--- a/API.txt
+++ b/API.txt
@@ -103,7 +103,7 @@ command: automountkey_add
 args: 2,7,3
 arg: Str('automountlocationcn', cli_name='automountlocation', label=Gettext('Location', domain='ipa', localedir=None), query=True, required=True)
 arg: IA5Str('automountmapautomountmapname', cli_name='automountmap', label=Gettext('Map', domain='ipa', localedir=None), query=True, required=True)
-option: IA5Str('automountkey', attribute=True, cli_name='key', label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, required=True)
+option: IA5Str('automountkey', attribute=True, cli_name='key', flags=('req_update',), label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, required=True)
 option: IA5Str('automountinformation', attribute=True, cli_name='info', label=Gettext('Mount information', domain='ipa', localedir=None), multivalue=False, required=True)
 option: Str('addattr*', validate_add_attribute, cli_name='addattr', exclude='webui')
 option: Str('setattr*', validate_set_attribute, cli_name='setattr', exclude='webui')
@@ -128,7 +128,7 @@ args: 3,7,4
 arg: Str('automountlocationcn', cli_name='automountlocation', label=Gettext('Location', domain='ipa', localedir=None), query=True, required=True)
 arg: IA5Str('automountmapautomountmapname', cli_name='automountmap', label=Gettext('Map', domain='ipa', localedir=None), query=True, required=True)
 arg: Str('criteria?', noextrawhitespace=False)
-option: IA5Str('au

Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-07-27 Thread Rob Crittenden

Martin Kosek wrote:

On Wed, 2011-07-27 at 12:11 -0400, Dmitri Pal wrote:

On 07/27/2011 12:00 PM, Martin Kosek wrote:

On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:

Martin Kosek wrote:

Fix automountkey-mod so that automountkey attribute is correctly
updated. Add this test case to the unit tests.

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

It fixes the problem but I've found another: --key isn't required so if
you don't pass it in then a backtrace will occur:

Traceback (most recent call last):
File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line
220, in wsgi_execute
  result = self.Command[name](*args, **options)
File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
425, in __call__
  ret = self.run(*args, **options)
File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
731, in run
  return self.execute(*args, **options)
File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py",
line 873, in execute
  keys += (self.obj.get_pk(options['automountkey'],
KeyError: 'automountkey'

Also, automountinformation is already required. This may be a leftover
from when we used it in description, this can probably be lifted too.

rob

Good catch. I fixed this bug too and I also made --newinfo optional so
that automountkey may be just renamed without changing its info
attribute.

I didn't bump up API VERSION as these are either compatible changes or
they caused server internal error.

Martin


Should the ticket be moved into 2.1 July sprint then?


Yes, I would like this to be included in 2.1. I will move ticket to
correct milestone (2.1) if we manage to review&push it before release.

Martin


nack. Something is up with _mod. I can't be sure it is this patch or it 
was always here.


In the UI every change wanted to try to rename the entry. On the 
command-line I wasn't able to update the info at all.


rob

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


Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-07-27 Thread Adam Young

On 07/27/2011 12:15 PM, Martin Kosek wrote:

On Wed, 2011-07-27 at 12:11 -0400, Dmitri Pal wrote:

On 07/27/2011 12:00 PM, Martin Kosek wrote:

On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:

Martin Kosek wrote:

Fix automountkey-mod so that automountkey attribute is correctly
updated. Add this test case to the unit tests.

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

It fixes the problem but I've found another: --key isn't required so if
you don't pass it in then a backtrace will occur:

Traceback (most recent call last):
File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line
220, in wsgi_execute
  result = self.Command[name](*args, **options)
File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
425, in __call__
  ret = self.run(*args, **options)
File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line
731, in run
  return self.execute(*args, **options)
File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py",
line 873, in execute
  keys += (self.obj.get_pk(options['automountkey'],
KeyError: 'automountkey'

Also, automountinformation is already required. This may be a leftover
from when we used it in description, this can probably be lifted too.

rob

Good catch. I fixed this bug too and I also made --newinfo optional so
that automountkey may be just renamed without changing its info
attribute.

I didn't bump up API VERSION as these are either compatible changes or
they caused server internal error.

Martin

Should the ticket be moved into 2.1 July sprint then?

Yes, I would like this to be included in 2.1. I will move ticket to
correct milestone (2.1) if we manage to review&push it before release.

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
Please test with the UI, to ensure you haven;t broken the mod 
functionality.  Specificially,test the Automount key details page.


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


Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-07-27 Thread Martin Kosek
On Wed, 2011-07-27 at 12:11 -0400, Dmitri Pal wrote:
> On 07/27/2011 12:00 PM, Martin Kosek wrote: 
> > On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:
> > > Martin Kosek wrote:
> > > > Fix automountkey-mod so that automountkey attribute is correctly
> > > > updated. Add this test case to the unit tests.
> > > > 
> > > > https://fedorahosted.org/freeipa/ticket/1528
> > > It fixes the problem but I've found another: --key isn't required so if 
> > > you don't pass it in then a backtrace will occur:
> > > 
> > > Traceback (most recent call last):
> > >File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line 
> > > 220, in wsgi_execute
> > >  result = self.Command[name](*args, **options)
> > >File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
> > > 425, in __call__
> > >  ret = self.run(*args, **options)
> > >File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
> > > 731, in run
> > >  return self.execute(*args, **options)
> > >File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py", 
> > > line 873, in execute
> > >  keys += (self.obj.get_pk(options['automountkey'],
> > > KeyError: 'automountkey'
> > > 
> > > Also, automountinformation is already required. This may be a leftover 
> > > from when we used it in description, this can probably be lifted too.
> > > 
> > > rob
> > Good catch. I fixed this bug too and I also made --newinfo optional so
> > that automountkey may be just renamed without changing its info
> > attribute.
> > 
> > I didn't bump up API VERSION as these are either compatible changes or
> > they caused server internal error.
> > 
> > Martin
> 
> Should the ticket be moved into 2.1 July sprint then?

Yes, I would like this to be included in 2.1. I will move ticket to
correct milestone (2.1) if we manage to review&push it before release.

Martin

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


Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-07-27 Thread Dmitri Pal
On 07/27/2011 12:00 PM, Martin Kosek wrote:
> On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:
>> Martin Kosek wrote:
>>> Fix automountkey-mod so that automountkey attribute is correctly
>>> updated. Add this test case to the unit tests.
>>>
>>> https://fedorahosted.org/freeipa/ticket/1528
>> It fixes the problem but I've found another: --key isn't required so if 
>> you don't pass it in then a backtrace will occur:
>>
>> Traceback (most recent call last):
>>File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line 
>> 220, in wsgi_execute
>>  result = self.Command[name](*args, **options)
>>File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
>> 425, in __call__
>>  ret = self.run(*args, **options)
>>File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
>> 731, in run
>>  return self.execute(*args, **options)
>>File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py", 
>> line 873, in execute
>>  keys += (self.obj.get_pk(options['automountkey'],
>> KeyError: 'automountkey'
>>
>> Also, automountinformation is already required. This may be a leftover 
>> from when we used it in description, this can probably be lifted too.
>>
>> rob
> Good catch. I fixed this bug too and I also made --newinfo optional so
> that automountkey may be just renamed without changing its info
> attribute.
>
> I didn't bump up API VERSION as these are either compatible changes or
> they caused server internal error.
>
> Martin

Should the ticket be moved into 2.1 July sprint then?

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


-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager IPA project,
Red Hat Inc.


---
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/



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

Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-07-27 Thread Martin Kosek
On Wed, 2011-07-27 at 10:41 -0400, Rob Crittenden wrote:
> Martin Kosek wrote:
> > Fix automountkey-mod so that automountkey attribute is correctly
> > updated. Add this test case to the unit tests.
> >
> > https://fedorahosted.org/freeipa/ticket/1528
> 
> It fixes the problem but I've found another: --key isn't required so if 
> you don't pass it in then a backtrace will occur:
> 
> Traceback (most recent call last):
>File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line 
> 220, in wsgi_execute
>  result = self.Command[name](*args, **options)
>File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
> 425, in __call__
>  ret = self.run(*args, **options)
>File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
> 731, in run
>  return self.execute(*args, **options)
>File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py", 
> line 873, in execute
>  keys += (self.obj.get_pk(options['automountkey'],
> KeyError: 'automountkey'
> 
> Also, automountinformation is already required. This may be a leftover 
> from when we used it in description, this can probably be lifted too.
> 
> rob

Good catch. I fixed this bug too and I also made --newinfo optional so
that automountkey may be just renamed without changing its info
attribute.

I didn't bump up API VERSION as these are either compatible changes or
they caused server internal error.

Martin
>From 5059b9c8dbafbc3158eb5d3a6b4f956dd9bba112 Mon Sep 17 00:00:00 2001
From: Martin Kosek 
Date: Wed, 27 Jul 2011 15:26:57 +0200
Subject: [PATCH] Fix automountkey-mod

Fix automountkey-mod so that automountkey attribute is correctly
updated. Add this test case to the unit tests.

Make automountkey required for automountkey-mod, otherwise it would
cause internal server error.

Make --newinfo optional so that automountkey may be just renamed
without changing its info attribute.

https://fedorahosted.org/freeipa/ticket/1528
---
 API.txt|8 
 ipalib/crud.py |4 
 ipalib/plugins/automount.py|   11 ---
 tests/test_xmlrpc/test_automount_plugin.py |7 +--
 4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/API.txt b/API.txt
index 42a212b1ebda0f8e1f45b016c5ba421f16ffb24c..cdbf111eb32c950d29a5d1bc9791e7b14e401c3c 100644
--- a/API.txt
+++ b/API.txt
@@ -103,7 +103,7 @@ command: automountkey_add
 args: 2,7,3
 arg: Str('automountlocationcn', cli_name='automountlocation', label=Gettext('Location', domain='ipa', localedir=None), query=True, required=True)
 arg: IA5Str('automountmapautomountmapname', cli_name='automountmap', label=Gettext('Map', domain='ipa', localedir=None), query=True, required=True)
-option: IA5Str('automountkey', attribute=True, cli_name='key', label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, required=True)
+option: IA5Str('automountkey', attribute=True, cli_name='key', flags=('req_update',), label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, required=True)
 option: IA5Str('automountinformation', attribute=True, cli_name='info', label=Gettext('Mount information', domain='ipa', localedir=None), multivalue=False, required=True)
 option: Str('addattr*', validate_add_attribute, cli_name='addattr', exclude='webui')
 option: Str('setattr*', validate_set_attribute, cli_name='setattr', exclude='webui')
@@ -128,7 +128,7 @@ args: 3,7,4
 arg: Str('automountlocationcn', cli_name='automountlocation', label=Gettext('Location', domain='ipa', localedir=None), query=True, required=True)
 arg: IA5Str('automountmapautomountmapname', cli_name='automountmap', label=Gettext('Map', domain='ipa', localedir=None), query=True, required=True)
 arg: Str('criteria?', noextrawhitespace=False)
-option: IA5Str('automountkey', attribute=True, autofill=False, cli_name='key', label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, query=True, required=False)
+option: IA5Str('automountkey', attribute=True, autofill=False, cli_name='key', flags=('req_update',), label=Gettext('Key', domain='ipa', localedir=None), multivalue=False, query=True, required=False)
 option: IA5Str('automountinformation', attribute=True, autofill=False, cli_name='info', label=Gettext('Mount information', domain='ipa', localedir=None), multivalue=False, query=True, required=False)
 option: Int('timelimit?', autofill=False, flags=['no_display'], label=Gettext('Time Limit', domain='ipa', localedir=None), minvalue=0)
 option: Int('sizelimit?', autofill=False, flags=['no_display'], label=Gettext('Size Limit', domain='ipa', localedir=None), minvalue=0)
@@ -143,12 +143,12 @@ command: automountkey_mod
 args: 2,10,3
 arg: Str('automountlocationcn', cli_name='automountlocation', label=Gettext('Location', domain='ipa', localedir=None), query=True, required=True)
 arg: IA5Str('automountmapautomountmapname', cli_name='automountmap', label=Gettext('Map', domain='ipa', localedir=None), quer

Re: [Freeipa-devel] [PATCH] 103 Fix automountkey-mod

2011-07-27 Thread Rob Crittenden

Martin Kosek wrote:

Fix automountkey-mod so that automountkey attribute is correctly
updated. Add this test case to the unit tests.

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


It fixes the problem but I've found another: --key isn't required so if 
you don't pass it in then a backtrace will occur:


Traceback (most recent call last):
  File "/home/rcrit/redhat/freeipa-master/ipaserver/rpcserver.py", line 
220, in wsgi_execute

result = self.Command[name](*args, **options)
  File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
425, in __call__

ret = self.run(*args, **options)
  File "/home/rcrit/redhat/freeipa-master/ipalib/frontend.py", line 
731, in run

return self.execute(*args, **options)
  File "/home/rcrit/redhat/freeipa-master/ipalib/plugins/automount.py", 
line 873, in execute

keys += (self.obj.get_pk(options['automountkey'],
KeyError: 'automountkey'

Also, automountinformation is already required. This may be a leftover 
from when we used it in description, this can probably be lifted too.


rob

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