[Freeipa-devel] [PATCH] 0024 Force use of kerberos realm to be a string in config.py

Alexander Bokovoy abokovoy at redhat.com
Tue Oct 11 09:13:14 UTC 2011


Hi,

there seems to be something new with python-2.7.2 on Fedora 16 and 
'make lint' complains about 
  dom_name = config.default_realm.lower()
as config.default_realm is of type _Chainmap during static analysis. 

We get config.default_realm out of krbV.default_context().default_realm.

The code change works fine with Fedora 15 as well (tested).
-- 
/ Alexander Bokovoy
-------------- next part --------------
>From c25b21972fb3a93b7c2ff1ab15715ae0bd3369b5 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy at redhat.com>
Date: Tue, 11 Oct 2011 12:07:23 +0300
Subject: [PATCH 2/2] Force kerberos realm to be a string

Fixes issue with Python linter on Fedora 16 where it assumes for C modules-provided
objects that they are of type _Chainmap during static analysis.
---
 ipapython/config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ipapython/config.py b/ipapython/config.py
index 051e39f92c8c0a8289c0bfdf8a53ad761c0457f6..d4c724dc9ac754cb221fe60d7c13bd0c716dd296 100644
--- a/ipapython/config.py
+++ b/ipapython/config.py
@@ -178,7 +178,7 @@ def __discover_config(discover_server = True):
 
         if not config.default_domain:
             #try once with REALM -> domain
-            dom_name = config.default_realm.lower()
+            dom_name = str(config.default_realm).lower()
             name = "_ldap._tcp."+dom_name+"."
             rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
             rl = len(rs)
-- 
1.7.6.4



More information about the Freeipa-devel mailing list