mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-server-install: fix zonemgr argument validator
Fix `ERROR 'str' object has no attribute 'decode'` when --zonemgr is
passed to ipa-server-install.
Solution copied from commit 75d26e1f01,
function `ipaserver.install.bindinstance.zonemgr_callback` duplicates
the behavior of the method affected by this patch.
Issue: https://pagure.io/freeipa/issue/7612
Signed-off-by: Armando Neto <abiagion@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
committed by
Christian Heimes
parent
9c86d35a3f
commit
e8d33ccfd1
@@ -476,7 +476,11 @@ class DNSInstallInterface(hostname.HostNameInstallInterface):
|
|||||||
encoding = getattr(sys.stdin, 'encoding', None)
|
encoding = getattr(sys.stdin, 'encoding', None)
|
||||||
if encoding is None:
|
if encoding is None:
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
|
|
||||||
|
# value is string in py2 and py3
|
||||||
|
if not isinstance(value, unicode):
|
||||||
value = value.decode(encoding)
|
value = value.decode(encoding)
|
||||||
|
|
||||||
bindinstance.validate_zonemgr_str(value)
|
bindinstance.validate_zonemgr_str(value)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
# FIXME we can do this in better way
|
# FIXME we can do this in better way
|
||||||
|
|||||||
@@ -410,7 +410,11 @@ class TestInstallMasterDNS(IntegrationTest):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def test_install_master(self):
|
def test_install_master(self):
|
||||||
tasks.install_master(self.master, setup_dns=True)
|
tasks.install_master(
|
||||||
|
self.master,
|
||||||
|
setup_dns=True,
|
||||||
|
extra_args=['--zonemgr', 'me@example.org'],
|
||||||
|
)
|
||||||
|
|
||||||
def test_install_kra(self):
|
def test_install_kra(self):
|
||||||
tasks.install_kra(self.master, first_instance=True)
|
tasks.install_kra(self.master, first_instance=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user