abiagion / freeipa

Forked from freeipa 5 years ago
Clone

1e228f2 dns plugin: Fix zone normalization under Python 3

1 file Authored by pviktori 8 years ago, Committed by mbasti 8 years ago,
    dns plugin: Fix zone normalization under Python 3
    
    In Python 3, str.encode('ascii') converts to bytes, and str()
    (nicknamed unicode() in IPA) returns the string representation
    of an object, which is b'...' for bytes.
    
    So, unicode('...'.encode('ascii')) results in "b'...'".
    
    Change the code to only call encode() for the error.
    
    Part of the work for https://fedorahosted.org/freeipa/ticket/4985
    
    Reviewed-By: Martin Basti <mbasti@redhat.com>
    
        
file modified
+3 -1