summaryrefslogtreecommitdiffstats
path: root/ipa-python
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2008-05-08 18:05:29 -0400
committerSimo Sorce <ssorce@redhat.com>2008-05-10 11:25:31 -0400
commit0b2756bed7e91c3d18a5f710b5110e37a3645f77 (patch)
tree89c45f59d0ad70649984adb928c01a3f0191ddeb /ipa-python
parent41457f0e817c4b1186e0dceaa486c32a382d180d (diff)
downloadfreeipa-0b2756bed7e91c3d18a5f710b5110e37a3645f77.tar.gz
freeipa-0b2756bed7e91c3d18a5f710b5110e37a3645f77.tar.xz
freeipa-0b2756bed7e91c3d18a5f710b5110e37a3645f77.zip
Fix existence check, default_server is an array so we need to
check its length to determine if it is empty
Diffstat (limited to 'ipa-python')
-rw-r--r--ipa-python/config.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipa-python/config.py b/ipa-python/config.py
index 50055bb50..c760bb6ed 100644
--- a/ipa-python/config.py
+++ b/ipa-python/config.py
@@ -47,7 +47,7 @@ class IPAConfig:
raise IPAConfigError("no default realm")
def get_server(self):
- if self.default_server:
+ if len(self.default_server):
return self.default_server
else:
raise IPAConfigError("no default server")
@@ -62,7 +62,7 @@ def __parse_config():
try:
if not config.default_realm:
config.default_realm = p.get("defaults", "realm")
- if not config.default_server:
+ if not len(config.default_server):
s = p.get("defaults", "server")
config.default_server = re.sub("\s+", "", s).split(',')
except: