Re: [Freeipa-devel] [PATCH 0056] Enable nsaccountlock in user.py cli

2015-10-14 Thread Gabe Alford
Alright. Let's postpone it to 4.4.

Gabe

On Wed, Oct 14, 2015 at 2:52 AM, Martin Basti  wrote:

> Sorry, we cannot push this patch because I realize that it breaks API
> compatibility.
>
> The proper fix is add this code to find method (not tested)
>
> def get_options(self):
> for option in super(user_find, self).get_options():
> if option.name == "nsaccountlock":
> flags = set(option.flags)
> flags.remove("no_option")
> option = option.clone(flags=flags)
> yield option
>
> But I do not like too much this code, we plan to do some ipalib
> refactoring in IPA 4.4, so we can do there bigger changes and solve this
> issue in nicer way.
> If you don't mind, I would postpone this to IPA 4.4, instead of hacking
> the framework
>
> Martin
>
>
> On 13.10.2015 19:12, Gabe Alford wrote:
>
> Updated patch attached.
>
> On Tue, Oct 13, 2015 at 10:59 AM, Martin Basti < 
> mba...@redhat.com> wrote:
>
>>
>>
>> On 13.10.2015 18:53, Gabe Alford wrote:
>>
>> Thanks Martin,
>>
>> What about adding no_create and no_update flags?
>>
>> Gabe
>>
>> Yes, that may work, also please increment minor version of API and add
>> ticket into commit message (https://fedorahosted.org/freeipa/ticket/5366)
>> 
>>
>> Thanks.
>> Martin
>>
>>
>> On Tue, Oct 13, 2015 at 9:54 AM, Martin Basti < 
>> mba...@redhat.com> wrote:
>>
>>>
>>>
>>> On 09.10.2015 19:17, Gabe Alford wrote:
>>>
>>> Hello,
>>>
>>> This patch enables nsaccountlock in user.py cli. It is very handy to be
>>> able to search and find users with disabled/enabled accounts, etc. That
>>> said, I couldn't find why it was no_option in the first place, so I am not
>>> 100% sure if it breaks something or the reasoning behind no_option.
>>>
>>> Thanks,
>>>
>>> Gabe
>>>
>>>
>>> Hello,
>>>
>>> https://fedorahosted.org/freeipa/ticket/5366
>>>
>>> This patch allows to enable/disable user via user-mod, and we do not
>>> want to do this, so NACK for this patch.
>>> I'm not sure yet how to write it in elegant way.
>>>
>>> Martin.
>>>
>>
>>
>>
>
>
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH 0056] Enable nsaccountlock in user.py cli

2015-10-14 Thread Martin Basti
Sorry, we cannot push this patch because I realize that it breaks API 
compatibility.


The proper fix is add this code to find method (not tested)

def get_options(self):
for option in super(user_find, self).get_options():
if option.name == "nsaccountlock":
flags = set(option.flags)
flags.remove("no_option")
option = option.clone(flags=flags)
yield option

But I do not like too much this code, we plan to do some ipalib 
refactoring in IPA 4.4, so we can do there bigger changes and solve this 
issue in nicer way.
If you don't mind, I would postpone this to IPA 4.4, instead of hacking 
the framework


Martin

On 13.10.2015 19:12, Gabe Alford wrote:

Updated patch attached.

On Tue, Oct 13, 2015 at 10:59 AM, Martin Basti > wrote:




On 13.10.2015 18:53, Gabe Alford wrote:

Thanks Martin,

What about adding no_create and no_update flags?

Gabe

Yes, that may work, also please increment minor version of API and
add ticket into commit message
(https://fedorahosted.org/freeipa/ticket/5366)


Thanks.
Martin


On Tue, Oct 13, 2015 at 9:54 AM, Martin Basti mailto:mba...@redhat.com>> wrote:



On 09.10.2015 19:17, Gabe Alford wrote:

Hello,

This patch enables nsaccountlock in user.py cli. It is very
handy to be able to search and find users with
disabled/enabled accounts, etc. That said, I couldn't find
why it was no_option in the first place, so I am not 100%
sure if it breaks something or the reasoning behind no_option.

Thanks,

Gabe



Hello,

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

This patch allows to enable/disable user via user-mod, and we
do not want to do this, so NACK for this patch.
I'm not sure yet how to write it in elegant way.

Martin.







-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH 0056] Enable nsaccountlock in user.py cli

2015-10-13 Thread Gabe Alford
Updated patch attached.

On Tue, Oct 13, 2015 at 10:59 AM, Martin Basti  wrote:

>
>
> On 13.10.2015 18:53, Gabe Alford wrote:
>
> Thanks Martin,
>
> What about adding no_create and no_update flags?
>
> Gabe
>
> Yes, that may work, also please increment minor version of API and add
> ticket into commit message (https://fedorahosted.org/freeipa/ticket/5366)
> 
>
> Thanks.
> Martin
>
>
> On Tue, Oct 13, 2015 at 9:54 AM, Martin Basti  wrote:
>
>>
>>
>> On 09.10.2015 19:17, Gabe Alford wrote:
>>
>> Hello,
>>
>> This patch enables nsaccountlock in user.py cli. It is very handy to be
>> able to search and find users with disabled/enabled accounts, etc. That
>> said, I couldn't find why it was no_option in the first place, so I am not
>> 100% sure if it breaks something or the reasoning behind no_option.
>>
>> Thanks,
>>
>> Gabe
>>
>>
>> Hello,
>>
>> https://fedorahosted.org/freeipa/ticket/5366
>>
>> This patch allows to enable/disable user via user-mod, and we do not want
>> to do this, so NACK for this patch.
>> I'm not sure yet how to write it in elegant way.
>>
>> Martin.
>>
>
>
>
From 9ff0901198bcf900789d0c3a431a2a905093548e Mon Sep 17 00:00:00 2001
From: Gabe 
Date: Tue, 13 Oct 2015 11:09:29 -0600
Subject: [PATCH] Enable nsaccountlock in user.py for user-find cli usage

https://fedorahosted.org/freeipa/ticket/5366
---
 API.txt| 8 +++-
 VERSION| 4 ++--
 ipalib/plugins/user.py | 3 ++-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/API.txt b/API.txt
index 4d36a9885157de13529573b3a386b4ef39eba176..9d9cf12e0f924e9a119e85bf7d51dd4646e4a5e2 100644
--- a/API.txt
+++ b/API.txt
@@ -5147,7 +5147,7 @@ output: Entry('result', , Gettext('A dictionary representing an LDA
 output: Output('summary', (, ), None)
 output: PrimaryKey('value', None, None)
 command: user_add
-args: 1,45,3
+args: 1,44,3
 arg: Str('uid', attribute=True, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', primary_key=True, required=True)
 option: Str('addattr*', cli_name='addattr', exclude='webui')
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
@@ -5176,7 +5176,6 @@ option: Str('manager', attribute=True, cli_name='manager', multivalue=False, req
 option: Str('mobile', attribute=True, cli_name='mobile', multivalue=True, required=False)
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('noprivate', autofill=True, cli_name='noprivate', default=False)
-option: Bool('nsaccountlock', attribute=True, cli_name='nsaccountlock', multivalue=False, required=False)
 option: Str('ou', attribute=True, cli_name='orgunit', multivalue=False, required=False)
 option: Str('pager', attribute=True, cli_name='pager', multivalue=True, required=False)
 option: Str('postalcode', attribute=True, cli_name='postalcode', multivalue=False, required=False)
@@ -5269,7 +5268,7 @@ option: Str('not_in_hbacrule*', cli_name='not_in_hbacrules', csv=True)
 option: Str('not_in_netgroup*', cli_name='not_in_netgroups', csv=True)
 option: Str('not_in_role*', cli_name='not_in_roles', csv=True)
 option: Str('not_in_sudorule*', cli_name='not_in_sudorules', csv=True)
-option: Bool('nsaccountlock', attribute=True, autofill=False, cli_name='nsaccountlock', multivalue=False, query=True, required=False)
+option: Bool('nsaccountlock', attribute=True, autofill=False, cli_name='disabled', multivalue=False, query=True, required=False)
 option: Str('ou', attribute=True, autofill=False, cli_name='orgunit', multivalue=False, query=True, required=False)
 option: Str('pager', attribute=True, autofill=False, cli_name='pager', multivalue=True, query=True, required=False)
 option: Flag('pkey_only?', autofill=True, default=False)
@@ -5296,7 +5295,7 @@ output: ListOfEntries('result', (, ), Gettext('A list
 output: Output('summary', (, ), None)
 output: Output('truncated', , None)
 command: user_mod
-args: 1,46,3
+args: 1,45,3
 arg: Str('uid', attribute=True, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', primary_key=True, query=True, required=True)
 option: Str('addattr*', cli_name='addattr', exclude='webui')
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
@@ -5324,7 +5323,6 @@ option: Str('mail', attribute=True, autofill=False, cli_name='email', multivalue
 option: Str('manager', attribute=True, autofill=False, cli_name='manager', multivalue=False, required=False)
 option: Str('mobile', attribute=True, autofill=False, cli_name='mobile', multivalue=True, required=False)
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
-option: Bool('nsaccountlock', attribute=True, autofill=False, cli_name='nsaccountlock', multivalue=False, required=False)
 option: Str('ou', attribute=True, autofill=False, cli_name='orgunit', multivalue=False, required=False)
 option: S

Re: [Freeipa-devel] [PATCH 0056] Enable nsaccountlock in user.py cli

2015-10-13 Thread Martin Basti



On 13.10.2015 18:53, Gabe Alford wrote:

Thanks Martin,

What about adding no_create and no_update flags?

Gabe
Yes, that may work, also please increment minor version of API and add 
ticket into commit message 
(https://fedorahosted.org/freeipa/ticket/5366) 



Thanks.
Martin


On Tue, Oct 13, 2015 at 9:54 AM, Martin Basti > wrote:




On 09.10.2015 19:17, Gabe Alford wrote:

Hello,

This patch enables nsaccountlock in user.py cli. It is very handy
to be able to search and find users with disabled/enabled
accounts, etc. That said, I couldn't find why it was no_option in
the first place, so I am not 100% sure if it breaks something or
the reasoning behind no_option.

Thanks,

Gabe



Hello,

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

This patch allows to enable/disable user via user-mod, and we do
not want to do this, so NACK for this patch.
I'm not sure yet how to write it in elegant way.

Martin.




-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH 0056] Enable nsaccountlock in user.py cli

2015-10-13 Thread Gabe Alford
Thanks Martin,

What about adding no_create and no_update flags?

Gabe

On Tue, Oct 13, 2015 at 9:54 AM, Martin Basti  wrote:

>
>
> On 09.10.2015 19:17, Gabe Alford wrote:
>
> Hello,
>
> This patch enables nsaccountlock in user.py cli. It is very handy to be
> able to search and find users with disabled/enabled accounts, etc. That
> said, I couldn't find why it was no_option in the first place, so I am not
> 100% sure if it breaks something or the reasoning behind no_option.
>
> Thanks,
>
> Gabe
>
>
> Hello,
>
> https://fedorahosted.org/freeipa/ticket/5366
>
> This patch allows to enable/disable user via user-mod, and we do not want
> to do this, so NACK for this patch.
> I'm not sure yet how to write it in elegant way.
>
> Martin.
>
From 706d2f533f1bfb60422e26fd02a03967d76bd3b2 Mon Sep 17 00:00:00 2001
From: Gabe 
Date: Tue, 13 Oct 2015 10:51:20 -0600
Subject: [PATCH] Enable nsaccountlock in user.py for user-find cli usage

---
 API.txt| 8 +++-
 VERSION| 2 +-
 ipalib/plugins/user.py | 3 ++-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/API.txt b/API.txt
index 4d36a9885157de13529573b3a386b4ef39eba176..9d9cf12e0f924e9a119e85bf7d51dd4646e4a5e2 100644
--- a/API.txt
+++ b/API.txt
@@ -5147,7 +5147,7 @@ output: Entry('result', , Gettext('A dictionary representing an LDA
 output: Output('summary', (, ), None)
 output: PrimaryKey('value', None, None)
 command: user_add
-args: 1,45,3
+args: 1,44,3
 arg: Str('uid', attribute=True, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', primary_key=True, required=True)
 option: Str('addattr*', cli_name='addattr', exclude='webui')
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
@@ -5176,7 +5176,6 @@ option: Str('manager', attribute=True, cli_name='manager', multivalue=False, req
 option: Str('mobile', attribute=True, cli_name='mobile', multivalue=True, required=False)
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
 option: Flag('noprivate', autofill=True, cli_name='noprivate', default=False)
-option: Bool('nsaccountlock', attribute=True, cli_name='nsaccountlock', multivalue=False, required=False)
 option: Str('ou', attribute=True, cli_name='orgunit', multivalue=False, required=False)
 option: Str('pager', attribute=True, cli_name='pager', multivalue=True, required=False)
 option: Str('postalcode', attribute=True, cli_name='postalcode', multivalue=False, required=False)
@@ -5269,7 +5268,7 @@ option: Str('not_in_hbacrule*', cli_name='not_in_hbacrules', csv=True)
 option: Str('not_in_netgroup*', cli_name='not_in_netgroups', csv=True)
 option: Str('not_in_role*', cli_name='not_in_roles', csv=True)
 option: Str('not_in_sudorule*', cli_name='not_in_sudorules', csv=True)
-option: Bool('nsaccountlock', attribute=True, autofill=False, cli_name='nsaccountlock', multivalue=False, query=True, required=False)
+option: Bool('nsaccountlock', attribute=True, autofill=False, cli_name='disabled', multivalue=False, query=True, required=False)
 option: Str('ou', attribute=True, autofill=False, cli_name='orgunit', multivalue=False, query=True, required=False)
 option: Str('pager', attribute=True, autofill=False, cli_name='pager', multivalue=True, query=True, required=False)
 option: Flag('pkey_only?', autofill=True, default=False)
@@ -5296,7 +5295,7 @@ output: ListOfEntries('result', (, ), Gettext('A list
 output: Output('summary', (, ), None)
 output: Output('truncated', , None)
 command: user_mod
-args: 1,46,3
+args: 1,45,3
 arg: Str('uid', attribute=True, cli_name='login', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$', primary_key=True, query=True, required=True)
 option: Str('addattr*', cli_name='addattr', exclude='webui')
 option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
@@ -5324,7 +5323,6 @@ option: Str('mail', attribute=True, autofill=False, cli_name='email', multivalue
 option: Str('manager', attribute=True, autofill=False, cli_name='manager', multivalue=False, required=False)
 option: Str('mobile', attribute=True, autofill=False, cli_name='mobile', multivalue=True, required=False)
 option: Flag('no_members', autofill=True, default=False, exclude='webui')
-option: Bool('nsaccountlock', attribute=True, autofill=False, cli_name='nsaccountlock', multivalue=False, required=False)
 option: Str('ou', attribute=True, autofill=False, cli_name='orgunit', multivalue=False, required=False)
 option: Str('pager', attribute=True, autofill=False, cli_name='pager', multivalue=True, required=False)
 option: Str('postalcode', attribute=True, autofill=False, cli_name='postalcode', multivalue=False, required=False)
diff --git a/VERSION b/VERSION
index e1df4694f678b1fb27da7785b94dc827f0f8f207..895c9533cffd4ee1f5c98018b2aeab25a0582af7 100644
--- a/VERSION
+++ b/VERSION
@@ -91,4 +91,4 @@ IPA_DATA_VERSION=2010061412
 ##

Re: [Freeipa-devel] [PATCH 0056] Enable nsaccountlock in user.py cli

2015-10-13 Thread Martin Basti



On 09.10.2015 19:17, Gabe Alford wrote:

Hello,

This patch enables nsaccountlock in user.py cli. It is very handy to 
be able to search and find users with disabled/enabled accounts, etc. 
That said, I couldn't find why it was no_option in the first place, so 
I am not 100% sure if it breaks something or the reasoning behind 
no_option.


Thanks,

Gabe



Hello,

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

This patch allows to enable/disable user via user-mod, and we do not 
want to do this, so NACK for this patch.

I'm not sure yet how to write it in elegant way.

Martin.
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code