Re: [Freeipa-devel] [PATCH] 026 HBAC plugin inconsistent output

2011-02-16 Thread Martin Kosek
On Mon, 2011-02-14 at 10:37 -0500, Rob Crittenden wrote:
 Jan Zelený wrote:
  Martin Kosekmko...@redhat.com  wrote:
  On Mon, 2011-02-07 at 10:38 +0100, Jan Zelený wrote:
  Martin Kosekmko...@redhat.com  wrote:
  This patch adds a proper summary text to HBAC command which is
  then printed out in CLI. Now, HBAC plugin output is consistent
  with other plugins.
 
  https://fedorahosted.org/freeipa/ticket/596
 
  I believe API.txt should be updated (you change hbacrule_enable and
  hbacrule_disable return values), so NACK for now.
 
  Jan
 
  Patch has been rebased, API.txt updated along with some minor changes to
  achieve consistency between HBAC plugins. All tests pass.
 
  Martin
 
  Looks good now, ack
 
  Jan
 
 pushed to master

I guess this patch still needs to be pushed. I cannot find it in the
master.

Martin

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

Re: [Freeipa-devel] [PATCH] 026 HBAC plugin inconsistent output

2011-02-16 Thread Rob Crittenden

Martin Kosek wrote:

On Mon, 2011-02-14 at 10:37 -0500, Rob Crittenden wrote:

Jan Zelený wrote:

Martin Kosekmko...@redhat.com   wrote:

On Mon, 2011-02-07 at 10:38 +0100, Jan Zelený wrote:

Martin Kosekmko...@redhat.com   wrote:

This patch adds a proper summary text to HBAC command which is
then printed out in CLI. Now, HBAC plugin output is consistent
with other plugins.

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


I believe API.txt should be updated (you change hbacrule_enable and
hbacrule_disable return values), so NACK for now.

Jan


Patch has been rebased, API.txt updated along with some minor changes to
achieve consistency between HBAC plugins. All tests pass.

Martin


Looks good now, ack

Jan


pushed to master


I guess this patch still needs to be pushed. I cannot find it in the
master.

Martin



Sorry, a push works better when you actually push it. It is upstream now.

rob

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

Re: [Freeipa-devel] [PATCH] 026 HBAC plugin inconsistent output

2011-02-14 Thread Rob Crittenden

Jan Zelený wrote:

Martin Kosekmko...@redhat.com  wrote:

On Mon, 2011-02-07 at 10:38 +0100, Jan Zelený wrote:

Martin Kosekmko...@redhat.com  wrote:

This patch adds a proper summary text to HBAC command which is
then printed out in CLI. Now, HBAC plugin output is consistent
with other plugins.

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


I believe API.txt should be updated (you change hbacrule_enable and
hbacrule_disable return values), so NACK for now.

Jan


Patch has been rebased, API.txt updated along with some minor changes to
achieve consistency between HBAC plugins. All tests pass.

Martin


Looks good now, ack

Jan


pushed to master

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


Re: [Freeipa-devel] [PATCH] 026 HBAC plugin inconsistent output

2011-02-09 Thread Martin Kosek
On Mon, 2011-02-07 at 10:38 +0100, Jan Zelený wrote:
 Martin Kosek mko...@redhat.com wrote:
  This patch adds a proper summary text to HBAC command which is
  then printed out in CLI. Now, HBAC plugin output is consistent
  with other plugins.
  
  https://fedorahosted.org/freeipa/ticket/596
 
 I believe API.txt should be updated (you change hbacrule_enable and 
 hbacrule_disable return values), so NACK for now.
 
 Jan

Patch has been rebased, API.txt updated along with some minor changes to
achieve consistency between HBAC plugins. All tests pass.

Martin
From 3094da14dff0efb628259ce04aadcb0890349517 Mon Sep 17 00:00:00 2001
From: Martin Kosek mko...@redhat.com
Date: Fri, 4 Feb 2011 14:03:30 +0100
Subject: [PATCH] HBAC plugin inconsistent output

This patch adds a proper summary text to HBAC command which is
then printed out in CLI. Now, HBAC plugin output is consistent
with other plugins.

https://fedorahosted.org/freeipa/ticket/596
---
 API.txt   |   12 +---
 ipalib/plugins/hbacrule.py|   37 ++---
 ipalib/plugins/hbacsvc.py |   14 +++---
 ipalib/plugins/hbacsvcgroup.py|   10 +++---
 tests/test_xmlrpc/test_hbacsvcgroup_plugin.py |   12 
 5 files changed, 56 insertions(+), 29 deletions(-)

diff --git a/API.txt b/API.txt
index 22578e9927f36fc24d34150c62b79afb7bbbde3f..826944bc81cc97dd3b74e5471b1e54aa70ec34a9 100644
--- a/API.txt
+++ b/API.txt
@@ -988,13 +988,17 @@ output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly
 output: Output('result', type 'dict', 'list of deletions that failed')
 output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: hbacrule_disable
-args: 1,0,1
+args: 1,0,3
 arg: Str('cn', attribute=True, cli_name='name', label=Gettext('Rule name', domain='ipa', localedir=None), multivalue=False, primary_key=True, query=True, required=True)
