diff options
author | Karl MacMillan <kmacmillan@mentalrootkit.com> | 2007-08-01 11:09:12 -0400 |
---|---|---|
committer | Karl MacMillan <kmacmillan@mentalrootkit.com> | 2007-08-01 11:09:12 -0400 |
commit | b1831b4593b3d219b79830f3012e7ff07f17b1d8 (patch) | |
tree | 0fbe5738ffed28161b8c4402180f1a5cd7513b51 /ipa-server/ipaserver/util.py | |
parent | cef59d76eb46c1af448a718bd018e192a0b41a78 (diff) | |
download | freeipa.git-b1831b4593b3d219b79830f3012e7ff07f17b1d8.tar.gz freeipa.git-b1831b4593b3d219b79830f3012e7ff07f17b1d8.tar.xz freeipa.git-b1831b4593b3d219b79830f3012e7ff07f17b1d8.zip |
Fix typo / buglets in setup scripts.
Add fallback to ds_newinst.pl.
Diffstat (limited to 'ipa-server/ipaserver/util.py')
-rw-r--r-- | ipa-server/ipaserver/util.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/util.py b/ipa-server/ipaserver/util.py index 3dcfb760..2f677dad 100644 --- a/ipa-server/ipaserver/util.py +++ b/ipa-server/ipaserver/util.py @@ -24,6 +24,8 @@ import string import tempfile import logging import subprocess +import os +import stat def realm_to_suffix(realm_name): s = realm_name.split(".") @@ -56,3 +58,23 @@ def run(args, stdin=None): if p.returncode != 0: raise subprocess.CalledProcessError(p.returncode, args[0]) + +def file_exists(filename): + try: + mode = os.stat(filename)[stat.ST_MODE] + if stat.S_ISREG(mode): + return True + else: + return False + except: + return False + +def dir_exists(filename): + try: + mode = os.stat(filename)[stat.ST_MODE] + if stat.S_ISDIR(mode): + return True + else: + return False + except: + return False |