summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-11-25 17:16:06 -0500
committerJason Gerard DeRose <jderose@redhat.com>2009-12-01 09:11:23 -0700
commit384eec771d304df730a6545e777324b310818e56 (patch)
tree77c1a903cd3ef2761cc916925229a9e4440ddb8e /ipapython
parent2f8129a17c11e8bff466f702bbfc1ed43b860ebe (diff)
downloadfreeipa-384eec771d304df730a6545e777324b310818e56.tar.gz
freeipa-384eec771d304df730a6545e777324b310818e56.tar.xz
freeipa-384eec771d304df730a6545e777324b310818e56.zip
Replace /etc/ipa/ipa.conf with /etc/ipa/default.conf
The new framework uses default.conf instead of ipa.conf. This is useful also because Apache uses a configuration file named ipa.conf. This wipes out the last vestiges of the old ipa.conf from v1.
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/README2
-rw-r--r--ipapython/config.py24
-rw-r--r--ipapython/setup.py.in1
3 files changed, 14 insertions, 13 deletions
diff --git a/ipapython/README b/ipapython/README
index c966e44b..c1db2996 100644
--- a/ipapython/README
+++ b/ipapython/README
@@ -5,7 +5,7 @@ A brief overview:
config.py - identify the IPA server domain and realm. It uses dnsclient to
try to detect this information first and will fall back to
- /etc/ipa/ipa.conf if that fails.
+ /etc/ipa/default.conf if that fails.
dnsclient.py - find IPA information via DNS
ipautil.py - helper functions
diff --git a/ipapython/config.py b/ipapython/config.py
index efae910e..f3532c47 100644
--- a/ipapython/config.py
+++ b/ipapython/config.py
@@ -24,6 +24,7 @@ import krbV
import socket
import ipapython.dnsclient
import re
+import urlparse
class IPAConfigError(Exception):
def __init__(self, msg=''):
@@ -88,22 +89,23 @@ config = IPAConfig()
def __parse_config(discover_server = True):
p = ConfigParser.SafeConfigParser()
- p.read("/etc/ipa/ipa.conf")
+ p.read("/etc/ipa/default.conf")
try:
if not config.default_realm:
- config.default_realm = p.get("defaults", "realm")
+ config.default_realm = p.get("global", "realm")
except:
pass
if discover_server:
try:
- s = p.get("defaults", "server")
- config.default_server.extend(re.sub("\s+", "", s).split(','))
+ s = p.get("global", "xmlrpc_uri")
+ server = urlparse.urlsplit(s)
+ config.default_server.extend(server.netloc)
except:
pass
try:
if not config.default_domain:
- config.default_domain = p.get("defaults", "domain")
+ config.default_domain = p.get("global", "domain")
except:
pass
@@ -128,7 +130,7 @@ def __discover_config(discover_server = True):
while rl == 0:
tok = dom_name.find(".")
if tok == -1:
- return False
+ return False
dom_name = dom_name[tok+1:]
name = "_ldap._tcp." + dom_name + "."
rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
@@ -138,8 +140,8 @@ def __discover_config(discover_server = True):
if discover_server:
if rl == 0:
- name = "_ldap._tcp."+config.default_domain+"."
- rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
+ name = "_ldap._tcp."+config.default_domain+"."
+ rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV)
for r in rs:
if r.dns_type == ipapython.dnsclient.DNS_T_SRV:
@@ -176,8 +178,8 @@ def init_config(options=None):
config.default_server = new_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.")
+ raise IPAConfigError("IPA realm not found in DNS, in the config file (/etc/ipa/default.conf) or on the command line.")
if not config.default_server:
- raise IPAConfigError("IPA server not found in DNS, in the config file (/etc/ipa/ipa.conf) or on the command line.")
+ raise IPAConfigError("IPA server not found in DNS, in the config file (/etc/ipa/default.conf) or on the command line.")
if not config.default_domain:
- raise IPAConfigError("IPA domain not found in the config file (/etc/ipa/ipa.conf) or on the command line.")
+ raise IPAConfigError("IPA domain not found in the config file (/etc/ipa/default.conf) or on the command line.")
diff --git a/ipapython/setup.py.in b/ipapython/setup.py.in
index 667c5ae0..99af2a7c 100644
--- a/ipapython/setup.py.in
+++ b/ipapython/setup.py.in
@@ -66,7 +66,6 @@ def setup_package():
platforms = ["Linux", "Solaris", "Unix"],
package_dir = {'ipapython': ''},
packages = [ "ipapython" ],
- data_files = [('/etc/ipa', ['ipa.conf'])]
)
finally:
del sys.path[0]