From b1831b4593b3d219b79830f3012e7ff07f17b1d8 Mon Sep 17 00:00:00 2001 From: Karl MacMillan Date: Wed, 1 Aug 2007 11:09:12 -0400 Subject: Fix typo / buglets in setup scripts. Add fallback to ds_newinst.pl. --- ipa-server/ipaserver/dsinstance.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'ipa-server/ipaserver/dsinstance.py') diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index 33514fef..775a2f2b 100644 --- a/ipa-server/ipaserver/dsinstance.py +++ b/ipa-server/ipaserver/dsinstance.py @@ -24,8 +24,6 @@ import tempfile import shutil import logging import pwd -import os -import stat from util import * @@ -52,14 +50,11 @@ def realm_to_suffix(realm_name): return ",".join(terms) def find_server_root(): - try: - mode = os.stat(SERVER_ROOT_64)[ST_MODE] - if stat.IS_DIR(mode): - return SERVER_ROOT_64 - except: + if dir_exists(SERVER_ROOT_64): + return SERVER_ROOT_64 + else: return SERVER_ROOT_32 - INF_TEMPLATE = """ [General] FullMachineName= $FQHN @@ -137,8 +132,12 @@ class DsInstance: logging.debug(inf_txt) inf_fd = write_tmp_file(inf_txt) logging.debug("writing inf template") - args = ["/usr/sbin/setup-ds.pl", "--silent", "--logfile", "-", "-f", inf_fd.name, ] - logging.debug("calling ds_newinst.pl") + if file_exists("/usr/sbin/setup-ds.pl"): + args = ["/usr/sbin/setup-ds.pl", "--silent", "--logfile", "-", "-f", inf_fd.name] + logging.debug("calling setup-ds.pl") + else: + args = ["/usr/sbin/ds_newinst.pl", inf_fd.name] + logging.debug("calling ds_newinst.pl") run(args) logging.debug("completed creating ds instance") logging.debug("restarting ds instance") -- cgit