----- Original Message -----
> From: "Tomas Babej" <tba...@redhat.com>
> To: "Veronika Kabatova" <vkaba...@redhat.com>, freeipa-devel@redhat.com
> Sent: Friday, July 10, 2015 2:56:58 PM
> Subject: Re: [Freeipa-devel] [PATCH] 0001 Enhance the DNSNotARecordError 
> message
> 
> 
> 
> On 07/09/2015 01:49 PM, Veronika Kabatova wrote:
> > The attached patch solves the
> > <https://fedorahosted.org/freeipa/ticket/3959> ticket.
> > 
> > Veronika Kabatova
> > 
> > 
> > 
> 
> Hello,
> 
> thanks for the patch.
> 
> Actually, the doctest does not pass:
> 
> $ ipa-run-tests /usr/lib/python2.7/site-packages/ipalib/errors.py
> --doctest-modules
> =============================================================================================================
> test session starts
> =============================================================================================================
> platform linux2 -- Python 2.7.10 -- py-1.4.28 -- pytest-2.6.4
> plugins: multihost, sourceorder
> collected 85 items
> 
> ../ipalib/errors.py
> ...................F..............F..................................................
> 
> ==================================================================================================================
> FAILURES
> ===================================================================================================================
> _________________________________________________________________________________________________
> [doctest] ipalib.errors.DNSNotARecordError
> __________________________________________________________________________________________________
> 1137     """
> 1138     **4019** Raised when a hostname is not a DNS A/AAAA record
> 1139
> 1140     For example:
> 1141
> 1142     >>> raise DNSNotARecordError()
> Differences (unified diff with -expected +actual):
>     @@ -1,4 +1,6 @@
>      Traceback (most recent call last):
>     -  ...
>     -DNSNotARecordError: Host does not have corresponding DNS A/AAAA record,
>     -use --force to continue anyway
>     +  File "/usr/lib64/python2.7/doctest.py", line 1315, in __run
>     +    compileflags, 1) in test.globs
>     +  File "<doctest ipalib.errors.DNSNotARecordError[0]>", line 1, in
> <module>
>     +    raise DNSNotARecordError()
>     +DNSNotARecordError: Host does not have corresponding DNS A/AAAA
> record, use --force to continue anyway
> 
> /usr/lib/python2.7/site-packages/ipalib/errors.py:1142: DocTestFailure
> 
> The reason for the mismatch here is that you wrapped the line - in this
> case, we need to violate the PEP8, and allow the length of the line
> exceed 80 characters.


Good to know, thanks for clarifying. Attached modified version which doesn't
break tests, even if PEP8 checker is not happy with it.


> HTH,
> 
> Tomas
> 


Thanks,

Veronika Kabatova
From 2a05588cd8c063838a1bca8fa996fbc141bdaa65 Mon Sep 17 00:00:00 2001
From: Veronika Kabatova <vkaba...@redhat.com>
Date: Fri, 10 Jul 2015 19:33:58 +0200
Subject: [PATCH] Enhance the DNSNotARecordError message

Enhance the DNSNotARecordError message as proposed in ticket #3959. User
is now suggested to use --force option.

https://fedorahosted.org/freeipa/ticket/3959
---
 ipalib/errors.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipalib/errors.py b/ipalib/errors.py
index 7e34a879f1d9fad1ed0cbde263cda5cf6d84b7f9..69476b7706c704ad28b1808b7b80863b71dd775e 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -1142,12 +1142,12 @@ class DNSNotARecordError(ExecutionError):
     >>> raise DNSNotARecordError()
     Traceback (most recent call last):
       ...
-    DNSNotARecordError: Host does not have corresponding DNS A/AAAA record
+    DNSNotARecordError: Host does not have corresponding DNS A/AAAA record, use --force to continue anyway
 
     """
 
     errno = 4019
-    format = _('Host does not have corresponding DNS A/AAAA record')
+    format = _('Host does not have corresponding DNS A/AAAA record, use --force to continue anyway')
 
 class ManagedGroupError(ExecutionError):
     """
-- 
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

Reply via email to