Re: [Freeipa-devel] Pagure issue template

2017-04-21 Thread Abhijeet Kasurde

+1

On 20/04/17 9:36 PM, Petr Vobornik wrote:

Hi all,

I'd like to improve quality of bug reports and RFEs.

A possibility I see is to create and issue template [1].

What do you think of the following template? Should we use it?

""""
### Request for enhancement
As  , I want <what?> so that <why?>.

### Bug
 What doesn't work (what was the goal)

 Steps to Reproduce

 Actual results

 Expected results

 Version/Release/Distribution
   $ rpm -q freeipa-server ipa-server 389-ds-base pki-ca krb5-server

 Additional info:

""""



1.  Can we add pre-defined set of components in title ? for example,

[CERT] some_cert_related bug description
[installer] some installer related bug description

2. Also, Having a bot in place which will enforce or atleast suggest 
reporter to modify bug report.



[1] https://docs.pagure.org/pagure/usage/ticket_templates.html


--
Abhijeet Kasurde
Red Hat Identity management, RHCSA,
Red Hat APAC
akasu...@redhat.com
www.redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted

--
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 0019] Corrected minor spell check in AD Trust information doc messages

2016-08-22 Thread Abhijeet Kasurde

Hi All,


On 08/22/2016 05:47 PM, Martin Basti wrote:



On 22.08.2016 14:07, Alexander Bokovoy wrote:

On Mon, 22 Aug 2016, Abhijeet Kasurde wrote:

Hi All,

Please find the patch attached.

It's a minor spelling correction so, I have not created ticket for 
this.



ACK.



Please don't update .pot files, we are doing it before release 
automatically using Zanata.

Please find updated patch.

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From 7b2165b6cd903d82399ac3e8e7966431e8f41824 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 22 Aug 2016 17:25:06 +0530
Subject: [PATCH] Corrected minor spell check in AD Trust information doc
 messages

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/ipa-adtrust-install   | 2 +-
 ipaclient/remote_plugins/2_114/trust.py | 2 +-
 ipaclient/remote_plugins/2_156/trust.py | 2 +-
 ipaclient/remote_plugins/2_164/trust.py | 2 +-
 ipaserver/plugins/trust.py  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install
index ca09ca97b1c0c159a1ed3bfb048f879f51e4275d..170b110b0084e6368201e3ff2bafe7714818a0cf 100755
--- a/install/tools/ipa-adtrust-install
+++ b/install/tools/ipa-adtrust-install
@@ -448,7 +448,7 @@ def main():
 print("")
 print("WARNING: %d IPA masters are not yet able to serve information about users from trusted forests." \
   % (object_count))
-print("Installer can add them to the list of IPA masters allowed to access infromation about trusts.")
+print("Installer can add them to the list of IPA masters allowed to access information about trusts.")
 print("If you choose to do so, you also need to restart LDAP service on those masters.")
 print("Refer to ipa-adtrust-install(1) man page for details.")
 print("")
diff --git a/ipaclient/remote_plugins/2_114/trust.py b/ipaclient/remote_plugins/2_114/trust.py
index 1976f4a25a4c9868abb246d2569736ebdf100ab1..69226663a0310ffb88f474969331403e20399486 100644
--- a/ipaclient/remote_plugins/2_114/trust.py
+++ b/ipaclient/remote_plugins/2_114/trust.py
@@ -936,7 +936,7 @@ class trustdomain_add(Method):
 
 @register()
 class trustdomain_del(Method):
-__doc__ = _("Remove infromation about the domain associated with the trust.")
+__doc__ = _("Remove information about the domain associated with the trust.")
 
 takes_args = (
 parameters.Str(
diff --git a/ipaclient/remote_plugins/2_156/trust.py b/ipaclient/remote_plugins/2_156/trust.py
index 369ffcd181a60b373aadc4bd0314423af76f2f53..39a56383140622faa3f6ea4d64654f5710413791 100644
--- a/ipaclient/remote_plugins/2_156/trust.py
+++ b/ipaclient/remote_plugins/2_156/trust.py
@@ -950,7 +950,7 @@ class trustdomain_add(Method):
 
 @register()
 class trustdomain_del(Method):
-__doc__ = _("Remove infromation about the domain associated with the trust.")
+__doc__ = _("Remove information about the domain associated with the trust.")
 
 takes_args = (
 parameters.Str(
diff --git a/ipaclient/remote_plugins/2_164/trust.py b/ipaclient/remote_plugins/2_164/trust.py
index 369ffcd181a60b373aadc4bd0314423af76f2f53..39a56383140622faa3f6ea4d64654f5710413791 100644
--- a/ipaclient/remote_plugins/2_164/trust.py
+++ b/ipaclient/remote_plugins/2_164/trust.py
@@ -950,7 +950,7 @@ class trustdomain_add(Method):
 
 @register()
 class trustdomain_del(Method):
-__doc__ = _("Remove infromation about the domain associated with the trust.")
+__doc__ = _("Remove information about the domain associated with the trust.")
 
 takes_args = (
 parameters.Str(
diff --git a/ipaserver/plugins/trust.py b/ipaserver/plugins/trust.py
index b9d9b122a90de62946307b99b44932129eb611e8..26f85c26f17dc5c987ee66c9c40cac1c80cf2212 100644
--- a/ipaserver/plugins/trust.py
+++ b/ipaserver/plugins/trust.py
@@ -1602,7 +1602,7 @@ class trustdomain_add(LDAPCreate):
 
 @register()
 class trustdomain_del(LDAPDelete):
-__doc__ = _('Remove infromation about the domain associated with the trust.')
+__doc__ = _('Remove information about the domain associated with the trust.')
 
 msg_summary = _('Removed information about the trusted domain "%(value)s"')
 
-- 
2.5.5

-- 
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

[Freeipa-devel] [Patch 0019] Corrected minor spell check in AD Trust information doc messages

2016-08-22 Thread Abhijeet Kasurde

Hi All,

Please find the patch attached.

It's a minor spelling correction so, I have not created ticket for this.


--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From 7a1a129ab6a174cd2ea5920f93d0e819ec47f160 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 22 Aug 2016 17:25:06 +0530
Subject: [PATCH] Corrected minor spell check in AD Trust information doc
 messages

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/po/ipa.pot  | 2 +-
 install/tools/ipa-adtrust-install   | 2 +-
 ipaclient/remote_plugins/2_114/trust.py | 2 +-
 ipaclient/remote_plugins/2_156/trust.py | 2 +-
 ipaclient/remote_plugins/2_164/trust.py | 2 +-
 ipaserver/plugins/trust.py  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/install/po/ipa.pot b/install/po/ipa.pot
index 3284c0dc9aff49f227aeb26b003e30c01e9dc81e..96a957198cc98a6ea74bb19e861685fb9962fa91 100644
--- a/install/po/ipa.pot
+++ b/install/po/ipa.pot
@@ -16226,7 +16226,7 @@ msgid "Allow access from the trusted domain"
 msgstr ""
 
 #: ipaserver/plugins/trust.py:1590
-msgid "Remove infromation about the domain associated with the trust."
+msgid "Remove information about the domain associated with the trust."
 msgstr ""
 
 #: ipaserver/plugins/trust.py:1592
diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install
index ca09ca97b1c0c159a1ed3bfb048f879f51e4275d..170b110b0084e6368201e3ff2bafe7714818a0cf 100755
--- a/install/tools/ipa-adtrust-install
+++ b/install/tools/ipa-adtrust-install
@@ -448,7 +448,7 @@ def main():
 print("")
 print("WARNING: %d IPA masters are not yet able to serve information about users from trusted forests." \
   % (object_count))
-print("Installer can add them to the list of IPA masters allowed to access infromation about trusts.")
+print("Installer can add them to the list of IPA masters allowed to access information about trusts.")
 print("If you choose to do so, you also need to restart LDAP service on those masters.")
 print("Refer to ipa-adtrust-install(1) man page for details.")
 print("")
diff --git a/ipaclient/remote_plugins/2_114/trust.py b/ipaclient/remote_plugins/2_114/trust.py
index 1976f4a25a4c9868abb246d2569736ebdf100ab1..69226663a0310ffb88f474969331403e20399486 100644
--- a/ipaclient/remote_plugins/2_114/trust.py
+++ b/ipaclient/remote_plugins/2_114/trust.py
@@ -936,7 +936,7 @@ class trustdomain_add(Method):
 
 @register()
 class trustdomain_del(Method):
-__doc__ = _("Remove infromation about the domain associated with the trust.")
+__doc__ = _("Remove information about the domain associated with the trust.")
 
 takes_args = (
 parameters.Str(
diff --git a/ipaclient/remote_plugins/2_156/trust.py b/ipaclient/remote_plugins/2_156/trust.py
index 369ffcd181a60b373aadc4bd0314423af76f2f53..39a56383140622faa3f6ea4d64654f5710413791 100644
--- a/ipaclient/remote_plugins/2_156/trust.py
+++ b/ipaclient/remote_plugins/2_156/trust.py
@@ -950,7 +950,7 @@ class trustdomain_add(Method):
 
 @register()
 class trustdomain_del(Method):
-__doc__ = _("Remove infromation about the domain associated with the trust.")
+__doc__ = _("Remove information about the domain associated with the trust.")
 
 takes_args = (
 parameters.Str(
diff --git a/ipaclient/remote_plugins/2_164/trust.py b/ipaclient/remote_plugins/2_164/trust.py
index 369ffcd181a60b373aadc4bd0314423af76f2f53..39a56383140622faa3f6ea4d64654f5710413791 100644
--- a/ipaclient/remote_plugins/2_164/trust.py
+++ b/ipaclient/remote_plugins/2_164/trust.py
@@ -950,7 +950,7 @@ class trustdomain_add(Method):
 
 @register()
 class trustdomain_del(Method):
-__doc__ = _("Remove infromation about the domain associated with the trust.")
+__doc__ = _("Remove information about the domain associated with the trust.")
 
 takes_args = (
 parameters.Str(
diff --git a/ipaserver/plugins/trust.py b/ipaserver/plugins/trust.py
index f2e0b1ee4b261ddc4f29477f46b7f4027af18892..cee82e9d5cfaec36115d1bdd4d30573320548385 100644
--- a/ipaserver/plugins/trust.py
+++ b/ipaserver/plugins/trust.py
@@ -1602,7 +1602,7 @@ class trustdomain_add(LDAPCreate):
 
 @register()
 class trustdomain_del(LDAPDelete):
-__doc__ = _('Remove infromation about the domain associated with the trust.')
+__doc__ = _('Remove information about the domain associated with the trust.')
 
 msg_summary = _('Removed information about the trusted domain "%(value)s"')
 
-- 
2.5.5

-- 
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 33] Correct path to HTTPD's systemd service directory

2016-08-02 Thread Abhijeet Kasurde



On 08/02/2016 08:32 PM, Christian Heimes wrote:

Ticket #5681 and commit 586fee293f42388510fa5436af19460bbe1fdec5 changed
the location of the ipa.conf for Apache HTTPD. The variables
SYSTEMD_SYSTEM_HTTPD_D_DIR and SYSTEMD_SYSTEM_HTTPD_IPA_CONF point to
the wrong directory /etc/systemd/system/httpd.d/. The path is corrected
to  /etc/systemd/system/httpd.service.d/.

https://fedorahosted.org/freeipa/ticket/6158
https://bugzilla.redhat.com/show_bug.cgi?id=1362537



ACK

It is working for me.

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

-- 
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 0018] Minor fix in ipa-replica-manage MAN page

2016-07-26 Thread Abhijeet Kasurde

Ping.


On 07/13/2016 09:24 AM, Abhijeet Kasurde wrote:


Hi All,

Please review patch.

Fixes: https://fedorahosted.org/freeipa/ticket/6058
--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io





--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

-- 
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

[Freeipa-devel] [PATCH 0018] Minor fix in ipa-replica-manage MAN page

2016-07-12 Thread Abhijeet Kasurde

Hi All,

Please review patch.

Fixes: https://fedorahosted.org/freeipa/ticket/6058

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From b2a0e1133145dd672b959811711217d2960ce998 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Tue, 12 Jul 2016 17:08:06 +0530
Subject: [PATCH] Minor fix in ipa-replica-manage MAN page

Fixes: https://fedorahosted.org/freeipa/ticket/6058

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/man/ipa-replica-manage.1 | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/install/tools/man/ipa-replica-manage.1 b/install/tools/man/ipa-replica-manage.1
index 68be0232fae9309b108e69f9144501be3277f503..34cd314a517ae2f74da7bc87d6336e62d7b57118 100644
--- a/install/tools/man/ipa-replica-manage.1
+++ b/install/tools/man/ipa-replica-manage.1
@@ -16,7 +16,7 @@
 .\"
 .\" Author: Rob Crittenden <rcrit...@redhat.com>
 .\"
-.TH "ipa-replica-manage" "1" "Mar 1 2013" "FreeIPA" "FreeIPA Manual Pages"
+.TH "ipa-replica-manage" "1" "Jul 12 2016" "FreeIPA" "FreeIPA Manual Pages"
 .SH "NAME"
 ipa\-replica\-manage \- Manage an IPA replica
 .SH "SYNOPSIS"
@@ -163,15 +163,15 @@ Performing range changes as a delegated administrator (e.g. not using the Direct
 .TP
 List all masters:
  # ipa\-replica\-manage list
- srv1.example.com
- srv2.example.com
- srv3.example.com
- srv4.example.com
+ srv1.example.com: master
+ srv2.example.com: master
+ srv3.example.com: master
+ srv4.example.com: master
 .TP
 List a server's replication agreements.
  # ipa\-replica\-manage list srv1.example.com
- srv2.example.com
- srv3.example.com
+ srv2.example.com: replica
+ srv3.example.com: replica
 .TP
 Re\-initialize a replica:
  # ipa\-replica\-manage re\-initialize \-\-from srv2.example.com
-- 
2.4.11

-- 
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 0017] Added fix for correct IPA backup file name

2016-07-07 Thread Abhijeet Kasurde

Hi Florence,


On 07/07/2016 03:30 PM, Florence Blanc-Renaud wrote:

On 07/07/2016 10:58 AM, Abhijeet Kasurde wrote:

Hi All,

Please review the patch.

Fixes : https://fedorahosted.org/freeipa/ticket/6031

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io




Hi Abhijeet,

thanks for your patch. I have a comment though: if the filename is 
modified in ipa-backup, then it should also be changed in ipa-restore, 
to make sure that the backup can be restored. It may be a good idea to 
define the file name as a constant and use this constant everywhere.



I will change ipa-restore as well.
As far as I can see, the tool ipa-restore checks that the backup 
version and ipa-restore version are consistent, meaning that both 
tools should use the same filename and that it will not break backward 
compatibility, but other team members can confirm.



I will wait for other team members to comment on this.

Flo.


Thanks for your comments.

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

-- 
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

[Freeipa-devel] [PATCH 0017] Added fix for correct IPA backup file name

2016-07-07 Thread Abhijeet Kasurde

Hi All,

Please review the patch.

Fixes : https://fedorahosted.org/freeipa/ticket/6031

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From 5cbf144f0157146ef73185b029259f7cdeffb5b9 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Thu, 7 Jul 2016 14:22:50 +0530
Subject: [PATCH] Added fix for correct IPA backup file name

Fixes: https://fedorahosted.org/freeipa/ticket/6031

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipaserver/install/ipa_backup.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py
index 18a60ecd13c7e7f5381b61ec70ea308a1931b7ec..75c5462ac9a2aa3459382b85e9a97e12de8a4257 100644
--- a/ipaserver/install/ipa_backup.py
+++ b/ipaserver/install/ipa_backup.py
@@ -289,7 +289,7 @@ class Backup(admintool.AdminTool):
 self.log.info('Stopping Directory Server')
 dirsrv.stop(capture_output=False)
 else:
-self.log.info('Stopping IPA services')
+self.log.info('Stopping IPA service')
 run(['ipactl', 'stop'])
 
 instance = installutils.realm_to_serverid(api.env.realm)
@@ -578,10 +578,10 @@ class Backup(admintool.AdminTool):
 
 if data_only:
 backup_dir = os.path.join(paths.IPA_BACKUP_DIR, time.strftime('ipa-data-%Y-%m-%d-%H-%M-%S'))
-filename = os.path.join(backup_dir, "ipa-data.tar")
+filename = os.path.join(backup_dir, "ipa-data.tar.gz")
 else:
 backup_dir = os.path.join(paths.IPA_BACKUP_DIR, time.strftime('ipa-full-%Y-%m-%d-%H-%M-%S'))
-filename = os.path.join(backup_dir, "ipa-full.tar")
+filename = os.path.join(backup_dir, "ipa-full.tar.gz")
 
 os.mkdir(backup_dir)
 os.chmod(backup_dir, 0o700)
-- 
2.4.11

-- 
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] [freeipa-devel][PATCH] Added missing translation to automount.py method

2016-06-16 Thread Abhijeet Kasurde

Hi All,

Please review updated patch.

On 06/15/2016 07:56 PM, Abhijeet Kasurde wrote:



On 06/15/2016 07:29 PM, Martin Basti wrote:




On 15.06.2016 11:13, Abhijeet Kasurde wrote:

Hi All,

Please review the attached patch.

Fixes: https://fedorahosted.org/freeipa/ticket/5920





Thank you for the patch,

Please follow this page for howto create internationalized strings:
http://www.freeipa.org/page/Python_Coding_Style#Python_Internationalized_.28i18n.29_Strings

you must use named subsitution, because translators may need to know 
what should be there, or they may change the order of words depending 
on translated language


Martin^2


Thanks Martin for suggestion. I will implement this in current patch 
and re-submit it for code review.


--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io





--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From 1d04e02adfc2dc49634e0e35f35ed545123ec228 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Wed, 15 Jun 2016 14:39:02 +0530
Subject: [PATCH] Added missing translation to automount.py method

Fixes: https://fedorahosted.org/freeipa/ticket/5920

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipaclient/plugins/automount.py | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/ipaclient/plugins/automount.py b/ipaclient/plugins/automount.py
index 57a80444608314de87cac1dc343fc0206f1fe66e..2d6b8d929da1d849af07f383f0ade905912d93a4 100644
--- a/ipaclient/plugins/automount.py
+++ b/ipaclient/plugins/automount.py
@@ -236,45 +236,45 @@ class automountlocation_import(Command):
 duplicatekeys = result['result']['duplicatekeys']
 skipped = result['result']['skipped']
 
-textui.print_plain('Imported maps:')
+textui.print_plain(_('Imported maps:'))
 for m in maps:
 textui.print_plain(
-'Added %s' % m
+_('Added %(map)s') % dict(map=m)
 )
 textui.print_plain('')
 
-textui.print_plain('Imported keys:')
+textui.print_plain(_('Imported keys:'))
 for k in keys:
 textui.print_plain(
-'Added %s to %s' % (
-k[0], k[1]
+_('Added %(src)s to %(dst)s') % dict(
+src=k[0], dst=k[1]
 )
 )
 textui.print_plain('')
 
 if len(skipped) > 0:
-textui.print_plain('Ignored keys:')
+textui.print_plain(_('Ignored keys:'))
 for k in skipped:
 textui.print_plain(
-'Ignored %s to %s' % (
-k[0], k[1]
+_('Ignored %(src)s to %(dst)s') % dict(
+src=k[0], dst=k[1]
 )
 )
 
 
 if options.get('continue', False) and len(duplicatemaps) > 0:
 textui.print_plain('')
-textui.print_plain('Duplicate maps skipped:')
+textui.print_plain(_('Duplicate maps skipped:'))
 for m in duplicatemaps:
 textui.print_plain(
-'Skipped %s' % m
+_('Skipped %(map)s') % dict(map=m)
 )
 
 
 if options.get('continue', False) and len(duplicatekeys) > 0:
 textui.print_plain('')
-textui.print_plain('Duplicate keys skipped:')
+textui.print_plain(_('Duplicate keys skipped:'))
 for k in duplicatekeys:
 textui.print_plain(
-'Skipped %s' % k
+_('Skipped %(key)s') % dict(key=k)
 )
-- 
2.4.11

-- 
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] [python-pytest-multihost][PATCH 0003] Added force option to rmdir

2016-06-06 Thread Abhijeet Kasurde



On 06/03/2016 03:00 PM, Abhijeet Kasurde wrote:

Hi All,

Please review this patch.




Self-NACK

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

-- 
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] Fix minor typo

2016-06-03 Thread Abhijeet Kasurde



On 06/03/2016 06:50 PM, Yuri Chornoivan wrote:

Hi,

There is a minor typo in one of the FreeIPA user visible messages: 
"you OTP device" -> "your OTP device".


Thanks for fixing it.

Best regards,
Yuri



LGTM

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

-- 
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

[Freeipa-devel] [python-pytest-multihost][PATCH 0003] Added force option to rmdir

2016-06-03 Thread Abhijeet Kasurde

Hi All,

Please review this patch.

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From 9148f39e340f9441be2b9e613485374b0f769559 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 3 Jun 2016 14:54:14 +0530
Subject: [PATCH] Added force option to rmdir

In order to remove directory with contents,
rmdir requires --ignore-fail-on-non-empty option

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 pytest_multihost/transport.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pytest_multihost/transport.py b/pytest_multihost/transport.py
index 8a36f02b56bfb8ba55069f76ebcd11e40ee5dc27..9622fc77698183884e8fe5624c63627426788d16 100644
--- a/pytest_multihost/transport.py
+++ b/pytest_multihost/transport.py
@@ -374,9 +374,12 @@ class OpenSSHTransport(Transport):
 else:
 raise IOError('File %r could not be read' % filename)
 
-def rmdir(self, path):
+def rmdir(self, path, force=False):
 self.log.info('RMDIR %s', path)
-cmd = self._run(['rmdir', path])
+cmdlist = ['rmdir', path]
+if force:
+cmdlist.append('--ignore-fail-on-non-empty')
+cmd = self._run(cmdlist)
 cmd.wait()
 
 def remove_file(self, filepath):
-- 
2.4.11

-- 
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 0013] Updated ipa-server-install man page for domain-level attribute

2016-05-20 Thread Abhijeet Kasurde

Hi All,

Please find the patch for review.

On 05/09/2016 01:28 PM, Petr Spacek wrote:

On 6.5.2016 07:33, Abhijeet Kasurde wrote:

Please review this patch.

Good catch!

In general, I believe that man page should explain what domain level means
(probably with an example of levels 0 and 1) so the user can actually use the
man page to find out what value is needed for his purposes.

Considering this, I have to NACK this patch. Please elaborate.

Thank you!



--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

From e32e9a1b5b1d666d53c575a27beb8dadd09e26cc Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 20 May 2016 16:45:40 +0530
Subject: [PATCH] Updated ipa-server-install man page for domain-level
 attribute

Fixes: https://fedorahosted.org/freeipa/ticket/5708

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/man/ipa-server-install.1 | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/install/tools/man/ipa-server-install.1 b/install/tools/man/ipa-server-install.1
index 55b49449e3c44aebfeefe5cb71d73e9abf07c5b2..7638726c306ed64706c33564f1ca175197e7a7bf 100644
--- a/install/tools/man/ipa-server-install.1
+++ b/install/tools/man/ipa-server-install.1
@@ -1,5 +1,5 @@
 .\" A man page for ipa-server-install
-.\" Copyright (C) 2008 Red Hat, Inc.
+.\" Copyright (C) 2008-2016 Red Hat, Inc.
 .\"
 .\" This program is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 .\"
 .\" Author: Rob Crittenden <rcrit...@redhat.com>
 .\"
-.TH "ipa-server-install" "1" "Jun 28 2012" "FreeIPA" "FreeIPA Manual Pages"
+.TH "ipa-server-install" "1" "May 20 2016" "FreeIPA" "FreeIPA Manual Pages"
 .SH "NAME"
 ipa\-server\-install \- Configure an IPA server
 .SH "SYNOPSIS"
@@ -84,6 +84,9 @@ An unattended installation that will never prompt for user input
 .TP
 \fB\-\-dirsrv\-config\-file\fR
 The path to LDIF file that will be used to modify configuration of dse.ldif during installation of the directory server instance
+.TP
+\fB\-\-domain\-level\fR
+Specifies IPA domain level value. Domain level indicates that server is capable of doing certain operations. Domain level 1 means that it supports replica promotion and topology management. Old IPA servers and IPA servers upgraded to 4.3 in existing environments have domain level 0.
 
 .SS "CERTIFICATE SYSTEM OPTIONS"
 .TP
-- 
2.4.11

-- 
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 0099] ipa-nis-manage: add status option

2016-05-20 Thread Abhijeet Kasurde



On 05/20/2016 04:02 PM, Petr Spacek wrote:

On 12.5.2016 16:17, Petr Spacek wrote:

On 28.4.2016 17:15, Petr Spacek wrote:

On 28.4.2016 14:52, Abhijeet Kasurde wrote:

Hi Petr,

On 04/25/2016 08:28 PM, Petr Spacek wrote:

Hello,

ipa-nis-manage: add status option

https://bugzilla.redhat.com/show_bug.cgi?id=1329275




Can you reword the error message here as well ?

  if len(args) != 1:
  sys.exit("You must specify one action, either enable or disable")

Thanks,
Abhijeet Kasurde

Good catch!

Please review this, thanks.

Ping, please review it.


LGTM. But someone else should approve it.

--
Thanks,
Abhijeet Kasurde

IRC: akasurde
http://akasurde.github.io

--
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 0069] ipa-nis-manage enable: change service name from 'portmap' to 'rpcbind'

2016-05-10 Thread Abhijeet Kasurde



On 05/10/2016 06:48 PM, Martin Basti wrote:




On 10.05.2016 14:50, Gabe Alford wrote:
On Tue, May 10, 2016 at 6:47 AM, Martin Basti <mba...@redhat.com 
<mailto:mba...@redhat.com>> wrote:




On 10.05.2016 14:42, Gabe Alford wrote:

On Tue, May 10, 2016 at 6:26 AM, Martin Basti
<mba...@redhat.com> wrote:



On 10.05.2016 14:13, Gabe Alford wrote:

On Tue, May 10, 2016 at 2:00 AM, Martin Basti
<mba...@redhat.com> wrote:



On 04.05.2016 15:14, Gabe Alford wrote:

On Tue, May 3, 2016 at 11:17 PM, Abhijeet Kasurde
<akasu...@redhat.com> wrote:

Hi Gabe,

I am wondering, how are we handling
"CalledProcessError" exception ?


I am not sure 100% what you are asking, but from what
I understand, the "CalledProcessError" exception is
when a process returns a non-zero exit status.
However when running 'ipa-nis-manage enable', an
exception is never hit even if portmap is not
installed, hence portmap always being enabled.

So it seems that if the process is not installed,
"CalledProcessError" doesn't catch an error.

Gabe

Hello,

portmap.enable() may raise the "CalledProcessError" in
case that systemct enable failed and we should catch
this exception and handle it in the same way as it is
done now. i.e catch that exception and set proper
return state.

Martin^2


Shouldn't "CalledProcessError" raise an exception in this
case? In my testing, it doesn't seem to raise an exception
when the service does not even exist on the system.

Gabe


You are right, there is try-except-pass, so no exception can
be raised

def __enable(self, instance_name=""):
 try:
 ipautil.run([paths.SYSTEMCTL,"enable",
  self.service_instance(instance_name)])
 except ipautil.CalledProcessError:
 pass


Martin


It is also the case for disable(), mask(), unmask(), etc. Should
we update the exception in __enable() or is there a reason that
it just passes at exception?

Gabe


I dont think that we should chnge behavior there, what I'm
missing there is proper logging :) If you want you can create
ticket for it. Leave try-except-pass there, changing this may
affect a lot of places, and there is no time to fix it in 4.4
release.

Martin^2


Sounds good. Do you also want to keep the try-except-pass in 
ipa-nis-manage as well or does my patch suffice?


Gabe


I'm fine with your patch if Abhijeet agree, we can push it.
Martin^2


ACK.





On 05/04/2016 09:17 AM, Gabe Alford wrote:

Hello,

Fix for https://fedorahosted.org/freeipa/ticket/5857

    Thanks,

Gabe



Thanks,
Abhijeet Kasurde

















-- 
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 0015] Added exception handling for mal-formatted XML Parsing

2016-05-10 Thread Abhijeet Kasurde

Hi All,

Please find the patch for review.

Thanks,
Abhijeet Kasurde

On 05/10/2016 01:13 PM, Martin Basti wrote:




On 09.05.2016 07:26, Abhijeet Kasurde wrote:

Hi all,

Please review the patch.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1333755

Thanks,
Abhijeet Kasurde




Hello,

+self.raise_certificate_operation_error('parse',
+   detail=e.msg)

Please use detail=str(e), e.msg is deprecated

Martin^2



From a0bc1905438546e52705648c718b11ae3cbec9c8 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 9 May 2016 10:31:24 +0530
Subject: [PATCH] Added exception handling for mal-formatted XML Parsing

In order to handle mal-formatted XML returned from Dogtag, added
exception handling around etree.fromstring function.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1333755

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipaserver/plugins/dogtag.py | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py
index 3e5a07de4f653b77027320926efbce384a8eb999..162afbf217e63897cb62e4e292f2cfde62f8a5c9 100644
--- a/ipaserver/plugins/dogtag.py
+++ b/ipaserver/plugins/dogtag.py
@@ -5,8 +5,9 @@
 #   Rob Crittenden <rcritten@@redhat.com>
 #   John Dennis <jden...@redhat.com>
 #   Fraser Tweedale <ftwee...@redhat.com>
+#   Abhijeet Kasurde <akasu...@redhat.com>
 #
-# Copyright (C) 2014, 2015  Red Hat
+# Copyright (C) 2014-2016  Red Hat, Inc.
 # see file 'COPYING' for use and warranty information
 #
 # This program is free software; you can redistribute it and/or modify
@@ -1380,7 +1381,11 @@ class ra(rabase.rabase):
 to get the parsing result as a dict of key/value pairs.
 '''
 parser = etree.XMLParser()
-doc = etree.fromstring(xml_text, parser)
+try:
+doc = etree.fromstring(xml_text, parser)
+except etree.XMLSyntaxError as e:
+self.raise_certificate_operation_error('get_parse_result_xml',
+   detail=str(e))
 result = parse_func(doc)
 self.debug("%s() xml_text:\n%s\n"
"parse_result:\n%s" % (parse_func.__name__, xml_text, result))
-- 
2.4.11

-- 
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

[Freeipa-devel] [PATCH 0015] Added exception handling for mal-formatted XML Parsing

2016-05-08 Thread Abhijeet Kasurde

Hi all,

Please review the patch.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1333755

Thanks,
Abhijeet Kasurde

From 7f3d167ddd80bfe767721c2ace069375205b2b84 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 9 May 2016 10:31:24 +0530
Subject: [PATCH] Added exception handling for mal-formatted XML Parsing

In order to handle mal-formatted XML returned from Dogtag, added
exception handling around etree.fromstring function.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1333755

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipaserver/plugins/dogtag.py | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py
index 3e5a07de4f653b77027320926efbce384a8eb999..95d3473fd244cdb418275291b623ef4f2b955401 100644
--- a/ipaserver/plugins/dogtag.py
+++ b/ipaserver/plugins/dogtag.py
@@ -6,7 +6,7 @@
 #   John Dennis <jden...@redhat.com>
 #   Fraser Tweedale <ftwee...@redhat.com>
 #
-# Copyright (C) 2014, 2015  Red Hat
+# Copyright (C) 2014-2016  Red Hat, Inc.
 # see file 'COPYING' for use and warranty information
 #
 # This program is free software; you can redistribute it and/or modify
@@ -1380,7 +1380,11 @@ class ra(rabase.rabase):
 to get the parsing result as a dict of key/value pairs.
 '''
 parser = etree.XMLParser()
-doc = etree.fromstring(xml_text, parser)
+try:
+doc = etree.fromstring(xml_text, parser)
+except etree.XMLSyntaxError as e:
+self.raise_certificate_operation_error('parse',
+   detail=e.msg)
 result = parse_func(doc)
 self.debug("%s() xml_text:\n%s\n"
"parse_result:\n%s" % (parse_func.__name__, xml_text, result))
-- 
2.4.11

-- 
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

[Freeipa-devel] [PATCH 0014] Removed custom implementation of CalledProcessError

2016-05-07 Thread Abhijeet Kasurde

Hi All,

Please review this patch.

Thanks,
Abhijeet Kasurde
From 3fb79f9a2b39dc6e9da67b0234ee7a4de6a39518 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Sat, 7 May 2016 11:33:21 +0530
Subject: [PATCH] Removed custom implementation of CalledProcessError

Removed custom class of CalledProcessError which was required for
Python versions prior to 2.5

Fixes: https://fedorahosted.org/freeipa/ticket/5717

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipapython/ipautil.py | 17 ++---
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 4597f1c63e21169d4dbbfb2c919b1ee2cb6a35e7..d4c8e8b82ac22d8903f77f1acc8edc8c0e98e458 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -1,6 +1,6 @@
 # Authors: Simo Sorce <sso...@redhat.com>
 #
-# Copyright (C) 2007-2011  Red Hat
+# Copyright (C) 2007-2016  Red Hat, Inc.
 # see file 'COPYING' for use and warranty information
 #
 # This program is free software; you can redistribute it and/or modify
@@ -40,6 +40,7 @@ import grp
 from contextlib import contextmanager
 import locale
 import collections
+from subprocess import CalledProcessError
 
 from dns import resolver, reversename
 from dns.exception import DNSException
@@ -64,20 +65,6 @@ KRB5_KDC_UNREACH = 2529639068 # Cannot contact any KDC for requested realm
 KRB5KDC_ERR_SVC_UNAVAILABLE = 2529638941 # A service is not available that is
  # required to process the request
 
-try:
-from subprocess import CalledProcessError
-except ImportError:
-# Python 2.4 doesn't implement CalledProcessError
-class CalledProcessError(Exception):
-"""This exception is raised when a process run by check_call() returns
-a non-zero exit status. The exit status will be stored in the
-returncode attribute."""
-def __init__(self, returncode, cmd, output=None):
-self.returncode = returncode
-self.cmd = cmd
-self.output = output
-def __str__(self):
-return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
 
 def get_domain_name():
 try:
-- 
2.4.11

-- 
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

[Freeipa-devel] [PATCH 0013] Updated ipa-server-install man page for domain-level attribute

2016-05-05 Thread Abhijeet Kasurde

Hi All,

Please review this patch.

Thanks,
Abhijeet Kasurde
From 5377256ef52122506746f09694b1f66c28df0af1 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 6 May 2016 10:54:38 +0530
Subject: [PATCH] Updated ipa-server-install man page for domain-level
 attribute

ipa-server-install man page now provides information related to
domain-level command line option.

Fixes: https://fedorahosted.org/freeipa/ticket/5708

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/man/ipa-server-install.1 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/install/tools/man/ipa-server-install.1 b/install/tools/man/ipa-server-install.1
index 242b41b774081b7b2ab2848bf3a2b872c8efce94..c9ff84c6206ffa60378ca24643afe8991e9bb600 100644
--- a/install/tools/man/ipa-server-install.1
+++ b/install/tools/man/ipa-server-install.1
@@ -84,6 +84,9 @@ An unattended installation that will never prompt for user input
 .TP
 \fB\-\-dirsrv\-config\-file\fR
 The path to LDIF file that will be used to modify configuration of dse.ldif during installation of the directory server instance
+.TP
+\fB\-\-domain\-level\fR
+Specifies IPA domain level value.
 
 .SS "CERTIFICATE SYSTEM OPTIONS"
 .TP
-- 
2.4.11

-- 
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

[Freeipa-devel] [PATCH] Replaced find_hostname with api.env.host

2016-05-05 Thread Abhijeet Kasurde

Hi All,

Please review this patch.

Thanks for mbasti for helping me.

Thanks,
Abhijeet Kasurde
From 402fa7f09fe7a470044c1f5c1c10699cad75100f Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Thu, 5 May 2016 17:58:09 +0530
Subject: [PATCH] Replaced find_hostname with api.env.host

Fixes: https://fedorahosted.org/freeipa/ticket/5841

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipaserver/install/server/upgrade.py | 22 +-
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
index 4f3a2cb065319a26bfa517b4d1d2cb4b41fb486d..38fe2c3e89da55faa30c624983cb8f9c630357b3 100644
--- a/ipaserver/install/server/upgrade.py
+++ b/ipaserver/install/server/upgrade.py
@@ -94,23 +94,6 @@ def update_conf(sub_dict, filename, template_filename):
 fd.write(template)
 fd.close()
 
-def find_hostname():
-"""Find the hostname currently configured in ipa-rewrite.conf"""
-filename=paths.HTTPD_IPA_REWRITE_CONF
-
-if not ipautil.file_exists(filename):
-return None
-
-pattern = "^[\s#]*.*https:\/\/([A-Za-z0-9\.\-]*)\/.*"
-p = re.compile(pattern)
-for line in fileinput.input(filename):
-if p.search(line):
-fileinput.close()
-return p.search(line).group(1)
-fileinput.close()
-
-raise RuntimeError("Unable to determine the fully qualified hostname from %s" % filename)
-
 def find_autoredirect(fqdn):
 """
 When upgrading ipa-rewrite.conf we need to see if the automatic redirect
@@ -1437,10 +1420,7 @@ def upgrade_configuration():
 
 fstore = sysrestore.FileStore(paths.SYSRESTORE)
 
-fqdn = find_hostname()
-if fqdn is None:
-# ipa-rewrite.conf doesn't exist, nothing to do
-raise RuntimeError("ipa-rewrite.conf doesn't exists (is this server?)")
+fqdn = api.env.host
 
 # Ok, we are an IPA server, do the additional tests
 ds_serverid = installutils.realm_to_serverid(api.env.realm)
-- 
2.4.11

-- 
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 0069] ipa-nis-manage enable: change service name from 'portmap' to 'rpcbind'

2016-05-03 Thread Abhijeet Kasurde

Hi Gabe,

I am wondering, how are we handling "CalledProcessError" exception ?

On 05/04/2016 09:17 AM, Gabe Alford wrote:

Hello,

Fix for https://fedorahosted.org/freeipa/ticket/5857

Thanks,

Gabe



Thanks,
Abhijeet Kasurde
-- 
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] Improving bug reporting

2016-05-03 Thread Abhijeet Kasurde



On 05/03/2016 07:05 PM, Jakub Hrozek wrote:

On Tue, May 03, 2016 at 01:45:39PM +0200, David Kupka wrote:

Hello everyone!

I often miss proper reproducer and other important info in trac tickets.
Asking for the missing info or guessing and trying is as ineffective as it
sounds and costs us a lot of time and effort. I believe we can improve that.

We have guidelines for reporting a bug [1] but it obviously isn't enough. I
propose to prefill track ticket's description with following (or similar)
template and be strict on refusing (i.e. closing as invalid) tickets that
are incomplete.

Any thoughts, suggestions, agreement or disagreement?

I'll just throw the sssd page we have on the subject:
 https://fedorahosted.org/sssd/wiki/Reporting_sssd_bugs

I would at least add the note about security-sensitive bugs to the
freeipa page, we really don't want CVEs being reported to trac :-)

Is there any automated script which can do this for us, something like 
sosreport ?
If not then it would be good idea to invest time and efforts to have one 
script to gather all logs and reports.


Thanks,
Abhijeet Kasurde

--
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


[Freeipa-devel] [PATCH] Fix added to ipa-compat-manage command line help

2016-05-02 Thread Abhijeet Kasurde

Hi All,

Please review this patch.

Thanks,
Abhijeet Kasurde
From bf4de8ebbc02549ba278fd85d8ed586d72d0acc4 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 2 May 2016 15:45:28 +0530
Subject: [PATCH] Fix added to ipa-compat-manage command line help

Minor fix in ipa-compat-manage command help message.

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/ipa-compat-manage | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/install/tools/ipa-compat-manage b/install/tools/ipa-compat-manage
index 29d1295f942fcd3024f283b00c8ac71f993e389b..2b13c4a68531c7b6261465399b59225db094aba2 100755
--- a/install/tools/ipa-compat-manage
+++ b/install/tools/ipa-compat-manage
@@ -2,7 +2,7 @@
 # Authors: Rob Crittenden <rcrit...@redhat.com>
 # Authors: Simo Sorce <sso...@redhat.com>
 #
-# Copyright (C) 2008  Red Hat
+# Copyright (C) 2008-2016  Red Hat, Inc.
 # see file 'COPYING' for use and warranty information
 #
 # This program is free software; you can redistribute it and/or modify
@@ -45,7 +45,7 @@ compat_dn = DN(('cn', 'Schema Compatibility'), ('cn', 'plugins'), ('cn', 'config
 nis_config_dn = DN(('cn', 'NIS Server'), ('cn', 'plugins'), ('cn', 'config'))
 
 def parse_options():
-usage = "%prog [options] <enable|disable>\n"
+usage = "%prog [options] <enable|disable|status>\n"
 usage += "%prog [options]\n"
 parser = OptionParser(usage=usage, formatter=config.IPAFormatter())
 
@@ -88,7 +88,7 @@ def main():
 options, args = parse_options()
 
 if len(args) != 1:
-sys.exit("You must specify one action, either enable or disable")
+sys.exit("You must specify one action: enable | disable | status")
 elif args[0] != "enable" and args[0] != "disable" and args[0] != "status":
 sys.exit("Unrecognized action [" + args[0] + "]")
 
-- 
2.4.11

-- 
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

[Freeipa-devel] [PATCH] Updated ipa command man page

2016-04-29 Thread Abhijeet Kasurde

Hi All,

Please review this patch.

Thanks,
Abhijeet Kasurde
From 112c23f10b428267fac562de43400c272a478341 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 29 Apr 2016 14:35:18 +0530
Subject: [PATCH] Updated ipa command man page

Updated references and ipa command example in IPA man page

Fixes : https://bugzilla.redhat.com/show_bug.cgi?id=1330843

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipa.1 | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/ipa.1 b/ipa.1
index ec7e5da7077a41095fdaa75babb1b680f3522f7f..9194ca0717cb4895b825fdc2783834a9749624a9 100644
--- a/ipa.1
+++ b/ipa.1
@@ -1,5 +1,5 @@
 .\" A man page for ipa
-.\" Copyright (C) 2010 Red Hat, Inc.
+.\" Copyright (C) 2010-2016 Red Hat, Inc.
 .\"
 .\" This program is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 .\"
 .\" Author: Pavel Zuna <pz...@redhat.com>
 .\"
-.TH "ipa" "1" "Jan 24 2012" "FreeIPA" "FreeIPA Manual Pages"
+.TH "ipa" "1" "Apr 29 2016" "FreeIPA" "FreeIPA Manual Pages"
 .SH "NAME"
 ipa \- IPA command\-line interface
 .SH "SYNOPSIS"
@@ -174,9 +174,6 @@ Same as the previous example, except this time the users first name has to be ex
 \fBipa user\-find foo \-\-first bar \-\-last foo\fR
 A user with uid "foobar", first name "bar" and last name "foo" would match the search criteria.
 .TP
-\fBipa user\-find \-\-uuid 936407bd\-da9b\-11de\-9abd\-54520012e7cd\fR
-Only the user with the specified IPA unique ID would match the search criteria.
-.TP
 \fBipa user\-find\fR
 All users would match the search criteria (as there are none).
 .SH "SERVERS"
@@ -203,6 +200,5 @@ IPA default configuration file.
 ipa\-client\-install(1), ipa\-compat\-manage(1), ipactl(1), ipa\-dns\-install(1),
 ipa\-getcert(1), ipa\-getkeytab(1), ipa\-join(1), ipa\-ldap\-updater(1),
 ipa\-nis\-manage(1), ipa\-replica\-install(1), ipa\-replica\-manage(1), ipa\-replica\-prepare(1),
-ipa\-rmkeytab(1), ipa\-server\-certinstall(2), ipa\-server\-install(1), ipa\-upgradeconfig(1),
-ipa\-host\-net\-manage(1)
+ipa\-rmkeytab(1), ipa\-server\-certinstall(2), ipa\-server\-install(1), ipa\-server\-upgrade(1)
 
-- 
2.4.11

-- 
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 0099] ipa-nis-manage: add status option

2016-04-28 Thread Abhijeet Kasurde

Hi Petr,

On 04/25/2016 08:28 PM, Petr Spacek wrote:

Hello,

ipa-nis-manage: add status option

https://bugzilla.redhat.com/show_bug.cgi?id=1329275




Can you reword the error message here as well ?

 if len(args) != 1:
 sys.exit("You must specify one action, either enable or disable")

Thanks,
Abhijeet Kasurde
-- 
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] Added warning to user for Internet Explorer

2016-04-27 Thread Abhijeet Kasurde

Updated patch attached.

On 04/26/2016 09:07 PM, Rob Crittenden wrote:

Internet Explorer is no longer a supported browser.


From 5a076ee78bc8d779f480f8c6d06c4a74cfad7343 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 25 Apr 2016 16:23:33 +0530
Subject: [PATCH] Added warning to user for Internet Explorer

As Internet Explorer is not a supported browser anymore, browser Kerberos
configuration page shows warning to user about the same.

Fixes : https://fedorahosted.org/freeipa/ticket/5656

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/html/ssbrowser.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/install/html/ssbrowser.html b/install/html/ssbrowser.html
index 325c2d393067c52fade653494c1917a9af51394f..49d8c5be1a5c07fca0593b6c7d0252a2faf15abf 100644
--- a/install/html/ssbrowser.html
+++ b/install/html/ssbrowser.html
@@ -122,6 +122,7 @@
 
 
 Internet Explorer
+WARNING: Internet Explorer is no longer a supported browser.
 
 Once you are able to log into the workstation with your kerberos key you are now able to use that ticket in Internet Explorer.
 
-- 
2.4.11

-- 
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

[Freeipa-devel] [PATCH] Added warning to user for Internet Explorer

2016-04-25 Thread Abhijeet Kasurde

Hi All,

Please review the attached patch.

Thanks,
Abhijeet Kasurde
From 86eac1c78f1f754f6e31f8d794e89ac5b50d64d3 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 25 Apr 2016 16:23:33 +0530
Subject: [PATCH] Added warning to user for Internet Explorer

As Internet Explorer is not supported browser, browser Kerberos
configuration page shows warning to user about the same.

Fixes : https://fedorahosted.org/freeipa/ticket/5656

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/html/ssbrowser.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/install/html/ssbrowser.html b/install/html/ssbrowser.html
index 325c2d393067c52fade653494c1917a9af51394f..cdd61d0b492f68f47b6e70c2252ad61297febb79 100644
--- a/install/html/ssbrowser.html
+++ b/install/html/ssbrowser.html
@@ -122,6 +122,7 @@
 
 
 Internet Explorer
+WARNING: Internet Explorer is no longer supported browser.
 
 Once you are able to log into the workstation with your kerberos key you are now able to use that ticket in Internet Explorer.
 
-- 
2.4.11

-- 
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

[Freeipa-devel] [PATCH] Added fix for notifying user about locked user account in WebUI

2016-04-19 Thread Abhijeet Kasurde

Hi All,

Please review this patch.

Fixes : https://fedorahosted.org/freeipa/ticket/5076

Thanks,
Abhijeet Kasurde
From c921ae88b8497bc4bf47efe1d97fcf9df9907d31 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Wed, 20 Apr 2016 11:09:53 +0530
Subject: [PATCH] Added fix for notifying user about locked user account in
 WebUI

User in now notified about "Locked User account" message instead of
"The password or username you entered is incorrect" or any generic error
message

Fixes : https://fedorahosted.org/freeipa/ticket/5076

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/ui/src/freeipa/ipa.js |  3 ++-
 install/ui/src/freeipa/widgets/LoginScreen.js |  5 +
 ipalib/errors.py  |  6 ++
 ipaserver/rpcserver.py| 12 +++-
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
index e241ad30ddc7492fd3e21daa051516ef46a93014..830def0542faeb14b62b71fb80c753bc121cace7 100644
--- a/install/ui/src/freeipa/ipa.js
+++ b/install/ui/src/freeipa/ipa.js
@@ -498,7 +498,8 @@ IPA.login_password = function(username, password) {
 if (reason === 'password-expired' ||
 reason === 'denied' ||
 reason === 'krbprincipal-expired' ||
-reason === 'invalid-password') {
+reason === 'invalid-password' ||
+reason === 'user-locked') {
 result = reason;
 }
 }
diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index a9f70cce7f8bda01efc1b98f88765aff3c17b73c..56b3888949745e200de91406dddc6f36d5d31bb1 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -71,6 +71,8 @@ define(['dojo/_base/declare',
 
 invalid_password: "The password you entered is incorrect. ",
 
+user_locked: "The user account you entered is locked. ",
+
 //nodes:
 login_btn_node: null,
 reset_btn_node: null,
@@ -240,6 +242,9 @@ define(['dojo/_base/declare',
 } else if (result === 'invalid-password') {
 password_f.set_value('');
 val_summary.add_error('login', this.invalid_password);
+} else if (result === 'user-locked') {
+password_f.set_value('');
+val_summary.add_error('login', this.user_locked);
 } else {
 password_f.set_value('');
 val_summary.add_error('login', this.form_auth_failed);
diff --git a/ipalib/errors.py b/ipalib/errors.py
index 67ed2818f2d6270c6a27fba10783ac9b1958a0f5..52fa25f02e02d1d71c012f32d761b64a838917be 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -607,6 +607,12 @@ class KrbPrincipalExpired(SessionError):
 """
 errno = 1203
 
+class UserLocked(SessionError):
+"""
+**1204** Raised when a user account is locked.
+"""
+errno = 1204
+
 ##
 # 2000 - 2999: Authorization errors
 class AuthorizationError(PublicError):
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index 96f82d5e299b7887dd4af4da0a0db141f556e0bf..df647366925a36117afbc57f03b2fe03460b7676 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -43,7 +43,7 @@ from ipalib.capabilities import VERSION_WITHOUT_CAPABILITIES
 from ipalib.backend import Executioner
 from ipalib.errors import (PublicError, InternalError, CommandError, JSONError,
 CCacheError, RefererError, InvalidSessionPassword, NotFound, ACIError,
-ExecutionError, PasswordExpired, KrbPrincipalExpired)
+ExecutionError, PasswordExpired, KrbPrincipalExpired, UserLocked)
 from ipalib.request import context, destroy_context
 from ipalib.rpc import (xml_dumps, xml_loads,
 json_encode_binary, json_decode_binary)
@@ -954,6 +954,11 @@ class login_password(Backend, KerberosSession, HTTP_Status):
  start_response,
  str(e),
  'krbprincipal-expired')
+except UserLocked as e:
+return self.unauthorized(environ,
+ start_response,
+ str(e),
+ 'user-locked')
 
 return self.finalize_kerberos_acquisition('login_password', ipa_ccache_name, environ, start_response)
 
@@ -993,9 +998,14 @@ class login_password(Backend, KerberosSession, HTTP_Status):
   ' has expired while getting initial credentials') in str(e):
 raise KrbPrincipalExpired(principal=principal,
  

[Freeipa-devel] [PATCH] Added description related to 'status' in ipactl man page

2016-04-15 Thread Abhijeet Kasurde

Hi All,

Please review these patches.

Fixes: https://fedorahosted.org/freeipa/ticket/5768

Thanks,
Abhijeet Kasurde
From 30cf270e439e10155cc71890e12a636ba9b6 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 15 Apr 2016 16:55:41 +0530
Subject: [PATCH] Added description related to 'status' in ipactl man page

Fixes : https://fedorahosted.org/freeipa/ticket/5768

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/man/ipactl.8 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/install/tools/man/ipactl.8 b/install/tools/man/ipactl.8
index 136fe9ac6fe7dbff5618543c1958565bab87502a..fb533aae2009628473654a85e3a9b006e4f17b1f 100644
--- a/install/tools/man/ipactl.8
+++ b/install/tools/man/ipactl.8
@@ -38,6 +38,9 @@ Stop all of the services that make up IPA
 restart
 Stop then start all of the services that make up IPA
 .TP
+status
+Provides status of all the services that make up IPA
+.TP
 \fB\-d\fR, \fB\-\-debug\fR
 Display debugging information
 .TP
-- 
2.4.3

From acad93ee07a4cbfb1bd2420eda6ed2fdd97be043 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 15 Apr 2016 16:58:49 +0530
Subject: [PATCH] Added description related to 'status' in ipactl man page

Fixes : https://fedorahosted.org/freeipa/ticket/5768

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/man/ipactl.8 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/install/tools/man/ipactl.8 b/install/tools/man/ipactl.8
index 136fe9ac6fe7dbff5618543c1958565bab87502a..fb533aae2009628473654a85e3a9b006e4f17b1f 100644
--- a/install/tools/man/ipactl.8
+++ b/install/tools/man/ipactl.8
@@ -38,6 +38,9 @@ Stop all of the services that make up IPA
 restart
 Stop then start all of the services that make up IPA
 .TP
+status
+Provides status of all the services that make up IPA
+.TP
 \fB\-d\fR, \fB\-\-debug\fR
 Display debugging information
 .TP
-- 
2.4.3

From b9c4014ab2b4bf7d8a98cc3e5fee02ab4a48edbc Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 15 Apr 2016 17:03:39 +0530
Subject: [PATCH] Added description related to 'status' in ipactl man page

Fixes : https://fedorahosted.org/freeipa/ticket/5768

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/tools/man/ipactl.8 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/install/tools/man/ipactl.8 b/install/tools/man/ipactl.8
index 136fe9ac6fe7dbff5618543c1958565bab87502a..fb533aae2009628473654a85e3a9b006e4f17b1f 100644
--- a/install/tools/man/ipactl.8
+++ b/install/tools/man/ipactl.8
@@ -38,6 +38,9 @@ Stop all of the services that make up IPA
 restart
 Stop then start all of the services that make up IPA
 .TP
+status
+Provides status of all the services that make up IPA
+.TP
 \fB\-d\fR, \fB\-\-debug\fR
 Display debugging information
 .TP
-- 
2.4.3

-- 
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] Added fix for notifying user about account expiration in Web UI

2016-04-13 Thread Abhijeet Kasurde

Ping

On 03/22/2016 04:32 PM, Abhijeet Kasurde wrote:

Hi All,

Please find the updated patches as per review comments.

On 03/18/2016 07:39 PM, Petr Vobornik wrote:

On 03/18/2016 02:21 PM, Abhijeet Kasurde wrote:

Hi All,

Please review these patches.

Fixes : https://fedorahosted.org/freeipa/ticket/5077

Thanks,
Abhijeet Kasurde



'invalid' is a default and right now is meant for invalid 
password(not correct, see below). So by reading the patch, it will 
break the case when user sets invalid password.


Better would be to process kinit output in 
rpcserver.py:login_password and set e.g: 'krbprincipal-expired' reason.


Then add it to a list of known errors in ipa.js:login_password:498. 
We should probaly add also 'invalid-password' to the list.


Then do the change as in this patch but only with: 
'krbprincipal-expired'.


If 'invalid-password' is added to the list of know errors then we 
should change the default error from "The password or username you 
entered is incorrect. " to e.g.: 'Login failed from unknown reason"



Thanks Petr for suggestions.

Thanks,
Abhijeet Kasurde




-- 
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] Added fix for notifying user about account expiration in Web UI

2016-03-22 Thread Abhijeet Kasurde

Hi All,

Please find the updated patches as per review comments.

On 03/18/2016 07:39 PM, Petr Vobornik wrote:

On 03/18/2016 02:21 PM, Abhijeet Kasurde wrote:

Hi All,

Please review these patches.

Fixes : https://fedorahosted.org/freeipa/ticket/5077

Thanks,
Abhijeet Kasurde



'invalid' is a default and right now is meant for invalid password(not 
correct, see below). So by reading the patch, it will break the case 
when user sets invalid password.


Better would be to process kinit output in rpcserver.py:login_password 
and set e.g: 'krbprincipal-expired' reason.


Then add it to a list of known errors in ipa.js:login_password:498. We 
should probaly add also 'invalid-password' to the list.


Then do the change as in this patch but only with: 
'krbprincipal-expired'.


If 'invalid-password' is added to the list of know errors then we 
should change the default error from "The password or username you 
entered is incorrect. " to e.g.: 'Login failed from unknown reason"



Thanks Petr for suggestions.

Thanks,
Abhijeet Kasurde
From 908b71768f1cce792d5111434dbb73c71a4cedc3 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Tue, 22 Mar 2016 15:41:36 +0530
Subject: [PATCH] Added fix for notifying user about Kerberos principal
 expiration in WebUI

