[PATCHES] samba-tool: add --site parameter to provision command

Kamen Mazdrashki kamenim at samba.org
Tue Jun 10 06:17:14 MDT 2014

Hi Bjoern,

As far as I can see, following is not quite correct:
@@ -2152,7 +2155,8 @@ def provision(logger, session_info, smbconf=None,
        if samdb_fill == FILL_FULL:
            provision_fill(samdb, secrets_ldb, logger, names, paths,
                    schema=schema, targetdir=targetdir,
-                    hostip=hostip, hostip6=hostip6, domainsid=domainsid,
+                    hostip=hostip, hostip6=hostip6, sitename=sitename,
+                    domainsid=domainsid,

You are passing sitename directlly, and it is already guessed by
So, you should have exactly what you need names.sitename.

And then, following check is redundand:
@@ -1823,10 +1823,13 @@ def provision_fill(samdb, secrets_ldb, logger,
names, paths,
                # It might be that this attribute does not exist in this

+        if sitename is None:
+            sitename = DEFAULTSITE

as we are going to get correct sitename as parameter.

It seems to also, that after the 3-th patch we are going to end up with two
consts for DEFAULTSITE
One in .../provision/__init__.py and one in domain.py
I hope I am not missreading the patch here


On Wed, Jun 4, 2014 at 2:25 PM, Bjoern Baumbach <bb at sernet.de> wrote:

> Hi!
> Currently there is no option specify the Domain Controllers site when
> setting up a new DC in a new forest. There is also no samba-tool command
> to move a DC to another site.
> Please review the attached patches that add the --site option to the
> samba-tool domain provision command. This offers the option to specify a
> default initial site name.
> Best regards
> Björn
> --
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de, mailto:kontakt at sernet.de

More information about the samba-technical mailing list