diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-08-03 17:15:10 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-08-17 08:44:28 +1000 |
commit | ec3ed2898fec44ceb48ee78fc934c6f4e67aaf73 (patch) | |
tree | 93752d03a308cd25378c2dade67c24d4408b0dba /source4 | |
parent | fd59a7c4affdd1a6c6fe7caf29264acabcd0c03e (diff) | |
download | samba-ec3ed2898fec44ceb48ee78fc934c6f4e67aaf73.tar.gz samba-ec3ed2898fec44ceb48ee78fc934c6f4e67aaf73.tar.bz2 samba-ec3ed2898fec44ceb48ee78fc934c6f4e67aaf73.zip |
s3-provision: cope with the policy directory already existing
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 8be3f655d2..9014e49b1c 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -949,11 +949,16 @@ def getpolicypath(sysvolpath, dnsdomain, guid): return policy_path def create_gpo_struct(policy_path): - os.makedirs(policy_path, 0755) + if not os.path.exists(policy_path): + os.makedirs(policy_path, 0755) open(os.path.join(policy_path, "GPT.INI"), 'w').write( "[General]\r\nVersion=65543") - os.makedirs(os.path.join(policy_path, "MACHINE"), 0755) - os.makedirs(os.path.join(policy_path, "USER"), 0755) + p = os.path.join(policy_path, "MACHINE") + if not os.path.exists(p): + os.makedirs(p, 0755) + p = os.path.join(policy_path, "USER") + if not os.path.exists(p): + os.makedirs(p, 0755) def setup_gpo(sysvolpath, dnsdomain, policyguid, policyguid_dc): |