diff --git a/source4/scripting/python/samba_external/dnspython/ChangeLog b/lib/dnspython/ChangeLog
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/ChangeLog
rename to lib/dnspython/ChangeLog
diff --git a/source4/scripting/python/samba_external/dnspython/LICENSE b/lib/dnspython/LICENSE
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/LICENSE
rename to lib/dnspython/LICENSE
diff --git a/source4/scripting/python/samba_external/dnspython/PKG-INFO b/lib/dnspython/PKG-INFO
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/PKG-INFO
rename to lib/dnspython/PKG-INFO
diff --git a/source4/scripting/python/samba_external/dnspython/README b/lib/dnspython/README
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/README
rename to lib/dnspython/README
diff --git a/source4/scripting/python/samba_external/dnspython/TODO b/lib/dnspython/TODO
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/TODO
rename to lib/dnspython/TODO
diff --git a/source4/scripting/python/samba_external/dnspython/dns/__init__.py b/lib/dnspython/dns/__init__.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/__init__.py
rename to lib/dnspython/dns/__init__.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/dnssec.py b/lib/dnspython/dns/dnssec.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/dnssec.py
rename to lib/dnspython/dns/dnssec.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/e164.py b/lib/dnspython/dns/e164.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/e164.py
rename to lib/dnspython/dns/e164.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/edns.py b/lib/dnspython/dns/edns.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/edns.py
rename to lib/dnspython/dns/edns.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/entropy.py b/lib/dnspython/dns/entropy.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/entropy.py
rename to lib/dnspython/dns/entropy.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/exception.py b/lib/dnspython/dns/exception.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/exception.py
rename to lib/dnspython/dns/exception.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/flags.py b/lib/dnspython/dns/flags.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/flags.py
rename to lib/dnspython/dns/flags.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/inet.py b/lib/dnspython/dns/inet.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/inet.py
rename to lib/dnspython/dns/inet.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/ipv4.py b/lib/dnspython/dns/ipv4.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/ipv4.py
rename to lib/dnspython/dns/ipv4.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/ipv6.py b/lib/dnspython/dns/ipv6.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/ipv6.py
rename to lib/dnspython/dns/ipv6.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/message.py b/lib/dnspython/dns/message.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/message.py
rename to lib/dnspython/dns/message.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/name.py b/lib/dnspython/dns/name.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/name.py
rename to lib/dnspython/dns/name.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/namedict.py b/lib/dnspython/dns/namedict.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/namedict.py
rename to lib/dnspython/dns/namedict.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/node.py b/lib/dnspython/dns/node.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/node.py
rename to lib/dnspython/dns/node.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/opcode.py b/lib/dnspython/dns/opcode.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/opcode.py
rename to lib/dnspython/dns/opcode.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/query.py b/lib/dnspython/dns/query.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/query.py
rename to lib/dnspython/dns/query.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rcode.py b/lib/dnspython/dns/rcode.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rcode.py
rename to lib/dnspython/dns/rcode.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdata.py b/lib/dnspython/dns/rdata.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdata.py
rename to lib/dnspython/dns/rdata.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdataclass.py b/lib/dnspython/dns/rdataclass.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdataclass.py
rename to lib/dnspython/dns/rdataclass.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdataset.py b/lib/dnspython/dns/rdataset.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdataset.py
rename to lib/dnspython/dns/rdataset.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdatatype.py b/lib/dnspython/dns/rdatatype.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdatatype.py
rename to lib/dnspython/dns/rdatatype.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/AFSDB.py b/lib/dnspython/dns/rdtypes/ANY/AFSDB.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/AFSDB.py
rename to lib/dnspython/dns/rdtypes/ANY/AFSDB.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/CERT.py b/lib/dnspython/dns/rdtypes/ANY/CERT.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/CERT.py
rename to lib/dnspython/dns/rdtypes/ANY/CERT.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/CNAME.py b/lib/dnspython/dns/rdtypes/ANY/CNAME.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/CNAME.py
rename to lib/dnspython/dns/rdtypes/ANY/CNAME.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DLV.py b/lib/dnspython/dns/rdtypes/ANY/DLV.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DLV.py
rename to lib/dnspython/dns/rdtypes/ANY/DLV.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DNAME.py b/lib/dnspython/dns/rdtypes/ANY/DNAME.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DNAME.py
rename to lib/dnspython/dns/rdtypes/ANY/DNAME.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DNSKEY.py b/lib/dnspython/dns/rdtypes/ANY/DNSKEY.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DNSKEY.py
rename to lib/dnspython/dns/rdtypes/ANY/DNSKEY.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DS.py b/lib/dnspython/dns/rdtypes/ANY/DS.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/DS.py
rename to lib/dnspython/dns/rdtypes/ANY/DS.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/GPOS.py b/lib/dnspython/dns/rdtypes/ANY/GPOS.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/GPOS.py
rename to lib/dnspython/dns/rdtypes/ANY/GPOS.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/HINFO.py b/lib/dnspython/dns/rdtypes/ANY/HINFO.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/HINFO.py
rename to lib/dnspython/dns/rdtypes/ANY/HINFO.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/HIP.py b/lib/dnspython/dns/rdtypes/ANY/HIP.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/HIP.py
rename to lib/dnspython/dns/rdtypes/ANY/HIP.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/ISDN.py b/lib/dnspython/dns/rdtypes/ANY/ISDN.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/ISDN.py
rename to lib/dnspython/dns/rdtypes/ANY/ISDN.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/KEY.py b/lib/dnspython/dns/rdtypes/ANY/KEY.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/KEY.py
rename to lib/dnspython/dns/rdtypes/ANY/KEY.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/LOC.py b/lib/dnspython/dns/rdtypes/ANY/LOC.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/LOC.py
rename to lib/dnspython/dns/rdtypes/ANY/LOC.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/MX.py b/lib/dnspython/dns/rdtypes/ANY/MX.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/MX.py
rename to lib/dnspython/dns/rdtypes/ANY/MX.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NS.py b/lib/dnspython/dns/rdtypes/ANY/NS.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NS.py
rename to lib/dnspython/dns/rdtypes/ANY/NS.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NSEC.py b/lib/dnspython/dns/rdtypes/ANY/NSEC.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NSEC.py
rename to lib/dnspython/dns/rdtypes/ANY/NSEC.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NSEC3.py b/lib/dnspython/dns/rdtypes/ANY/NSEC3.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NSEC3.py
rename to lib/dnspython/dns/rdtypes/ANY/NSEC3.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NSEC3PARAM.py b/lib/dnspython/dns/rdtypes/ANY/NSEC3PARAM.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NSEC3PARAM.py
rename to lib/dnspython/dns/rdtypes/ANY/NSEC3PARAM.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NXT.py b/lib/dnspython/dns/rdtypes/ANY/NXT.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/NXT.py
rename to lib/dnspython/dns/rdtypes/ANY/NXT.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/PTR.py b/lib/dnspython/dns/rdtypes/ANY/PTR.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/PTR.py
rename to lib/dnspython/dns/rdtypes/ANY/PTR.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/RP.py b/lib/dnspython/dns/rdtypes/ANY/RP.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/RP.py
rename to lib/dnspython/dns/rdtypes/ANY/RP.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/RRSIG.py b/lib/dnspython/dns/rdtypes/ANY/RRSIG.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/RRSIG.py
rename to lib/dnspython/dns/rdtypes/ANY/RRSIG.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/RT.py b/lib/dnspython/dns/rdtypes/ANY/RT.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/RT.py
rename to lib/dnspython/dns/rdtypes/ANY/RT.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SIG.py b/lib/dnspython/dns/rdtypes/ANY/SIG.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SIG.py
rename to lib/dnspython/dns/rdtypes/ANY/SIG.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SOA.py b/lib/dnspython/dns/rdtypes/ANY/SOA.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SOA.py
rename to lib/dnspython/dns/rdtypes/ANY/SOA.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SPF.py b/lib/dnspython/dns/rdtypes/ANY/SPF.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SPF.py
rename to lib/dnspython/dns/rdtypes/ANY/SPF.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SSHFP.py b/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/SSHFP.py
rename to lib/dnspython/dns/rdtypes/ANY/SSHFP.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/TXT.py b/lib/dnspython/dns/rdtypes/ANY/TXT.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/TXT.py
rename to lib/dnspython/dns/rdtypes/ANY/TXT.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/X25.py b/lib/dnspython/dns/rdtypes/ANY/X25.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/X25.py
rename to lib/dnspython/dns/rdtypes/ANY/X25.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/__init__.py b/lib/dnspython/dns/rdtypes/ANY/__init__.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/ANY/__init__.py
rename to lib/dnspython/dns/rdtypes/ANY/__init__.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/A.py b/lib/dnspython/dns/rdtypes/IN/A.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/A.py
rename to lib/dnspython/dns/rdtypes/IN/A.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/AAAA.py b/lib/dnspython/dns/rdtypes/IN/AAAA.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/AAAA.py
rename to lib/dnspython/dns/rdtypes/IN/AAAA.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/APL.py b/lib/dnspython/dns/rdtypes/IN/APL.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/APL.py
rename to lib/dnspython/dns/rdtypes/IN/APL.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/DHCID.py b/lib/dnspython/dns/rdtypes/IN/DHCID.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/DHCID.py
rename to lib/dnspython/dns/rdtypes/IN/DHCID.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/IPSECKEY.py b/lib/dnspython/dns/rdtypes/IN/IPSECKEY.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/IPSECKEY.py
rename to lib/dnspython/dns/rdtypes/IN/IPSECKEY.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/KX.py b/lib/dnspython/dns/rdtypes/IN/KX.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/KX.py
rename to lib/dnspython/dns/rdtypes/IN/KX.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/NAPTR.py b/lib/dnspython/dns/rdtypes/IN/NAPTR.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/NAPTR.py
rename to lib/dnspython/dns/rdtypes/IN/NAPTR.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/NSAP.py b/lib/dnspython/dns/rdtypes/IN/NSAP.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/NSAP.py
rename to lib/dnspython/dns/rdtypes/IN/NSAP.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/NSAP_PTR.py b/lib/dnspython/dns/rdtypes/IN/NSAP_PTR.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/NSAP_PTR.py
rename to lib/dnspython/dns/rdtypes/IN/NSAP_PTR.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/PX.py b/lib/dnspython/dns/rdtypes/IN/PX.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/PX.py
rename to lib/dnspython/dns/rdtypes/IN/PX.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/SRV.py b/lib/dnspython/dns/rdtypes/IN/SRV.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/SRV.py
rename to lib/dnspython/dns/rdtypes/IN/SRV.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/WKS.py b/lib/dnspython/dns/rdtypes/IN/WKS.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/WKS.py
rename to lib/dnspython/dns/rdtypes/IN/WKS.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/__init__.py b/lib/dnspython/dns/rdtypes/IN/__init__.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/IN/__init__.py
rename to lib/dnspython/dns/rdtypes/IN/__init__.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/__init__.py b/lib/dnspython/dns/rdtypes/__init__.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/__init__.py
rename to lib/dnspython/dns/rdtypes/__init__.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/dsbase.py b/lib/dnspython/dns/rdtypes/dsbase.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/dsbase.py
rename to lib/dnspython/dns/rdtypes/dsbase.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/keybase.py b/lib/dnspython/dns/rdtypes/keybase.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/keybase.py
rename to lib/dnspython/dns/rdtypes/keybase.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/mxbase.py b/lib/dnspython/dns/rdtypes/mxbase.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/mxbase.py
rename to lib/dnspython/dns/rdtypes/mxbase.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/nsbase.py b/lib/dnspython/dns/rdtypes/nsbase.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/nsbase.py
rename to lib/dnspython/dns/rdtypes/nsbase.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/sigbase.py b/lib/dnspython/dns/rdtypes/sigbase.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/sigbase.py
rename to lib/dnspython/dns/rdtypes/sigbase.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rdtypes/txtbase.py b/lib/dnspython/dns/rdtypes/txtbase.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rdtypes/txtbase.py
rename to lib/dnspython/dns/rdtypes/txtbase.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/renderer.py b/lib/dnspython/dns/renderer.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/renderer.py
rename to lib/dnspython/dns/renderer.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/resolver.py b/lib/dnspython/dns/resolver.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/resolver.py
rename to lib/dnspython/dns/resolver.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/reversename.py b/lib/dnspython/dns/reversename.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/reversename.py
rename to lib/dnspython/dns/reversename.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/rrset.py b/lib/dnspython/dns/rrset.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/rrset.py
rename to lib/dnspython/dns/rrset.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/set.py b/lib/dnspython/dns/set.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/set.py
rename to lib/dnspython/dns/set.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/tokenizer.py b/lib/dnspython/dns/tokenizer.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/tokenizer.py
rename to lib/dnspython/dns/tokenizer.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/tsig.py b/lib/dnspython/dns/tsig.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/tsig.py
rename to lib/dnspython/dns/tsig.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/tsigkeyring.py b/lib/dnspython/dns/tsigkeyring.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/tsigkeyring.py
rename to lib/dnspython/dns/tsigkeyring.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/ttl.py b/lib/dnspython/dns/ttl.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/ttl.py
rename to lib/dnspython/dns/ttl.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/update.py b/lib/dnspython/dns/update.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/update.py
rename to lib/dnspython/dns/update.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/version.py b/lib/dnspython/dns/version.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/version.py
rename to lib/dnspython/dns/version.py
diff --git a/source4/scripting/python/samba_external/dnspython/dns/zone.py b/lib/dnspython/dns/zone.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/dns/zone.py
rename to lib/dnspython/dns/zone.py
diff --git a/source4/scripting/python/samba_external/dnspython/examples/ddns.py b/lib/dnspython/examples/ddns.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/examples/ddns.py
rename to lib/dnspython/examples/ddns.py
diff --git a/source4/scripting/python/samba_external/dnspython/examples/e164.py b/lib/dnspython/examples/e164.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/examples/e164.py
rename to lib/dnspython/examples/e164.py
diff --git a/source4/scripting/python/samba_external/dnspython/examples/mx.py b/lib/dnspython/examples/mx.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/examples/mx.py
rename to lib/dnspython/examples/mx.py
diff --git a/source4/scripting/python/samba_external/dnspython/examples/name.py b/lib/dnspython/examples/name.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/examples/name.py
rename to lib/dnspython/examples/name.py
diff --git a/source4/scripting/python/samba_external/dnspython/examples/reverse.py b/lib/dnspython/examples/reverse.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/examples/reverse.py
rename to lib/dnspython/examples/reverse.py
diff --git a/source4/scripting/python/samba_external/dnspython/examples/reverse_name.py b/lib/dnspython/examples/reverse_name.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/examples/reverse_name.py
rename to lib/dnspython/examples/reverse_name.py
diff --git a/source4/scripting/python/samba_external/dnspython/examples/xfr.py b/lib/dnspython/examples/xfr.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/examples/xfr.py
rename to lib/dnspython/examples/xfr.py
diff --git a/source4/scripting/python/samba_external/dnspython/setup.py b/lib/dnspython/setup.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/setup.py
rename to lib/dnspython/setup.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/Makefile b/lib/dnspython/tests/Makefile
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/Makefile
rename to lib/dnspython/tests/Makefile
diff --git a/source4/scripting/python/samba_external/dnspython/tests/bugs.py b/lib/dnspython/tests/bugs.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/bugs.py
rename to lib/dnspython/tests/bugs.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/example b/lib/dnspython/tests/example
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/example
rename to lib/dnspython/tests/example
diff --git a/source4/scripting/python/samba_external/dnspython/tests/example1.good b/lib/dnspython/tests/example1.good
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/example1.good
rename to lib/dnspython/tests/example1.good
diff --git a/source4/scripting/python/samba_external/dnspython/tests/example2.good b/lib/dnspython/tests/example2.good
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/example2.good
rename to lib/dnspython/tests/example2.good
diff --git a/source4/scripting/python/samba_external/dnspython/tests/flags.py b/lib/dnspython/tests/flags.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/flags.py
rename to lib/dnspython/tests/flags.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/message.py b/lib/dnspython/tests/message.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/message.py
rename to lib/dnspython/tests/message.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/name.py b/lib/dnspython/tests/name.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/name.py
rename to lib/dnspython/tests/name.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/namedict.py b/lib/dnspython/tests/namedict.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/namedict.py
rename to lib/dnspython/tests/namedict.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/ntoaaton.py b/lib/dnspython/tests/ntoaaton.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/ntoaaton.py
rename to lib/dnspython/tests/ntoaaton.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/rdtypeandclass.py b/lib/dnspython/tests/rdtypeandclass.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/rdtypeandclass.py
rename to lib/dnspython/tests/rdtypeandclass.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/resolver.py b/lib/dnspython/tests/resolver.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/resolver.py
rename to lib/dnspython/tests/resolver.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/rrset.py b/lib/dnspython/tests/rrset.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/rrset.py
rename to lib/dnspython/tests/rrset.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/set.py b/lib/dnspython/tests/set.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/set.py
rename to lib/dnspython/tests/set.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/tokenizer.py b/lib/dnspython/tests/tokenizer.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/tokenizer.py
rename to lib/dnspython/tests/tokenizer.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/update.py b/lib/dnspython/tests/update.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/update.py
rename to lib/dnspython/tests/update.py
diff --git a/source4/scripting/python/samba_external/dnspython/tests/zone.py b/lib/dnspython/tests/zone.py
similarity index 100%
rename from source4/scripting/python/samba_external/dnspython/tests/zone.py
rename to lib/dnspython/tests/zone.py
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 4d54ab4f4cb..fab112e2bd9 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -18,7 +18,6 @@
# along with this program. If not, see .
-import getopt
import os
import fcntl
import sys
@@ -33,15 +32,14 @@ sys.path.insert(0, "bin/python")
import samba
import optparse
-from samba import getopt as options, Ldb
-from ldb import SCOPE_SUBTREE, SCOPE_BASE, LdbError
-import ldb
+from samba import getopt as options
+from ldb import SCOPE_BASE
from samba import glue
from samba.auth import system_session
from samba.samdb import SamDB
import samba.external
-resolver = samba.external.samba_external_dns_resolver()
+resolver = samba.external.dns_resolver()
default_ttl = 900
diff --git a/source4/scripting/python/config.mk b/source4/scripting/python/config.mk
index c1e1c5de82d..0b495260bd4 100644
--- a/source4/scripting/python/config.mk
+++ b/source4/scripting/python/config.mk
@@ -30,7 +30,7 @@ $(eval $(foreach pyfile, $(_PY_FILES),$(call python_py_module_template,$(patsubs
EPYDOC_OPTIONS = --no-private --url http://www.samba.org/ --no-sourcecode
epydoc:: pythonmods
- PYTHONPATH=$(pythonbuilddir):../lib/subunit/python epydoc $(EPYDOC_OPTIONS) samba tdb ldb subunit testtools
+ PYTHONPATH=$(pythonbuilddir):../lib/subunit/python epydoc $(EPYDOC_OPTIONS) samba tdb ldb subunit testtools dnspython
install:: installpython
diff --git a/source4/scripting/python/samba/external.py b/source4/scripting/python/samba/external.py
index eca910b794d..40d13fd7e5d 100644
--- a/source4/scripting/python/samba/external.py
+++ b/source4/scripting/python/samba/external.py
@@ -17,34 +17,15 @@
# along with this program. If not, see .
#
-import sys, os
+import os, sys
-def samba_find_external(directory):
- '''insert into out module search path the path to an
- external library'''
- for p in sys.path:
- dir = os.path.join(p, directory)
- if os.path.isdir(dir):
- sys.path.insert(0, dir)
- return
-
- # finally try in the local directory, to handle in-tree testing
- dir = os.path.join("scripting/python", directory)
- if os.path.isdir(dir):
- sys.path.insert(0, dir)
- return
-
- print "Failed to find external python library %s" % directory
- raise
-
-
-def samba_external_dns_resolver():
+def dns_resolver():
'''try and import the dns.resolver library, and if it fails
then use a local copy from the external directory'''
try:
import dns.resolver as dns
- except:
- samba_find_external("samba_external/dnspython")
+ except ImportError:
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../../../lib/dnspython"))
import dns.resolver as dns
return dns