-output: Output('result', None, None)
+output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
+output: Output('result', type 'bool', 'True means the operation was successful')
+output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: hbacrule_enable
-args: 1,0,1
+args: 1,0,3
 arg: Str('cn', attribute=True, cli_name='name', label=Gettext('Rule name', domain='ipa', localedir=None), multivalue=False, primary_key=True, query=True, required=True)
-output: Output('result', None, None)
+output: Output('summary', (type 'unicode', type 'NoneType'), 'User-friendly description of action performed')
+output: Output('result', type 'bool', 'True means the operation was successful')
+output: Output('value', type 'unicode', The primary_key value of the entry, e.g. 'jdoe' for a user)
 command: hbacrule_find
 args: 1,12,4
 arg: Str('criteria?')
diff --git a/ipalib/plugins/hbacrule.py b/ipalib/plugins/hbacrule.py
index b834a141061a6a5b64dba97b24a32f77824ef0a4..cb4dbb4f3756272ce8b79f584af74c5e6b2b839d 100644
--- a/ipalib/plugins/hbacrule.py
+++ b/ipalib/plugins/hbacrule.py
@@ -211,6 +211,9 @@ class hbacrule_add(LDAPCreate):
 
 Create a new HBAC rule.
 
+
+msg_summary = _('Added HBAC rule %(value)s')
+
 def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
 # HBAC rules are enabled by default
 entry_attrs['ipaenabledflag'] = 'TRUE'
@@ -224,6 +227,8 @@ class hbacrule_del(LDAPDelete):
 Delete an HBAC rule.
 
 
+msg_summary = _('Deleted HBAC rule %(value)s')
+
 api.register(hbacrule_del)
 
 
@@ -232,6 +237,8 @@ class hbacrule_mod(LDAPUpdate):
 Modify an HBAC rule.
 
 
+msg_summary = _('Modified HBAC rule %(value)s')
+
 def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
 try:
 (dn, entry_attrs) = ldap.get_entry(dn, attrs_list)
@@ -256,6 +263,10 @@ class hbacrule_find(LDAPSearch):
 Search for HBAC rules.
 
 
+msg_summary = ngettext(
+'%(count)d HBAC rule matched', '%(count)d HBAC rules matched', 0
+)
+
 api.register(hbacrule_find)
 
 
@@ -271,6 +282,10 @@ class hbacrule_enable(LDAPQuery):
 
 Enable an HBAC rule.
 
+
+msg_summary = _('Enabled HBAC rule %(value)s')
+has_output = output.standard_value
+
 def execute(self, cn):
 ldap = self.obj.backend
 
@@ -284,11 +299,10 @@ class hbacrule_enable(LDAPQuery):
 except errors.NotFound:
 self.obj.handle_not_found(cn)
 
-return dict(result=True)
-
-def output_for_cli(self, textui, result, cn):
-textui.print_name(self.name)
-textui.print_dashed('Enabled HBAC rule %s.' % cn)
+return dict(
+result=True,
+value=cn,
+)
 
 api.register(hbacrule_enable)
 
@@ -297,6 +311,10 @@ class hbacrule_disable(LDAPQuery):
 
 Disable an HBAC rule.
 
+
+msg_summary = 

Re: [Freeipa-devel] [PATCH] 026 HBAC plugin inconsistent output

2011-02-09 Thread Jan Zelený
Martin Kosek mko...@redhat.com wrote:
 On Mon, 2011-02-07 at 10:38 +0100, Jan Zelený wrote:
  Martin Kosek mko...@redhat.com wrote:
   This patch adds a proper summary text to HBAC command which is
   then printed out in CLI. Now, HBAC plugin output is consistent
   with other plugins.
   
   https://fedorahosted.org/freeipa/ticket/596
  
  I believe API.txt should be updated (you change hbacrule_enable and
  hbacrule_disable return values), so NACK for now.
  
  Jan
 
 Patch has been rebased, API.txt updated along with some minor changes to
 achieve consistency between HBAC plugins. All tests pass.
 
 Martin

Looks good now, ack

Jan

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


Re: [Freeipa-devel] [PATCH] 026 HBAC plugin inconsistent output

2011-02-07 Thread Jan Zelený
Martin Kosek mko...@redhat.com wrote:
 This patch adds a proper summary text to HBAC command which is
 then printed out in CLI. Now, HBAC plugin output is consistent
 with other plugins.
 
 https://fedorahosted.org/freeipa/ticket/596

I believe API.txt should be updated (you change hbacrule_enable and 
hbacrule_disable return values), so NACK for now.

Jan

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


Re: [Freeipa-devel] [PATCH] 026 HBAC plugin inconsistent output

2011-02-07 Thread Adam Young

On 02/07/2011 04:38 AM, Jan Zelený wrote:

Martin Kosekmko...@redhat.com  wrote:

This patch adds a proper summary text to HBAC command which is
then printed out in CLI. Now, HBAC plugin output is consistent
with other plugins.

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

I believe API.txt should be updated (you change hbacrule_enable and
hbacrule_disable return values), so NACK for now.

Jan

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel
Can we Mark these as :  ACK, needs API.txt update?  There are going to 
be conflicts as different people modify the API.  The ones that require 
API.txt updates just need to have the update done prior to check-in.


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