Fixed a problem with provision missing the default_dir/etc directory.
authorNadezhda Ivanova <nadezhda.ivanova@postpath.com>
Mon, 12 Apr 2010 13:05:37 +0000 (16:05 +0300)
committerNadezhda Ivanova <nadezhda.ivanova@postpath.com>
Mon, 12 Apr 2010 13:06:06 +0000 (16:06 +0300)
source4/scripting/python/samba/provision.py

index 2e4aa34a8ce90826e2969e46c9c8c91cf40c4ce6..f2004878c1cf2d6040974111a6bb50d298c1652a 100644 (file)
@@ -1170,11 +1170,11 @@ def provision(setup_dir, message, session_info,
         bind_gid = None
 
     if targetdir is not None:
-        if (not os.path.exists(os.path.join(targetdir, "etc"))):
-            os.makedirs(os.path.join(targetdir, "etc"))
         smbconf = os.path.join(targetdir, "etc", "smb.conf")
     elif smbconf is None:
         smbconf = param.default_path()
+    if not os.path.exists(os.path.dirname(smbconf)):
+        os.makedirs(os.path.dirname(smbconf))
 
     # only install a new smb.conf if there isn't one there already
     if os.path.exists(smbconf):