Re: [Freeipa-devel] [PATCH] 0083 Fix regression on ipa-4-3 branch

2016-06-30 Thread Martin Basti



On 30.06.2016 06:37, Fraser Tweedale wrote:

The attached patch fixes a regression on the ipa-4-3 branch, caused
by commit 3d71c43504ea7837ea14bb9dd4a469c07337293f.

Thanks,
Fraser



ACK, thanks

Pushed to ipa-4-3: 8ce40940300e0e37191251a8a26bb8a4b5fcd604

-- 
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] 0083 Fix regression on ipa-4-3 branch

2016-06-29 Thread Fraser Tweedale
The attached patch fixes a regression on the ipa-4-3 branch, caused
by commit 3d71c43504ea7837ea14bb9dd4a469c07337293f.

Thanks,
Fraser
From 4d4c62a2c26affb82a7f2e40f36ad0de66beabf9 Mon Sep 17 00:00:00 2001
From: Fraser Tweedale 
Date: Thu, 30 Jun 2016 14:30:30 +1000
Subject: [PATCH] Move normalize_hostname to where it is expected

Commit 3d71c43504ea7837ea14bb9dd4a469c07337293f broke
ipa-client-install by importing normalize_hostname from the wrong
module.  Move the function.

https://fedorahosted.org/freeipa/ticket/5976
---
 ipalib/plugins/host.py | 10 +-
 ipalib/util.py |  8 
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 
3fe9c5f9cace71210125371b0aa891490a3dca99..0bb5a535bddfbd3032ab91e410ec6d4fa33f889f
 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -44,7 +44,7 @@ from ipalib import x509
 from ipalib import output
 from ipalib.request import context
 from ipalib.util import (normalize_sshpubkey, validate_sshpubkey_no_options,
-convert_sshpubkey_post, validate_hostname)
+convert_sshpubkey_post, validate_hostname, normalize_hostname)
 from ipapython.ipautil import ipa_generate_password, CheckedIPAddress
 from ipapython.dnsutil import DNSName
 from ipapython.ssh import SSHPublicKey
@@ -267,14 +267,6 @@ def validate_ipaddr(ugettext, ipaddr):
 return None
 
 
-def normalize_hostname(hostname):
-"""Use common fqdn form without the trailing dot"""
-if hostname.endswith(u'.'):
-hostname = hostname[:-1]
-hostname = hostname.lower()
-return hostname
-
-
 def _hostname_validator(ugettext, value):
 try:
 validate_hostname(value)
diff --git a/ipalib/util.py b/ipalib/util.py
index 
7a991490f76694261deda995ea138f35cf73a1f6..6caf3962d354292834a6ff7bdec424f1df1975e7
 100644
--- a/ipalib/util.py
+++ b/ipalib/util.py
@@ -844,3 +844,11 @@ def detect_dns_zone_realm_type(api, domain):
 def has_managed_topology(api):
 domainlevel = api.Command['domainlevel_get']().get('result', 
DOMAIN_LEVEL_0)
 return domainlevel > DOMAIN_LEVEL_0
+
+
+def normalize_hostname(hostname):
+"""Use common fqdn form without the trailing dot"""
+if hostname.endswith(u'.'):
+hostname = hostname[:-1]
+hostname = hostname.lower()
+return hostname
-- 
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