On Thu, 2011-07-21 at 18:52 +0530, Gowrishankar Rajaiyan wrote:
> Hi All,
> 
> This patch fixes
>       - https://fedorahosted.org/freeipa/ticket/1510
>       - https://fedorahosted.org/freeipa/ticket/1509

QEs sending patches for the bugs they found - good job there.

I went one step further and updated all automount summary messages so
that we are consistent on the plugin.

The proposed patch is attached, tests are clean.

Martin
>From d26c03f6a5f16ebb34738f6c4279364e825e900a Mon Sep 17 00:00:00 2001
From: Martin Kosek <mko...@redhat.com>
Date: Thu, 21 Jul 2011 16:49:35 +0200
Subject: [PATCH] Add missing automount summaries

https://fedorahosted.org/freeipa/ticket/1509
https://fedorahosted.org/freeipa/ticket/1510
---
 ipalib/plugins/automount.py |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py
index ce30be7ec090709d04ec4133196cd42c54441c7b..d692b2c866f787f46623abb01dad87e560a9c797 100644
--- a/ipalib/plugins/automount.py
+++ b/ipalib/plugins/automount.py
@@ -206,6 +206,9 @@ class automountlocation_add(LDAPCreate):
     """
     Create a new automount location.
     """
+
+    msg_summary = _('Added automount location "%(value)s"')
+
     def post_callback(self, ldap, dn, entry_attrs, *keys, **options):
         # create auto.master for the new location
         self.api.Command['automountmap_add'](keys[-1], u'auto.master')
@@ -214,6 +217,7 @@ class automountlocation_add(LDAPCreate):
         )
         return dn
 
+
 api.register(automountlocation_add)
 
 
@@ -222,6 +226,8 @@ class automountlocation_del(LDAPDelete):
     Delete an automount location.
     """
 
+    msg_summary = _('Deleted automount location "%(value)s"')
+
 api.register(automountlocation_del)
 
 
@@ -238,6 +244,11 @@ class automountlocation_find(LDAPSearch):
     Search for an automount location.
     """
 
+    msg_summary = ngettext(
+        '%(count)d automount location matched',
+        '%(count)d automount locations matched', 0
+    )
+
 api.register(automountlocation_find)
 
 
@@ -523,6 +534,8 @@ class automountmap_add(LDAPCreate):
     Create a new automount map.
     """
 
+    msg_summary = _('Added automount map "%(value)s"')
+
 api.register(automountmap_add)
 
 
@@ -530,6 +543,9 @@ class automountmap_del(LDAPDelete):
     """
     Delete an automount map.
     """
+
+    msg_summary = _('Deleted automount map "%(value)s"')
+
     def post_callback(self, ldap, dn, *keys, **options):
         # delete optional parental connection (direct maps may not have this)
         try:
@@ -550,6 +566,8 @@ class automountmap_mod(LDAPUpdate):
     Modify an automount map.
     """
 
+    msg_summary = _('Modified automount map "%(value)s"')
+
 api.register(automountmap_mod)
 
 
@@ -558,6 +576,11 @@ class automountmap_find(LDAPSearch):
     Search for an automount map.
     """
 
+    msg_summary = ngettext(
+        '%(count)d automount map matched',
+        '%(count)d automount maps matched', 0
+    )
+
 api.register(automountmap_find)
 
 
@@ -719,6 +742,9 @@ class automountkey_add(LDAPCreate):
     """
     Create a new automount key.
     """
+
+    msg_summary = _('Added automount key "%(value)s"')
+
     def pre_callback(self, ldap, dn, entry_attrs, *keys, **options):
         self.obj.check_key_uniqueness(keys[-2], keys[-1], **options)
         return dn
@@ -744,6 +770,9 @@ class automountmap_add_indirect(LDAPCreate):
     """
     Create a new indirect mount point.
     """
+
+    msg_summary = _('Added automount indirect map "%(value)s"')
+
     takes_options = LDAPCreate.takes_options + (
         Str('key',
             cli_name='mount',
@@ -774,6 +803,9 @@ class automountkey_del(LDAPDelete):
     """
     Delete an automount key.
     """
+
+    msg_summary = _('Deleted automount key "%(value)s"')
+
     takes_options = LDAPDelete.takes_options + (
         IA5Str('automountkey',
                cli_name='key',
@@ -805,6 +837,9 @@ class automountkey_mod(LDAPUpdate):
     """
     Modify an automount key.
     """
+
+    msg_summary = _('Modified automount key "%(value)s"')
+
     takes_options = LDAPUpdate.takes_options + (
         IA5Str('newautomountinformation',
                cli_name='newinfo',
@@ -839,6 +874,11 @@ class automountkey_find(LDAPSearch):
     Search for an automount key.
     """
 
+    msg_summary = ngettext(
+        '%(count)d automount key matched',
+        '%(count)d automount keys matched', 0
+    )
+
 api.register(automountkey_find)
 
 
-- 
1.7.6

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

Reply via email to