summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-06-04 13:44:08 -0400
committerRob Crittenden <rcritten@redhat.com>2008-06-04 22:40:32 -0400
commitec2eff9774ef9ad50f3ce6d3bb9da17801a74553 (patch)
tree6a77a56cf3d8c3d378ea6d25d6f3f5b233ea2982
parentb26fc32d9dbe93a9988df55e837a055a853e825e (diff)
downloadfreeipa.git-ec2eff9774ef9ad50f3ce6d3bb9da17801a74553.tar.gz
freeipa.git-ec2eff9774ef9ad50f3ce6d3bb9da17801a74553.tar.xz
freeipa.git-ec2eff9774ef9ad50f3ce6d3bb9da17801a74553.zip
Under some conditions rl may not have been initialized so the config may error out with:
UnboundLocalError: "local variable 'rl' referenced before assignment" This is caught and ignored but the result is that the records in DNS may not be used at all. Initializing rl to zero fixes this. I also convert the server list into a set to make each entry unique (and back to a list because that is what we are supposed to return) 433506
-rw-r--r--ipa-python/config.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipa-python/config.py b/ipa-python/config.py
index 4671faf9..5a9770e8 100644
--- a/ipa-python/config.py
+++ b/ipa-python/config.py
@@ -78,6 +78,7 @@ def __parse_config():
pass
def __discover_config():
+ rl = 0
try:
if not config.default_realm:
krbctx = krbV.default_context()
@@ -163,6 +164,8 @@ def init_config(args=None):
__parse_config()
__discover_config()
+ config.default_server = list(set(config.default_server))
+
if not config.default_realm:
raise IPAConfigError("IPA realm not found in DNS, in the config file (/etc/ipa/ipa.conf) or on the command line.")
if not config.default_server: