summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-04-09 02:55:38 +0400
committerJelmer Vernooij <jelmer@samba.org>2010-06-20 00:43:07 +0200
commit60400a7803d765fd53100fe088f1237e67887fe3 (patch)
treebdacb72e457363ad08b8046deeba0aa0f97b36b0 /source4
parent26ccc3f4400165448f9a53efdec224d11f290783 (diff)
downloadsamba-60400a7803d765fd53100fe088f1237e67887fe3.tar.gz
samba-60400a7803d765fd53100fe088f1237e67887fe3.tar.bz2
samba-60400a7803d765fd53100fe088f1237e67887fe3.zip
s4 upgradeprovision: Inform about new dns dynamic update if the provision didn't have it
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/scripting/bin/upgradeprovision44
1 files changed, 41 insertions, 3 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index 9ecd0b8a4a..e76903d210 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -160,9 +160,46 @@ def identic_rename(ldbobj,dn):
:param lbdobj: An Ldb Object
:param dn: DN of the object to manipulate """
- (before,sep,after)=str(dn).partition('=')
- ldbobj.rename(dn,Dn(ldbobj,"%s=foo%s"%(before,after)))
- ldbobj.rename(Dn(ldbobj,"%s=foo%s"%(before,after)),dn)
+
+ (before, sep, after)=str(dn).partition('=')
+ ldbobj.rename(dn, Dn(ldbobj, "%s=foo%s" % (before, after)))
+ ldbobj.rename(Dn(ldbobj, "%s=foo%s" % (before, after)), dn)
+
+def check_for_DNS(refprivate, private):
+ """Check if the provision has already the requirement for dynamic dns
+
+ :param refprivate: The path to the private directory of the reference
+ provision
+ :param private: The path to the private directory of the upgraded
+ provision"""
+
+ spnfile = "%s/spn_update_list" % private
+ namedfile = lp.get("dnsupdate:path")
+
+ if not namedfile:
+ namedfile = "%s/named.conf.update" % private
+
+ if not os.path.exists(spnfile):
+ shutil.copy("%s/spn_update_list" % refprivate, "%s" % spnfile)
+
+ destdir = "%s/new_dns" % private
+ dnsdir = "%s/dns" % private
+
+ if not os.path.exists(namedfile):
+ if not os.path.exists(destdir):
+ os.mkdir(destdir)
+ if not os.path.exists(dnsdir):
+ os.mkdir(dnsdir)
+ shutil.copy("%s/named.conf" % refprivate, "%s/named.conf" % destdir)
+ shutil.copy("%s/named.txt" % refprivate, "%s/named.txt" % destdir)
+ message(SIMPLE, "It seems that you provision didn't integrate new rules "
+ "for dynamic dns update of domain related entries")
+ message(SIMPLE, "A copy of the new bind configuration files and "
+ "template as been put in %s, you should read them and configure dynamic "
+ " dns update" % destdir)
+
+
+# dnsupdate:path
def populate_backlink(samdb, schemadn):
@@ -1115,6 +1152,7 @@ if __name__ == '__main__':
check_updated_sd(new_ldbs.sam,ldbs.sam, names)
updateOEMInfo(ldbs.sam,names)
+ check_for_DNS(newpaths.private_dir, paths.private_dir)
updateProvisionUSN(ldbs.sam,names)
ldbs.groupedCommit()
new_ldbs.groupedCommit()