summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-06-09 15:00:03 +1000
committerAndrew Tridgell <tridge@samba.org>2011-06-09 15:03:43 +1000
commit1596595b7e644de6432d7c8fb9e10ee2b525440e (patch)
tree5317ec6647f5d3152d908fc895c24c98ce437530 /source4/scripting/python
parent19213b83d6cd5a7deeb6fab8d9fde304290a447c (diff)
downloadsamba-1596595b7e644de6432d7c8fb9e10ee2b525440e.tar.gz
samba-1596595b7e644de6432d7c8fb9e10ee2b525440e.tar.bz2
samba-1596595b7e644de6432d7c8fb9e10ee2b525440e.zip
s4-ipv6: don't default to 127.0.0.1 in provision
it is better to just leave the IPv4 address out of the zone file Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/provision/__init__.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index 324e76f374..f272872a93 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -1585,14 +1585,15 @@ def provision(logger, session_info, credentials, smbconf=None,
if hostip is None:
logger.info("Looking up IPv4 addresses")
hostips = interface_ips_v4(lp)
- if len(hostips) == 0:
- logger.warning("No external IPv4 address has been found. Using loopback.")
- hostip = '127.0.0.1'
- else:
+ if len(hostips) > 0:
hostip = hostips[0]
if len(hostips) > 1:
logger.warning("More than one IPv4 address found. Using %s",
hostip)
+ if hostip == "127.0.0.1":
+ hostip = None
+ if hostip is None:
+ logger.warning("No IPv4 address will be assigned")
if hostip6 is None:
logger.info("Looking up IPv6 addresses")
@@ -1601,6 +1602,8 @@ def provision(logger, session_info, credentials, smbconf=None,
hostip6 = hostips[0]
if len(hostips) > 1:
logger.warning("More than one IPv6 address found. Using %s", hostip6)
+ if hostip6 is None:
+ logger.warning("No IPv6 address will be assigned")
if serverrole is None:
serverrole = lp.get("server role")
@@ -1868,7 +1871,7 @@ def provision_become_dc(smbconf=None, targetdir=None,
smbconf=smbconf, targetdir=targetdir, samdb_fill=FILL_DRS,
realm=realm, rootdn=rootdn, domaindn=domaindn, schemadn=schemadn,
configdn=configdn, serverdn=serverdn, domain=domain,
- hostname=hostname, hostip="127.0.0.1", domainsid=domainsid,
+ hostname=hostname, hostip=None, domainsid=domainsid,
machinepass=machinepass, serverrole="domain controller",
sitename=sitename)
res.lp.set("debuglevel", str(debuglevel))