- User is now notified about "Kerberos Principal expiration" message instead of
  "Wrong username or password" message.
- User is also notified about "Invalid password" message instead of
  generic error message.

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/ui/src/freeipa/ipa.js |  7 +--
 install/ui/src/freeipa/widgets/LoginScreen.js | 13 +++--
 ipalib/errors.py  |  8 +++-
 ipaserver/rpcserver.py| 13 +++--
 4 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
index 29af4048740894c6d46b5419a941e2a48cd68775..e241ad30ddc7492fd3e21daa051516ef46a93014 100644
--- a/install/ui/src/freeipa/ipa.js
+++ b/install/ui/src/freeipa/ipa.js
@@ -5,7 +5,7 @@
  *John Dennis <jden...@redhat.com>
  *Petr Vobornik <pvobo...@redhat.com>
  *
- * Copyright (C) 2010 Red Hat
+ * Copyright (C) 2010-2016 Red Hat
  * see file 'COPYING' for use and warranty information
  *
  * This program is free software; you can redistribute it and/or modify
@@ -495,7 +495,10 @@ IPA.login_password = function(username, password) {
 
 //change result from invalid only if we have a header which we
 //understand
-if (reason === 'password-expired' || reason === 'denied') {
+if (reason === 'password-expired' ||
+reason === 'denied' ||
+reason === 'krbprincipal-expired' ||
+reason === 'invalid-password') {
 result = reason;
 }
 }
diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index 17f891e0ee1d200eb4c9aa881dafcac5fc2c86da..a9f70cce7f8bda01efc1b98f88765aff3c17b73c 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -1,7 +1,7 @@
 /*  Authors:
  *Petr Vobornik <pvobo...@redhat.com>
  *
- * Copyright (C) 2013 Red Hat
+ * Copyright (C) 2013-2016 Red Hat
  * see file 'COPYING' for use and warranty information
  *
  * This program is free software; you can redistribute it and/or modify
@@ -57,7 +57,7 @@ define(['dojo/_base/declare',
 "configured" +
 " the browser correctly, then click Login. ",
 
-form_auth_failed: "The password or username you entered is incorrect. ",
+form_auth_failed: "Login failed due to an unknown reason. ",
 
 krb_auth_failed: "Authentication with Kerberos failed",
 
@@ -67,6 +67,9 @@ define(['dojo/_base/declare',
 
 denied: "Sorry you are not allowed to access this service.",
 
+krbprincipal_expired: "Kerberos Principal you entered is expired.",
+
+invalid_password: "The password you entered is incorrect. ",
 
 //nodes:
 login_btn_node: null,
@@ -231,6 +234,12 @@ define(['dojo/_base/declare',
 } else if (result === 'password-expired') {
 this.set('view', 'reset');
 val_summary.add_info('login', this.password_expired);
+} else if (result === 'krbprincipal-expired') {
+password_f.set_value('');
+val_summary.add_error('login', this.krbprincipal_expired);
+} else if (result === 'invalid-password') {
+password_f.set_value('');
+val_summary.add_error('login', this.invalid_password);
 } else {

[Freeipa-devel] [PATCH] Added fix for notifying user about account expiration in Web UI

2016-03-19 Thread Abhijeet Kasurde

Hi All,

Please review these patches.

Fixes : https://fedorahosted.org/freeipa/ticket/5077

Thanks,
Abhijeet Kasurde
From 4b4b34902910cb5e99739292f7005a1584c131e5 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 18 Mar 2016 18:20:22 +0530
Subject: [PATCH] Added fix for notifying user about account expiration in Web
 UI

User is now notified about "Kerberos Principal expiration" message instead of
"Wrong username or password" message.

Fixes: https://fedorahosted.org/freeipa/ticket/5077

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/ui/src/freeipa/widgets/LoginScreen.js | 4 
 1 file changed, 4 insertions(+)

diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index 17f891e0ee1d200eb4c9aa881dafcac5fc2c86da..2002a75336ebffa872c291144df4245689d8 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -67,6 +67,7 @@ define(['dojo/_base/declare',
 
 denied: "Sorry you are not allowed to access this service.",
 
+user_expired: "Your account has expired.",
 
 //nodes:
 login_btn_node: null,
@@ -231,6 +232,9 @@ define(['dojo/_base/declare',
 } else if (result === 'password-expired') {
 this.set('view', 'reset');
 val_summary.add_info('login', this.password_expired);
+} else if (result === 'invalid') {
+password_f.set_value('');
+val_summary.add_error('login', this.user_expired);
 } else {
 password_f.set_value('');
 val_summary.add_error('login', this.form_auth_failed);
-- 
2.4.3

From 33a8c264aeb178911c3e05460811ceec21f88f54 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 18 Mar 2016 18:43:11 +0530
Subject: [PATCH] Added fix for notifying user about account expiration in Web
 UI

User is now notified about "Kerberos Principal expiration" message instead of
"Wrong username or password" message.

Fixes: https://fedorahosted.org/freeipa/ticket/5077

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/ui/src/freeipa/widgets/LoginScreen.js | 4 
 1 file changed, 4 insertions(+)

diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index 2c778b50cfb10bfa8eef25c5456c6ce913e02695..71aaad51dda9a0045fe6ce18be7fa0227893c72b 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -67,6 +67,7 @@ define(['dojo/_base/declare',
 
 denied: "Sorry you are not allowed to access this service.",
 
+user_expired: "Your account has expired.",
 
 //nodes:
 login_btn_node: null,
@@ -231,6 +232,9 @@ define(['dojo/_base/declare',
 } else if (result === 'password-expired') {
 this.set('view', 'reset');
 val_summary.add_info('login', this.password_expired);
+} else if (result === 'invalid') {
+password_f.set_value('');
+val_summary.add_error('login', this.user_expired);
 } else {
 password_f.set_value('');
 val_summary.add_error('login', this.form_auth_failed);
-- 
2.4.3

From d85dff4fe8d324f7008d98df117fd851703052e5 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Fri, 18 Mar 2016 18:46:55 +0530
Subject: [PATCH] Added fix for notifying user about account expiration in Web
 UI

User is now notified about "Kerberos Principal expiration" message instead of
"Wrong username or password" message.

Fixes: https://fedorahosted.org/freeipa/ticket/5077

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/ui/src/freeipa/widgets/LoginScreen.js | 4 
 1 file changed, 4 insertions(+)

diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index 2c778b50cfb10bfa8eef25c5456c6ce913e02695..71aaad51dda9a0045fe6ce18be7fa0227893c72b 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -67,6 +67,7 @@ define(['dojo/_base/declare',
 
 denied: "Sorry you are not allowed to access this service.",
 
+user_expired: "Your account has expired.",
 
 //nodes:
 login_btn_node: null,
@@ -231,6 +232,9 @@ define(['dojo/_base/declare',
 } else if (result === 'password-expired') {
 this.set('view', 'reset');
 val_summary.add_info('login', this.password_expired);
+} else if (result === 'invalid') {
+password_

Re: [Freeipa-devel] [PATCH] Added kpasswd_server directive in client krb5.conf

2016-01-20 Thread Abhijeet Kasurde

Hi Christian,

On 01/20/2016 04:15 PM, Christian Heimes wrote:

On 2016-01-20 08:30, Abhijeet Kasurde wrote:

Ping for review request.

Hi,

your initial patch has a small problem. Please provide a new patch with
port 464 instead of 749.

Christian



Please find the patches for review.

Thanks,
Abhijeet
From bfb646e2a77151bd0fcfd61d50e23afb04266581 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 21 Dec 2015 12:03:10 +0530
Subject: [PATCH] Added kpasswd_server directive in client krb5.conf

While configuring ipa client using ipa-client-install can configure
kpasswd_server explicitly using directive in client's krb5.conf

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipa-client/ipa-install/ipa-client-install | 4 
 1 file changed, 4 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index af8d27bd0da9b847fef917d3bcc2ebd1837c5fb0..443a4429f45e6c3f572d4f21a795549c0257 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1106,6 +1106,10 @@ def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
 kropts.append({'name':'kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'master_kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'admin_server', 'type':'option', 'value':ipautil.format_netloc(server, 749)})
+kropts.append({'name': 'kpasswd_server',
+   'type': 'option',
+   'value': ipautil.format_netloc(server, 464)
+  })
 kropts.append({'name':'default_domain', 'type':'option', 'value':cli_domain})
 kropts.append({'name':'pkinit_anchors', 'type':'option', 'value':'FILE:%s' % CACERT})
 ropts = [{'name':cli_realm, 'type':'subsection', 'value':kropts}]
-- 
2.4.3

From ace7705e73e0af67253d0484d7dad2f7f1fa4e77 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 21 Dec 2015 12:11:31 +0530
Subject: [PATCH] Added kpasswd_server directive in client krb5.conf

While configuring ipa client using ipa-client-install can configure
kpasswd_server explicitly using directive in client's krb5.conf

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipa-client/ipa-install/ipa-client-install | 4 
 1 file changed, 4 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 789ff591591673744ee3b922e5c0181233ad553c..14d1dc98a23fed8ffe147c0c03711e7d7467edef 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1103,6 +1103,10 @@ def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
 kropts.append({'name':'kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'master_kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'admin_server', 'type':'option', 'value':ipautil.format_netloc(server, 749)})
+kropts.append({'name': 'kpasswd_server',
+   'type': 'option',
+   'value': ipautil.format_netloc(server, 464)
+  })
 kropts.append({'name':'default_domain', 'type':'option', 'value':cli_domain})
 kropts.append({'name':'pkinit_anchors', 'type':'option', 'value':'FILE:%s' % CACERT})
 ropts = [{'name':cli_realm, 'type':'subsection', 'value':kropts}]
-- 
2.4.3

-- 
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] Fixed login error message box in LoginScreen page

2016-01-19 Thread Abhijeet Kasurde

Ping for review request.

On 12/28/2015 12:36 PM, Abhijeet Kasurde wrote:

Hi All,

Please review patches attached.

Thanks,
Abhijeet Kasurde




-- 
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] Added kpasswd_server directive in client krb5.conf

2016-01-19 Thread Abhijeet Kasurde

Ping for review request.

On 01/06/2016 10:37 AM, Abhijeet Kasurde wrote:

Hi All,

On 01/05/2016 04:52 PM, Christian Heimes wrote:

On 2016-01-04 23:38, Nalin Dahyabhai wrote:

On Mon, Dec 21, 2015 at 12:17:08PM +0530, Abhijeet Kasurde wrote:

Hi All,

Please review patches attached.

The port number should probably be changed from 749 to 464.

Nalin is correct. kpasswd and admin server use different ports:

$ getent services kpasswd
kpasswd   464/tcp kpwd
$ getent services kerberos-adm
kerberos-adm  749/tcp

Except for the port number, the patch looks good to me.

Changed port number from 749 to 464. Thanks Nalin and Christian.

Please review patches attached.

Christian


Thanks,
Abhijeet Kasurde




-- 
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

[Freeipa-devel] [pytest-multihost-devel][PATCH] Warn user about missing multihost conf file

2016-01-05 Thread Abhijeet Kasurde

Hi All,

Please review attached patch

Fixes : https://fedorahosted.org/python-pytest-multihost/ticket/3

Thanks,
Abhijeet Kasurde
From 0fc2238dd0bd26a789232ffaec058ac59f304e43 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Wed, 6 Jan 2016 11:38:24 +0530
Subject: [PATCH] Added error handling in config file handling.

The fix provides error handling in multihost configuration file handling,
by notifying user about exact error message about missing or wrong
configuration file.

https://fedorahosted.org/python-pytest-multihost/ticket/3

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 pytest_multihost/plugin.py | 27 ---
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/pytest_multihost/plugin.py b/pytest_multihost/plugin.py
index af1441fc9fa7d701dfd4a12336277960ff708858..dc6ffac1ba5ad2f896977d812db7962db6178396 100644
--- a/pytest_multihost/plugin.py
+++ b/pytest_multihost/plugin.py
@@ -26,17 +26,22 @@ def pytest_addoption(parser):
 def pytest_load_initial_conftests(args, early_config, parser):
 ns = early_config.known_args_namespace
 if ns.multihost_config:
-with open(ns.multihost_config) as conffile:
-if yaml:
-confdict = yaml.safe_load(conffile)
-else:
-try:
-confdict = json.load(conffile)
-except Exception:
-traceback.print_exc()
-raise exit(
-'Could not load %s. If it is a YAML file, you need '
-'PyYAML installed.' % ns.multihost_config)
+try:
+with open(ns.multihost_config) as conffile:
+if yaml:
+confdict = yaml.safe_load(conffile)
+else:
+try:
+confdict = json.load(conffile)
+except Exception:
+traceback.print_exc()
+raise exit(
+'Could not load %s. If it is a YAML file, you need '
+'PyYAML installed.' % ns.multihost_config)
+except IOError as e:
+raise exit('Unable to find multihost configuration file (%s),\n'
+   'Please check path of configuration file and retry.'
+   % (ns.multihost_config))
 plugin = MultihostPlugin(confdict)
 pluginmanager = early_config.pluginmanager.register(
 plugin, 'MultihostPlugin')
-- 
2.4.3

-- 
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] Added kpasswd_server directive in client krb5.conf

2016-01-05 Thread Abhijeet Kasurde

Hi All,

On 01/05/2016 04:52 PM, Christian Heimes wrote:

On 2016-01-04 23:38, Nalin Dahyabhai wrote:

On Mon, Dec 21, 2015 at 12:17:08PM +0530, Abhijeet Kasurde wrote:

Hi All,

Please review patches attached.

The port number should probably be changed from 749 to 464.

Nalin is correct. kpasswd and admin server use different ports:

$ getent services kpasswd
kpasswd   464/tcp kpwd
$ getent services kerberos-adm
kerberos-adm  749/tcp

Except for the port number, the patch looks good to me.

Changed port number from 749 to 464. Thanks Nalin and Christian.

Please review patches attached.

Christian


Thanks,
Abhijeet Kasurde
From ace7705e73e0af67253d0484d7dad2f7f1fa4e77 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 21 Dec 2015 12:11:31 +0530
Subject: [PATCH] Added kpasswd_server directive in client krb5.conf

While configuring ipa client using ipa-client-install can configure
kpasswd_server explicitly using directive in client's krb5.conf

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipa-client/ipa-install/ipa-client-install | 4 
 1 file changed, 4 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 789ff591591673744ee3b922e5c0181233ad553c..14d1dc98a23fed8ffe147c0c03711e7d7467edef 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1103,6 +1103,10 @@ def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
 kropts.append({'name':'kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'master_kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'admin_server', 'type':'option', 'value':ipautil.format_netloc(server, 749)})
+kropts.append({'name': 'kpasswd_server',
+   'type': 'option',
+   'value': ipautil.format_netloc(server, 464)
+  })
 kropts.append({'name':'default_domain', 'type':'option', 'value':cli_domain})
 kropts.append({'name':'pkinit_anchors', 'type':'option', 'value':'FILE:%s' % CACERT})
 ropts = [{'name':cli_realm, 'type':'subsection', 'value':kropts}]
-- 
2.4.3

From bfb646e2a77151bd0fcfd61d50e23afb04266581 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 21 Dec 2015 12:03:10 +0530
Subject: [PATCH] Added kpasswd_server directive in client krb5.conf

While configuring ipa client using ipa-client-install can configure
kpasswd_server explicitly using directive in client's krb5.conf

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipa-client/ipa-install/ipa-client-install | 4 
 1 file changed, 4 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index af8d27bd0da9b847fef917d3bcc2ebd1837c5fb0..443a4429f45e6c3f572d4f21a795549c0257 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1106,6 +1106,10 @@ def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
 kropts.append({'name':'kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'master_kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'admin_server', 'type':'option', 'value':ipautil.format_netloc(server, 749)})
+kropts.append({'name': 'kpasswd_server',
+   'type': 'option',
+   'value': ipautil.format_netloc(server, 464)
+  })
 kropts.append({'name':'default_domain', 'type':'option', 'value':cli_domain})
 kropts.append({'name':'pkinit_anchors', 'type':'option', 'value':'FILE:%s' % CACERT})
 ropts = [{'name':cli_realm, 'type':'subsection', 'value':kropts}]
-- 
2.4.3

-- 
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

[Freeipa-devel] Fixed login error message box in LoginScreen page

2015-12-27 Thread Abhijeet Kasurde

Hi All,

Please review patches attached.

Thanks,
Abhijeet Kasurde
From c7f0621a561b4bdc558cafaa2e8ee182b571ebd8 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 28 Dec 2015 12:26:13 +0530
Subject: [PATCH] Fixed login error message box in LoginScreen page

Fix added for showing error message returned from server to client
browser. User is now notified with proper error messages returned by
server.

https://bugzilla.redhat.com/show_bug.cgi?id=1293870

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/ui/src/freeipa/widgets/LoginScreen.js | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index eb95b9161f05eeac1ec9aed286c9730dada85d59..2dbd883c942acb2f6b61f5c4883bc977233d7495 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -272,12 +272,11 @@ define(['dojo/_base/declare',
 }
 this.set('view', 'login');
 } else {
+otp_f.set_value('');
+new_f.set_value('');
+ver_f.set_value('');
 val_summary.add_error('login', result.message);
 }
-
-otp_f.set_value('');
-new_f.set_value('');
-ver_f.set_value('');
 },
 
 refresh: function() {
@@ -426,4 +425,4 @@ define(['dojo/_base/declare',
 ];
 
 return LoginScreen;
-});
\ No newline at end of file
+});
-- 
2.4.3

From 3a0230d1446cbc09e38903decd9696d017e14913 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 28 Dec 2015 12:33:11 +0530
Subject: [PATCH] Fixed login error message box in LoginScreen page

Fix added for showing error message returned from server to client
browser. User is now notified with proper error messages returned by
server.

https://bugzilla.redhat.com/show_bug.cgi?id=1293870

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/ui/src/freeipa/widgets/LoginScreen.js | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
index eb95b9161f05eeac1ec9aed286c9730dada85d59..2c778b50cfb10bfa8eef25c5456c6ce913e02695 100644
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
@@ -272,12 +272,12 @@ define(['dojo/_base/declare',
 }
 this.set('view', 'login');
 } else {
+otp_f.set_value('');
+new_f.set_value('');
+ver_f.set_value('');
 val_summary.add_error('login', result.message);
 }
 
-otp_f.set_value('');
-new_f.set_value('');
-ver_f.set_value('');
 },
 
 refresh: function() {
@@ -426,4 +426,4 @@ define(['dojo/_base/declare',
 ];
 
 return LoginScreen;
-});
\ No newline at end of file
+});
-- 
2.4.3

-- 
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

[Freeipa-devel] Added kpasswd_server directive in client krb5.conf

2015-12-20 Thread Abhijeet Kasurde

Hi All,

Please review patches attached.

Thanks,
Abhijeet Kasurde
From a03a2d9c5668dbfcdde6794af1725e546cd3ed41 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 21 Dec 2015 12:11:31 +0530
Subject: [PATCH] Added kpasswd_server directive in client krb5.conf

While configuring ipa client using ipa-client-install can configure
kpasswd_server explicitly using directive in client's krb5.conf

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipa-client/ipa-install/ipa-client-install | 4 
 1 file changed, 4 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 789ff591591673744ee3b922e5c0181233ad553c..147ea691c8e4dbf0103ae874a2fcb12f8104d0e4 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1103,6 +1103,10 @@ def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
 kropts.append({'name':'kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'master_kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'admin_server', 'type':'option', 'value':ipautil.format_netloc(server, 749)})
+kropts.append({'name': 'kpasswd_server',
+   'type': 'option',
+   'value': ipautil.format_netloc(server, 749)
+  })
 kropts.append({'name':'default_domain', 'type':'option', 'value':cli_domain})
 kropts.append({'name':'pkinit_anchors', 'type':'option', 'value':'FILE:%s' % CACERT})
 ropts = [{'name':cli_realm, 'type':'subsection', 'value':kropts}]
-- 
2.4.3

From 3b43be08da0981236764f2e23f3067fe47eafe9d Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Mon, 21 Dec 2015 12:03:10 +0530
Subject: [PATCH] Added kpasswd_server directive in client krb5.conf

While configuring ipa client using ipa-client-install can configure
kpasswd_server explicitly using directive in client's krb5.conf

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipa-client/ipa-install/ipa-client-install | 4 
 1 file changed, 4 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index e9a7d45c3f82a58f6297db7354eb784f6416db4b..e98d52891eb5fc4a993f8b21efc44f7293c8a2a9 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1106,6 +1106,10 @@ def configure_krb5_conf(cli_realm, cli_domain, cli_server, cli_kdc, dnsok,
 kropts.append({'name':'kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'master_kdc', 'type':'option', 'value':ipautil.format_netloc(server, 88)})
 kropts.append({'name':'admin_server', 'type':'option', 'value':ipautil.format_netloc(server, 749)})
+kropts.append({'name': 'kpasswd_server',
+   'type': 'option',
+   'value': ipautil.format_netloc(server, 749)
+  })
 kropts.append({'name':'default_domain', 'type':'option', 'value':cli_domain})
 kropts.append({'name':'pkinit_anchors', 'type':'option', 'value':'FILE:%s' % CACERT})
 ropts = [{'name':cli_realm, 'type':'subsection', 'value':kropts}]
-- 
2.4.3

-- 
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

[Freeipa-devel] [PATCH] Fixed typo in ipa stage-user documentation

2015-12-01 Thread Abhijeet Kasurde

Hi All,

Please find a small fix in 'ipa stage-user' documentation.

Thanks,
Abhijeet Kasurde
From ef7b8a94b390fbeefe650a4e48a3972910ac97ff Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Wed, 2 Dec 2015 11:58:14 +0530
Subject: [PATCH] Fixed small typo in stage-user documentation

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/po/fr.po   | 2 +-
 install/po/ipa.pot | 2 +-
 install/po/uk.po   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/install/po/fr.po b/install/po/fr.po
index e5f943d56e4107877c43a7148652cd0353186944..cefe28797ba0d89e7361980e3f851577738d8b63 100644
--- a/install/po/fr.po
+++ b/install/po/fr.po
@@ -12217,7 +12217,7 @@ msgid ""
 "User can authenticate with Active entries, at the condition they have\n"
 "credentials\n"
 "\n"
-"Delete user enties are Posix users directly under the container: "
+"Delete user entries are Posix users directly under the container: "
 "\"cn=deleted users,\n"
 "cn=accounts, cn=provisioning, SUFFIX\".\n"
 "User can not authenticate with those entries (even if the entries contain "
diff --git a/install/po/ipa.pot b/install/po/ipa.pot
index fc5a84db377a8f0654e5e6240af55d708b4739d3..336be52dac477fc7d91f82a40228773b5f081753 100644
--- a/install/po/ipa.pot
+++ b/install/po/ipa.pot
@@ -12255,7 +12255,7 @@ msgid ""
 "User can authenticate with Active entries, at the condition they have\n"
 "credentials\n"
 "\n"
-"Delete user enties are Posix users directly under the container: "
+"Delete user entries are Posix users directly under the container: "
 "\"cn=deleted users,\n"
 "cn=accounts, cn=provisioning, SUFFIX\".\n"
 "User can not authenticate with those entries (even if the entries contain "
diff --git a/install/po/uk.po b/install/po/uk.po
index 10f9d9e6423ffba0f29acc8652e578f5fdce363d..cb7f8705ccc0e51469c111eb7485eaa6ed580195 100644
--- a/install/po/uk.po
+++ b/install/po/uk.po
@@ -12380,7 +12380,7 @@ msgid ""
 "User can authenticate with Active entries, at the condition they have\n"
 "credentials\n"
 "\n"
-"Delete user enties are Posix users directly under the container: "
+"Delete user entries are Posix users directly under the container: "
 "\"cn=deleted users,\n"
 "cn=accounts, cn=provisioning, SUFFIX\".\n"
 "User can not authenticate with those entries (even if the entries contain "
-- 
2.4.3

From 2a1bd496236e47a40647f2c46554e3cf644ad5b0 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Wed, 2 Dec 2015 11:53:32 +0530
Subject: [PATCH] Fixed small typo in stage-user documentation

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 install/po/fr.po   | 2 +-
 install/po/ipa.pot | 2 +-
 install/po/uk.po   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/install/po/fr.po b/install/po/fr.po
index e5f943d56e4107877c43a7148652cd0353186944..cefe28797ba0d89e7361980e3f851577738d8b63 100644
--- a/install/po/fr.po
+++ b/install/po/fr.po
@@ -12217,7 +12217,7 @@ msgid ""
 "User can authenticate with Active entries, at the condition they have\n"
 "credentials\n"
 "\n"
-"Delete user enties are Posix users directly under the container: "
+"Delete user entries are Posix users directly under the container: "
 "\"cn=deleted users,\n"
 "cn=accounts, cn=provisioning, SUFFIX\".\n"
 "User can not authenticate with those entries (even if the entries contain "
diff --git a/install/po/ipa.pot b/install/po/ipa.pot
index fc5a84db377a8f0654e5e6240af55d708b4739d3..336be52dac477fc7d91f82a40228773b5f081753 100644
--- a/install/po/ipa.pot
+++ b/install/po/ipa.pot
@@ -12255,7 +12255,7 @@ msgid ""
 "User can authenticate with Active entries, at the condition they have\n"
 "credentials\n"
 "\n"
-"Delete user enties are Posix users directly under the container: "
+"Delete user entries are Posix users directly under the container: "
 "\"cn=deleted users,\n"
 "cn=accounts, cn=provisioning, SUFFIX\".\n"
 "User can not authenticate with those entries (even if the entries contain "
diff --git a/install/po/uk.po b/install/po/uk.po
index 10f9d9e6423ffba0f29acc8652e578f5fdce363d..cb7f8705ccc0e51469c111eb7485eaa6ed580195 100644
--- a/install/po/uk.po
+++ b/install/po/uk.po
@@ -12380,7 +12380,7 @@ msgid ""
 "User can authenticate with Active entries, at the condition they have\n"
 "credentials\n"
 "\n"
-"Delete user enties are Posix users directly under the container: "
+"Delete user entries are Posix users directly under the container: "
 "\"cn=deleted users,\n"
 "cn=accounts, cn=provisioning, SUFFIX\".\n"
 "User can not authenticate with those entries (even if the entries contain "
-- 
2.4.3

-- 
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] [pytest-multihost-devel][PATCH] Functions for handling various file and directory operations

2015-11-25 Thread Abhijeet Kasurde

Hi Petr,

On 11/25/2015 08:27 PM, Petr Viktorin wrote:

On 11/25/2015 10:08 AM, Abhijeet Kasurde wrote:

Hi All,

Please find the patch for pytest-multihost-plugin.

Fixes : https://fedorahosted.org/python-pytest-multihost/ticket/2

Thanks! These will be useful.

ACK, pushed as e7bf95b3ba4ca84b73abffda1abcf6187c5c8a67
I wrote some tests for the file operations as well:
5e76908430bbb56ca981b04a88f12359c73c7e1f


Thanks for adding testcases for these functions.

I plan to do a release (and update the Fedora package) after IPA starts
testing under Python 3. Let me know if an earlier release would help you.
Yes, indeed. It will be very helpful. Let me know if you need any help 
for my side.




Thanks,
Abhijeet Kasurde

--
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


[Freeipa-devel] [pytest-multihost-devel][PATCH] Functions for handling various file and directory operations

2015-11-25 Thread Abhijeet Kasurde

Hi All,

Please find the patch for pytest-multihost-plugin.

Fixes : https://fedorahosted.org/python-pytest-multihost/ticket/2

Thanks,
Abhijeet Kasurde
From 72dfedf298ed6e27cc10f7c63fa1202a0942c88e Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Wed, 25 Nov 2015 14:30:35 +0530
Subject: [PATCH] Added functions for handling various file operations

Functions are added for removing directory, removing file,
renaming file.

https://fedorahosted.org/python-pytest-multihost/ticket/2

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 pytest_multihost/transport.py | 46 ++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/pytest_multihost/transport.py b/pytest_multihost/transport.py
index 2b1ccbc32e8ed4b28e263d9bbe2df4bc2c8617de..f85099fd856e461ca68a342050fae61508c34d10 100644
--- a/pytest_multihost/transport.py
+++ b/pytest_multihost/transport.py
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013  Red Hat
+# Copyright (C) 2015  Red Hat
 # Copyright (C) 2014  pytest-multihost contributors
 # See COPYING for license
 #
@@ -98,6 +98,18 @@ class Transport(object):
 self._command_index += 1
 return '%s.cmd%s' % (self.host.logger_name, self._command_index)
 
+def rmdir(self, path):
+"""Remove directory"""
+raise NotImplementedError('Transport.rmdir')
+
+def rename_file(self, oldpath, newpath):
+"""Rename file"""
+raise NotImplementedError('Transport.rename_file')
+
+def remove_file(self, filepath):
+"""Removes files"""
+raise NotImplementedError('Transport.remove_file')
+
 
 class Command(object):
 """A Popen-style object representing a remote command
@@ -246,6 +258,18 @@ class ParamikoTransport(Transport):
 self.log.info('PUT %s', remotepath)
 self.sftp.put(localpath, remotepath)
 
+def rmdir(self, path):
+self.log.info('RMDIR %s', path)
+self.sftp.rmdir(path)
+
+def remove_file(self, filepath):
+self.log.info('REMOVE FILE %s', filepath)
+self.sftp.remove(filepath)
+
+def rename_file(self, oldpath, newpath):
+self.log.info('RENAME %s to %s', oldpath, newpath)
+self.sftp.rename(oldpath, newpath)
+
 
 class OpenSSHTransport(Transport):
 """Transport that uses the `ssh` binary"""
@@ -341,6 +365,26 @@ class OpenSSHTransport(Transport):
 else:
 raise IOError('File %r could not be read' % filename)
 
+def rmdir(self, path):
+self.log.info('RMDIR %s', path)
+cmd = self._run(['rmdir', path])
+cmd.wait()
+
+def remove_file(self, filepath):
+self.log.info('REMOVE FILE %s', filepath)
+cmd = self._run(['rm', filepath])
+cmd.wait()
+if cmd.returncode != 0:
+raise IOError('File %r could not be deleted' % filepath)
+
+def rename_file(self, oldpath, newpath):
+self.log.info('RENAME %s TO %s', oldpath, newpath)
+cmd = self._run(['mv', oldpath, newpath])
+cmd.wait()
+if cmd.returncode != 0:
+raise IOError('File %r could not be renamed to %r '
+  % (oldpath, newpath))
+
 
 class SSHCallWrapper(object):
 """Adapts a /usr/bin/ssh call to the paramiko.Channel interface
-- 
2.4.3

-- 
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] Normalize manager name in user-add

2015-11-05 Thread Abhijeet Kasurde



On 11/05/2015 03:25 PM, Martin Basti wrote:



On 05.11.2015 07:58, Abhijeet Kasurde wrote:

Hi All,

Please find the patch for https://fedorahosted.org/freeipa/ticket/5387

Thanks,
Abhijeet Kasurde



Hello,

I'm sorry I forgot to mark "patch posted for review", but the ticket 
is marked as assigned, that means the somebody (me in this case) is 
working on it.

I posted patch 332.

Due the ticket https://fedorahosted.org/freeipa/ticket/5344 I will 
change multiple parts of user plugin code, and the normalization of 
manager will be done in different way. So even my patch 332 is not 
valid anymore.

No issues. Thanks for your time.

-- 
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

[Freeipa-devel] [PATCH] Normalize manager name in user-add

2015-11-04 Thread Abhijeet Kasurde

Hi All,

Please find the patch for https://fedorahosted.org/freeipa/ticket/5387

Thanks,
Abhijeet Kasurde
From 4be9fef17e6b31ad2b3ebb496d4a60887ca97b5c Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Thu, 5 Nov 2015 12:22:59 +0530
Subject: [PATCH] Added fix to normalize manager name in user-add

This fix allows to normalize manager name to human readable name as
specified in user-add command instead of actual DN.

Fixes: https://fedorahosted.org/freeipa/ticket/5387

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipalib/plugins/baseuser.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ipalib/plugins/baseuser.py b/ipalib/plugins/baseuser.py
index b974e3fb18659e7eb6e75557e0d4db3ec1197dcd..a22923048002e1ac38cf007e871d7ee8ffc44da1 100644
--- a/ipalib/plugins/baseuser.py
+++ b/ipalib/plugins/baseuser.py
@@ -490,6 +490,7 @@ class baseuser_add(LDAPCreate):
 
 def post_common_callback(self, ldap, dn, entry_attrs, **options):
 assert isinstance(dn, DN)
+self.obj.convert_manager(entry_attrs, **options)
 self.obj.convert_usercertificate_post(entry_attrs, **options)
 
 class baseuser_del(LDAPDelete):
-- 
2.4.3

-- 
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] DNSZone command with user friendly message

2015-10-28 Thread Abhijeet Kasurde



On 10/27/2015 08:28 PM, Martin Basti wrote:



On 27.10.2015 14:46, Martin Basti wrote:



On 27.10.2015 13:00, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/4811

Thanks,
Abhijeet Kasurde


[Tue Oct 27 14:44:51.328615 2015] [wsgi:error] [pid 5556] ipa: ERROR: 
non-public: AttributeError: 'dnszone' object has no attribute 
'handle_obj_found'
[Tue Oct 27 14:44:51.328654 2015] [wsgi:error] [pid 5556] Traceback 
(most recent call last):
[Tue Oct 27 14:44:51.328659 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 350, 
in wsgi_execute
[Tue Oct 27 14:44:51.328664 2015] [wsgi:error] [pid 5556] result = 
self.Command[name](*args, **options)
[Tue Oct 27 14:44:51.328669 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 447, in 
__call__
[Tue Oct 27 14:44:51.328674 2015] [wsgi:error] [pid 5556] ret = 
self.run(*args, **options)
[Tue Oct 27 14:44:51.328678 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 764, in run
[Tue Oct 27 14:44:51.328683 2015] [wsgi:error] [pid 5556] return 
self.execute(*args, **options)
[Tue Oct 27 14:44:51.328687 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/plugins/dns.py", line 2935, 
in execute
[Tue Oct 27 14:44:51.328692 2015] [wsgi:error] [pid 5556] result = 
super(dnszone_enable, self).execute(*keys, **options)
[Tue Oct 27 14:44:51.328696 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/plugins/dns.py", line 2262, 
in execute
[Tue Oct 27 14:44:51.328701 2015] [wsgi:error] [pid 5556] 
self.obj.handle_obj_found(*keys)
[Tue Oct 27 14:44:51.328705 2015] [wsgi:error] [pid 5556] 
AttributeError: 'dnszone' object has no attribute 'handle_obj_found'





Thank you, ACK patch works as expected

However now 2 tests are failing because error message was changed, 
please fix tests too.


test_xmlrpc/test_dns_plugin.py <- 
test_xmlrpc/xmlrpc_test.py::test_forward_zones::test_command[0071: 
dnsforwardzone_disable: Try to disable non-existent forward zone] FAILED
test_xmlrpc/test_dns_plugin.py <- 
test_xmlrpc/xmlrpc_test.py::test_forward_zones::test_command[0075: 
dnsforwardzone_enable: Try to enable non-existent forward zone] FAILED


E   AssertionError: assert_deepequal: expected != got.
E
E expected = u'no such entry'
E got = u'non-existent.fwzone.test.: DNS forward zone not 
found'

E path = ()


Updated patch with testcase

Martin


From f0123341f029622336c7ce3afecfab7035c92fd0 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Tue, 27 Oct 2015 17:21:17 +0530
Subject: [PATCH] Added user friendly error message for dnszone enable and
 disable

Added try-except block in dns plugin in order to provide user
friendly message to end user.

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipalib/plugins/dns.py   | 12 ++--
 ipatests/test_xmlrpc/test_dns_plugin.py |  8 ++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index ef282c94609df0be0aa02ec14eb2b137e7ad9dbd..48d6f740ebea06e0ae9e8d68deafd607b5ae18d8 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -2231,7 +2231,11 @@ class DNSZoneBase_disable(LDAPQuery):
 ldap = self.obj.backend
 
 dn = self.obj.get_dn(*keys, **options)
-entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+try:
+entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+except errors.NotFound:
+self.obj.handle_not_found(*keys)
+
 if not _check_entry_objectclass(entry, self.obj.object_class):
 self.obj.handle_not_found(*keys)
 
@@ -2252,7 +2256,11 @@ class DNSZoneBase_enable(LDAPQuery):
 ldap = self.obj.backend
 
 dn = self.obj.get_dn(*keys, **options)
-entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+try:
+entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+except errors.NotFound:
+self.obj.handle_not_found(*keys)
+
 if not _check_entry_objectclass(entry, self.obj.object_class):
 self.obj.handle_not_found(*keys)
 
diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index f0b8edaa14bdc05e103d2fd332033b97b64169b1..e5d1374d0e9f71fbdc907153a2fec05d6cb6fa3b 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -4319,7 +4319,9 @@ class test_forward_zones(Declarative):
 dict(
 desc='Try to disable non-existent forward zone',
 command=('dnsforwardzone_disable', [nonexistent_fwzone], {}),
-ex

[Freeipa-devel] [PATCH] DNSZone command with user friendly message

2015-10-27 Thread Abhijeet Kasurde

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/4811

Thanks,
Abhijeet Kasurde
From a333e7ddb830e5ff10d2602b12669b767b870dbb Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Tue, 27 Oct 2015 17:21:17 +0530
Subject: [PATCH] Added user friendly error message for dnszone enable and
 disable

Added try-except block in dns plugin in order to provide user
friendly message to end user.

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipalib/plugins/dns.py | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index ef282c94609df0be0aa02ec14eb2b137e7ad9dbd..c90f3209b9f6226e89b2d2e832039187c8f21428 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -2231,7 +2231,11 @@ class DNSZoneBase_disable(LDAPQuery):
 ldap = self.obj.backend
 
 dn = self.obj.get_dn(*keys, **options)
-entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+try:
+entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+except errors.NotFound:
+self.obj.handle_not_found(*keys)
+
 if not _check_entry_objectclass(entry, self.obj.object_class):
 self.obj.handle_not_found(*keys)
 
@@ -2252,7 +2256,11 @@ class DNSZoneBase_enable(LDAPQuery):
 ldap = self.obj.backend
 
 dn = self.obj.get_dn(*keys, **options)
-entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+try:
+entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+except errors.NotFound:
+self.obj.handle_obj_found(*keys)
+
 if not _check_entry_objectclass(entry, self.obj.object_class):
 self.obj.handle_not_found(*keys)
 
-- 
2.4.3

-- 
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] DNSZone command with user friendly message

2015-10-27 Thread Abhijeet Kasurde



On 10/27/2015 07:16 PM, Martin Basti wrote:



On 27.10.2015 13:00, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/4811

Thanks,
Abhijeet Kasurde



Sorry, my bad.
Please find the new patch.
[Tue Oct 27 14:44:51.328615 2015] [wsgi:error] [pid 5556] ipa: ERROR: 
non-public: AttributeError: 'dnszone' object has no attribute 
'handle_obj_found'
[Tue Oct 27 14:44:51.328654 2015] [wsgi:error] [pid 5556] Traceback 
(most recent call last):
[Tue Oct 27 14:44:51.328659 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 350, 
in wsgi_execute
[Tue Oct 27 14:44:51.328664 2015] [wsgi:error] [pid 5556] result = 
self.Command[name](*args, **options)
[Tue Oct 27 14:44:51.328669 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 447, in 
__call__
[Tue Oct 27 14:44:51.328674 2015] [wsgi:error] [pid 5556] ret = 
self.run(*args, **options)
[Tue Oct 27 14:44:51.328678 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 764, in run
[Tue Oct 27 14:44:51.328683 2015] [wsgi:error] [pid 5556] return 
self.execute(*args, **options)
[Tue Oct 27 14:44:51.328687 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/plugins/dns.py", line 2935, 
in execute
[Tue Oct 27 14:44:51.328692 2015] [wsgi:error] [pid 5556] result = 
super(dnszone_enable, self).execute(*keys, **options)
[Tue Oct 27 14:44:51.328696 2015] [wsgi:error] [pid 5556]   File 
"/usr/lib/python2.7/site-packages/ipalib/plugins/dns.py", line 2262, 
in execute
[Tue Oct 27 14:44:51.328701 2015] [wsgi:error] [pid 5556] 
self.obj.handle_obj_found(*keys)
[Tue Oct 27 14:44:51.328705 2015] [wsgi:error] [pid 5556] 
AttributeError: 'dnszone' object has no attribute 'handle_obj_found'





From 44dad1e1dc4113970068a766ccca9c66edaa Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Tue, 27 Oct 2015 17:21:17 +0530
Subject: [PATCH] Added user friendly error message for dnszone enable and
 disable

Added try-except block in dns plugin in order to provide user
friendly message to end user.

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

Signed-off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipalib/plugins/dns.py | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index ef282c94609df0be0aa02ec14eb2b137e7ad9dbd..48d6f740ebea06e0ae9e8d68deafd607b5ae18d8 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -2231,7 +2231,11 @@ class DNSZoneBase_disable(LDAPQuery):
 ldap = self.obj.backend
 
 dn = self.obj.get_dn(*keys, **options)
-entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+try:
+entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+except errors.NotFound:
+self.obj.handle_not_found(*keys)
+
 if not _check_entry_objectclass(entry, self.obj.object_class):
 self.obj.handle_not_found(*keys)
 
@@ -2252,7 +2256,11 @@ class DNSZoneBase_enable(LDAPQuery):
 ldap = self.obj.backend
 
 dn = self.obj.get_dn(*keys, **options)
-entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+try:
+entry = ldap.get_entry(dn, ['idnszoneactive', 'objectclass'])
+except errors.NotFound:
+self.obj.handle_not_found(*keys)
+
 if not _check_entry_objectclass(entry, self.obj.object_class):
 self.obj.handle_not_found(*keys)
 
-- 
2.4.3

-- 
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] Updated no of legacy permission in ipatests

2015-09-15 Thread Abhijeet Kasurde

Ping

On 09/10/2015 11:52 AM, Abhijeet Kasurde wrote:

Hi List,

Please find the following patch with review comments.

Thanks,
Abhijeet Kasurde

On 09/03/2015 06:10 PM, Tomas Babej wrote:


On 09/03/2015 08:16 AM, Abhijeet Kasurde wrote:

Ping

On 08/27/2015 10:37 AM, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/5264

Thanks,
Abhijeet Kasurde
ACK, the patch needs a minor rebase on master due to python3 
refactoring.






-- 
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] Updated no of legacy permission in ipatests

2015-09-10 Thread Abhijeet Kasurde

Hi List,

Please find the following patch with review comments.

Thanks,
Abhijeet Kasurde

On 09/03/2015 06:10 PM, Tomas Babej wrote:


On 09/03/2015 08:16 AM, Abhijeet Kasurde wrote:

Ping

On 08/27/2015 10:37 AM, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/5264

Thanks,
Abhijeet Kasurde

ACK, the patch needs a minor rebase on master due to python3 refactoring.


From 41536f492fb7302d4c2e68b195cdffd94fc97cc7 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasu...@redhat.com>
Date: Thu, 10 Sep 2015 11:46:01 +0530
Subject: [PATCH] Updated number of legacy permission in ipatests

Since IPA 4.2 has an additional permission
"Request Certificate ignoring CA ACLs", the number of legacy
permission in testcase is updated from 8 to 9.

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

Signed off-by: Abhijeet Kasurde <akasu...@redhat.com>
---
 ipatests/test_xmlrpc/test_permission_plugin.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py
index e791b598149fb9b5291687b101428107415dfc85..88401190a01d8d8420f135ccd8e204172d2ecca2 100644
--- a/ipatests/test_xmlrpc/test_permission_plugin.py
+++ b/ipatests/test_xmlrpc/test_permission_plugin.py
@@ -2849,7 +2849,7 @@ def check_legacy_results(results):
 legacy_permissions = [p for p in results
   if not p.get('ipapermissiontype')]
 print(legacy_permissions)
-assert len(legacy_permissions) == 8, len(legacy_permissions)
+assert len(legacy_permissions) == 9, len(legacy_permissions)
 return True
 
 class test_permission_legacy(Declarative):
-- 
2.4.3

-- 
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] Updated no of legacy permission in ipatests

2015-09-03 Thread Abhijeet Kasurde

Ping

On 08/27/2015 10:37 AM, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/5264

Thanks,
Abhijeet Kasurde


--
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


[Freeipa-devel] [PATCH] Updated no of legacy permission in ipatests

2015-08-26 Thread Abhijeet Kasurde

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/5264

Thanks,
Abhijeet Kasurde
From 4492ddd0e07c5c82e8fbe2d7ae88e5fb0bce5be0 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde akasu...@redhat.com
Date: Thu, 27 Aug 2015 10:31:35 +0530
Subject: [PATCH] Updated number of legacy permission in ipatests

Since IPA 4.2 has an additional permission
Request Certificate ignoring CA ACLs, the number of legacy
permission in testcase is updated from 8 to 9.

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

Signed-off-by: Abhijeet Kasurde akasu...@redhat.com
---
 ipatests/test_xmlrpc/test_permission_plugin.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py
index c899c428edfcd19c2e7f538cdc38b693e11c8715..fd69ff25dcded412c78c38ccffd0d39413ea6943 100644
--- a/ipatests/test_xmlrpc/test_permission_plugin.py
+++ b/ipatests/test_xmlrpc/test_permission_plugin.py
@@ -2849,7 +2849,7 @@ def check_legacy_results(results):
 legacy_permissions = [p for p in results
   if not p.get('ipapermissiontype')]
 print legacy_permissions
-assert len(legacy_permissions) == 8, len(legacy_permissions)
+assert len(legacy_permissions) == 9, len(legacy_permissions)
 return True
 
 class test_permission_legacy(Declarative):
-- 
2.4.3

-- 
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] Added try/except for error handling ipautil

2015-08-19 Thread Abhijeet Kasurde

Hi All,


Please find the latest patch with review comments included.

Thanks Martin for your help and review comments.

Thanks,
Abhijeet Kasurde

On 08/19/2015 05:08 PM, Martin Basti wrote:



On 08/17/2015 02:08 PM, Abhijeet Kasurde wrote:

Hi All,

I have included all review comments. Please let me know your views.

On 08/17/2015 04:09 PM, Martin Basti wrote:



On 08/17/2015 11:11 AM, Abhijeet Kasurde wrote:

Hi All,

Please find the update patch with review comments,


On 08/14/2015 05:19 PM, Martin Basti wrote:



On 08/14/2015 06:57 AM, Abhijeet Kasurde wrote:


On 08/13/2015 07:08 PM, Martin Basti wrote:



On 08/10/2015 01:47 PM, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - 
https://fedorahosted.org/freeipa/ticket/3406


Thanks,
Abhijeet Kasurde




Hello,

thank you for the patch

1)
-except ValueError:
+except EOFError, ValueError:

Please use
except (EOFError, ValueError):
https://docs.python.org/2/tutorial/errors.html#handling-exceptions

OK, I will include this.

2)
I'm not sure if this code will work (I did not test it)

I expect when stdin is closed, this will result into infinite 
loop, because raw_input will always return EOFError.


while True:
try:
ret = raw_input(%s:  % prompt)
if allow_empty or ret.strip():
return ret
except EOFError:
pass

Could you please elaborate more on, so that I can include fix in 
this section of code?
If you receive EOF you cannot continue in while cycle because, it 
will return EOF every iteration forever.


If EOF is received the while cycle must end, and appropriate 
action must be take.
It depends on situation, if default value is present then default 
value should be used, or in case if empty value is allowed, empty 
string should be returned.


In case there is no default value and empty value is not allowed, 
then an exception should be raised.


Martin^2



NACK

There is still infinity loop.
1)
+except EOFError:
+if allow_empty:
+return ''

This will continue in while cycle if allow_empty=False, you need to raise 
exception there.

2)
Why so complicated? just return default looks enough to me.
+except EOFError:
+if choice.lower()[0] == y:
+return True
+elif choice.lower()[0] == n:
+return False
3)
Remove this change please
-
  def get_gsserror(e):






NACK

1)
Your commit message does not reflect the changes you made in code. The 
patch just solves the EOFError not Value error or various errors


2)
You removed if statement which should be there. I expected something 
like this in first case.

  while True:
-ret = raw_input(%s:  % prompt)
-if allow_empty or ret.strip():
-return ret
+try:
+ret = raw_input(%s:  % prompt)
+if allow_empty or ret.strip():
+return ret
+except EOFError:
+if allow_empty:
+   return ''
+raise RuntimeError(Failed to get user input)
Thanks
Martin


From 1fd37e950afaa05b7e582e82bcd7dbe992f5f19d Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde akasu...@redhat.com
Date: Wed, 19 Aug 2015 17:13:43 +0530
Subject: [PATCH] Added try/except block for user_input in ipautil

Added error handling for function user_input in order to
handle EOFError in ipautil.py

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

Signed-off-by: Abhijeet Kasurde akasu...@redhat.com
---
 ipapython/ipautil.py | 46 +-
 1 file changed, 29 insertions(+), 17 deletions(-)

diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 88e89706b8e2aa6dea80809510d88bceaa836e85..b05a1159ab2a89fda917dd6b48afba706204579f 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -746,30 +746,40 @@ def ipa_generate_password(characters=None,pwd_len=None):
 def user_input(prompt, default = None, allow_empty = True):
 if default == None:
 while True:
-ret = raw_input(%s:  % prompt)
-if allow_empty or ret.strip():
-return ret
+try:
+ret = raw_input(%s:  % prompt)
+if allow_empty or ret.strip():
+return ret
+except EOFError:
+if allow_empty:
+return ''
+raise RuntimeError(Failed to get user input)
 
 if isinstance(default, basestring):
 while True:
-ret = raw_input(%s [%s]:  % (prompt, default))
-if not ret and (allow_empty or default):
+try:
+ret = raw_input(%s [%s]:  % (prompt, default))
+if not ret and (allow_empty or default):
+return default
+elif ret.strip():
+return ret

Re: [Freeipa-devel] [PATCH] Added try/except for error handling ipautil

2015-08-17 Thread Abhijeet Kasurde

Hi All,

I have included all review comments. Please let me know your views.

On 08/17/2015 04:09 PM, Martin Basti wrote:



On 08/17/2015 11:11 AM, Abhijeet Kasurde wrote:

Hi All,

Please find the update patch with review comments,


On 08/14/2015 05:19 PM, Martin Basti wrote:



On 08/14/2015 06:57 AM, Abhijeet Kasurde wrote:


On 08/13/2015 07:08 PM, Martin Basti wrote:



On 08/10/2015 01:47 PM, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/3406

Thanks,
Abhijeet Kasurde




Hello,

thank you for the patch

1)
-except ValueError:
+except EOFError, ValueError:

Please use
except (EOFError, ValueError):
https://docs.python.org/2/tutorial/errors.html#handling-exceptions

OK, I will include this.

2)
I'm not sure if this code will work (I did not test it)

I expect when stdin is closed, this will result into infinite 
loop, because raw_input will always return EOFError.


while True:
try:
ret = raw_input(%s:  % prompt)
if allow_empty or ret.strip():
return ret
except EOFError:
pass

Could you please elaborate more on, so that I can include fix in 
this section of code?
If you receive EOF you cannot continue in while cycle because, it 
will return EOF every iteration forever.


If EOF is received the while cycle must end, and appropriate action 
must be take.
It depends on situation, if default value is present then default 
value should be used, or in case if empty value is allowed, empty 
string should be returned.


In case there is no default value and empty value is not allowed, 
then an exception should be raised.


Martin^2



NACK

There is still infinity loop.
1)
+except EOFError:
+if allow_empty:
+return ''

This will continue in while cycle if allow_empty=False, you need to raise 
exception there.

2)
Why so complicated? just return default looks enough to me.
+except EOFError:
+if choice.lower()[0] == y:
+return True
+elif choice.lower()[0] == n:
+return False
3)
Remove this change please
-
  def get_gsserror(e):



From 380d6a0c9ac075a97da492c42169f6cf1223c1c1 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde akasu...@redhat.com
Date: Mon, 17 Aug 2015 17:31:25 +0530
Subject: [PATCH] Added try/except block for ipautil

Added error handling for user input in order to handle various errors
like ValueError and EOFError in ipautil.

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

Signed-off-by: Abhijeet Kasurde akasu...@redhat.com
---
 ipapython/ipautil.py | 44 +++-
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 88e89706b8e2aa6dea80809510d88bceaa836e85..c11092cb7be4e95c5ce656b87ca1e16662ad32f0 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -746,30 +746,38 @@ def ipa_generate_password(characters=None,pwd_len=None):
 def user_input(prompt, default = None, allow_empty = True):
 if default == None:
 while True:
-ret = raw_input(%s:  % prompt)
-if allow_empty or ret.strip():
-return ret
+try:
+ret = raw_input(%s:  % prompt)
+if allow_empty or ret.strip():
+return ret
+except EOFError:
+raise RuntimeError(Failed to get user input)
 
 if isinstance(default, basestring):
 while True:
-ret = raw_input(%s [%s]:  % (prompt, default))
-if not ret and (allow_empty or default):
+try:
+ret = raw_input(%s [%s]:  % (prompt, default))
+if not ret and (allow_empty or default):
+return default
+elif ret.strip():
+return ret
+except EOFError:
 return default
-elif ret.strip():
-return ret
+
 if isinstance(default, bool):
-if default:
-choice = yes
-else:
-choice = no
+choice = yes if default else no
 while True:
-ret = raw_input(%s [%s]:  % (prompt, choice))
-if not ret:
+try:
+ret = raw_input(%s [%s]:  % (prompt, choice))
+if not ret:
+return default
+elif ret.lower()[0] == y:
+return True
+elif ret.lower()[0] == n:
+return False
+except EOFError:
 return default
-elif ret.lower()[0] == y:
-return True
-elif ret.lower()[0] == n:
-return False
+
 if isinstance(default, int):
 while True:
 try:
@@ -779,6 +787,8 @@ def user_input(prompt, default

Re: [Freeipa-devel] [PATCH] Added try/except for error handling ipautil

2015-08-17 Thread Abhijeet Kasurde

Hi All,

Please find the update patch with review comments,


On 08/14/2015 05:19 PM, Martin Basti wrote:



On 08/14/2015 06:57 AM, Abhijeet Kasurde wrote:


On 08/13/2015 07:08 PM, Martin Basti wrote:



On 08/10/2015 01:47 PM, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/3406

Thanks,
Abhijeet Kasurde




Hello,

thank you for the patch

1)
-except ValueError:
+except EOFError, ValueError:

Please use
except (EOFError, ValueError):
https://docs.python.org/2/tutorial/errors.html#handling-exceptions

OK, I will include this.

2)
I'm not sure if this code will work (I did not test it)

I expect when stdin is closed, this will result into infinite loop, 
because raw_input will always return EOFError.


while True:
try:
ret = raw_input(%s:  % prompt)
if allow_empty or ret.strip():
return ret
except EOFError:
pass

Could you please elaborate more on, so that I can include fix in this 
section of code?
If you receive EOF you cannot continue in while cycle because, it will 
return EOF every iteration forever.


If EOF is received the while cycle must end, and appropriate action 
must be take.
It depends on situation, if default value is present then default 
value should be used, or in case if empty value is allowed, empty 
string should be returned.


In case there is no default value and empty value is not allowed, then 
an exception should be raised.


Martin^2


From 75dd07dcb39268232f4a49118137db6e9297d936 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde akasu...@redhat.com
Date: Mon, 17 Aug 2015 14:36:39 +0530
Subject: [PATCH] Added try/except block for ipautil

Added error handling for user input in order to handle various errors
like ValueError and EOFError in ipautil.

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

Signed-off-by: Abhijeet Kasurde akasu...@redhat.com
---
 ipapython/ipautil.py | 51 ---
 1 file changed, 32 insertions(+), 19 deletions(-)

diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 88e89706b8e2aa6dea80809510d88bceaa836e85..3e3af9e95efec95eef30fcfea26dad7779b649de 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -746,30 +746,42 @@ def ipa_generate_password(characters=None,pwd_len=None):
 def user_input(prompt, default = None, allow_empty = True):
 if default == None:
 while True:
-ret = raw_input(%s:  % prompt)
-if allow_empty or ret.strip():
-return ret
+try:
+ret = raw_input(%s:  % prompt)
+if allow_empty or ret.strip():
+return ret
+except EOFError:
+if allow_empty:
+return ''
 
 if isinstance(default, basestring):
 while True:
-ret = raw_input(%s [%s]:  % (prompt, default))
-if not ret and (allow_empty or default):
+try:
+ret = raw_input(%s [%s]:  % (prompt, default))
+if not ret and (allow_empty or default):
+return default
+elif ret.strip():
+return ret
+except EOFError:
 return default
-elif ret.strip():
-return ret
+
 if isinstance(default, bool):
-if default:
-choice = yes
-else:
-choice = no
+choice = yes if default else no
 while True:
-ret = raw_input(%s [%s]:  % (prompt, choice))
-if not ret:
-return default
-elif ret.lower()[0] == y:
-return True
-elif ret.lower()[0] == n:
-return False
+try:
+ret = raw_input(%s [%s]:  % (prompt, choice))
+if not ret:
+return default
+elif ret.lower()[0] == y:
+return True
+elif ret.lower()[0] == n:
+return False
+except EOFError:
+if choice.lower()[0] == y:
+return True
+elif choice.lower()[0] == n:
+return False
+
 if isinstance(default, int):
 while True:
 try:
@@ -779,10 +791,11 @@ def user_input(prompt, default = None, allow_empty = True):
 ret = int(ret)
 except ValueError:
 pass
+except EOFError:
+return default
 else:
 return ret
 
-
 def get_gsserror(e):
 
 A GSSError exception looks differently in python 2.4 than it does
-- 
2.4.3

-- 
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] Added try/except for error handling ipautil

2015-08-13 Thread Abhijeet Kasurde


On 08/13/2015 07:08 PM, Martin Basti wrote:



On 08/10/2015 01:47 PM, Abhijeet Kasurde wrote:

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/3406

Thanks,
Abhijeet Kasurde




Hello,

thank you for the patch

1)
-except ValueError:
+except EOFError, ValueError:

Please use
except (EOFError, ValueError):
https://docs.python.org/2/tutorial/errors.html#handling-exceptions

OK, I will include this.

2)
I'm not sure if this code will work (I did not test it)

I expect when stdin is closed, this will result into infinite loop, 
because raw_input will always return EOFError.


while True:
try:
ret = raw_input(%s:  % prompt)
if allow_empty or ret.strip():
return ret
except EOFError:
pass

Could you please elaborate more on, so that I can include fix in this 
section of code?
-- 
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

[Freeipa-devel] [PATCH] Added try/except for error handling ipautil

2015-08-10 Thread Abhijeet Kasurde

Hi All,

This patch fixes bug - https://fedorahosted.org/freeipa/ticket/3406

Thanks,
Abhijeet Kasurde
From d1ede043e6d5d0342433e4eb769b0d48b0e4914c Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde akasu...@redhat.com
Date: Mon, 10 Aug 2015 16:56:29 +0530
Subject: [PATCH] Added try/except block for ipautil

Added error handling for user input in order to handle various errors
like ValueError and EOFError in ipautil.

https://fedorahosted.org/freeipa/ticket/3406
---
 ipapython/ipautil.py | 48 
 1 file changed, 28 insertions(+), 20 deletions(-)

diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 88e89706b8e2aa6dea80809510d88bceaa836e85..bc6530bdc940239ce9e4f3af6021b078460c5120 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -746,30 +746,38 @@ def ipa_generate_password(characters=None,pwd_len=None):
 def user_input(prompt, default = None, allow_empty = True):
 if default == None:
 while True:
-ret = raw_input(%s:  % prompt)
-if allow_empty or ret.strip():
-return ret
+try:
+ret = raw_input(%s:  % prompt)
+if allow_empty or ret.strip():
+return ret
+except EOFError:
+pass
 
 if isinstance(default, basestring):
 while True:
-ret = raw_input(%s [%s]:  % (prompt, default))
-if not ret and (allow_empty or default):
-return default
-elif ret.strip():
-return ret
+try:
+ret = raw_input(%s [%s]:  % (prompt, default))
+if not ret and (allow_empty or default):
+return default
+elif ret.strip():
+return ret
+except EOFError:
+pass
+
 if isinstance(default, bool):
-if default:
-choice = yes
-else:
-choice = no
+choice = yes if default else no
 while True:
-ret = raw_input(%s [%s]:  % (prompt, choice))
-if not ret:
-return default
-elif ret.lower()[0] == y:
-return True
-elif ret.lower()[0] == n:
-return False
+try:
+ret = raw_input(%s [%s]:  % (prompt, choice))
+if not ret:
+return default
+elif ret.lower()[0] == y:
+return True
+elif ret.lower()[0] == n:
+return False
+except EOFError:
+pass
+
 if isinstance(default, int):
 while True:
 try:
@@ -777,7 +785,7 @@ def user_input(prompt, default = None, allow_empty = True):
 if not ret:
 return default
 ret = int(ret)
-except ValueError:
+except EOFError, ValueError:
 pass
 else:
 return ret
-- 
2.4.3

-- 
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