diff options
author | Nadezhda Ivanova <nivanova@symas.com> | 2013-09-24 10:26:05 -0700 |
---|---|---|
committer | Nadezhda Ivanova <nivanova@samba.org> | 2013-09-26 07:31:05 +0200 |
commit | fc486d861c4c616407725b7adfa7cec712526c9a (patch) | |
tree | 5b7c2d757eee4a52b444d63b1a73c8fcc9c53616 /python/samba/netcmd/domain.py | |
parent | 58cb40d50ba7d0eb70ee1bcdae8c3bf6d9b17f8a (diff) | |
download | samba-fc486d861c4c616407725b7adfa7cec712526c9a.tar.gz samba-fc486d861c4c616407725b7adfa7cec712526c9a.tar.bz2 samba-fc486d861c4c616407725b7adfa7cec712526c9a.zip |
s4-openldap: Restored openldap-related options to the provision script
At the moment they are only available if TEST_LDAP=yes to avoid accidental use
as the openldap backend is still failing some tests
Signed-off-by: Nadezhda Ivanova <nivanova@symas.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date(master): Thu Sep 26 07:31:05 CEST 2013 on sn-devel-104
Diffstat (limited to 'python/samba/netcmd/domain.py')
-rw-r--r-- | python/samba/netcmd/domain.py | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index e7269c6523..0698928de0 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -214,6 +214,21 @@ class cmd_domain_provision(Command): Option("--use-ntvfs", action="store_true", help="Use NTVFS for the fileserver (default = no)"), Option("--use-rfc2307", action="store_true", help="Use AD to store posix attributes (default = no)"), ] + + openldap_options = [ + Option("--ldap-dryrun-mode", help="Configure LDAP backend, but do not run any binaries and exit early. Used only for the test environment. DO NOT USE", + action="store_true"), + Option("--slapd-path", type="string", metavar="SLAPD-PATH", + help="Path to slapd for LDAP backend [e.g.:'/usr/local/libexec/slapd']. Required for Setup with LDAP-Backend. OpenLDAP Version >= 2.4.17 should be used."), + Option("--ldap-backend-extra-port", type="int", metavar="LDAP-BACKEND-EXTRA-PORT", help="Additional TCP port for LDAP backend server (to use for replication)"), + Option("--ldap-backend-forced-uri", type="string", metavar="LDAP-BACKEND-FORCED-URI", + help="Force the LDAP backend connection to be to a particular URI. Use this ONLY for 'existing' backends, or when debugging the interaction with the LDAP backend and you need to intercept the LDA"), + Option("--ldap-backend-nosync", help="Configure LDAP backend not to call fsync() (for performance in test environments)", action="store_true"), + ] + + if os.getenv('TEST_LDAP', "no") == "yes": + takes_options.extend(openldap_options) + takes_args = [] def run(self, sambaopts=None, credopts=None, versionopts=None, @@ -246,8 +261,13 @@ class cmd_domain_provision(Command): targetdir=None, ol_mmr_urls=None, use_xattrs=None, + slapd_path=None, use_ntvfs=None, - use_rfc2307=None): + use_rfc2307=None, + ldap_backend_nosync=None, + ldap_backend_extra_port=None, + ldap_backend_forced_uri=None, + ldap_dryrun_mode=None): self.logger = self.get_logger("provision") if quiet: @@ -376,6 +396,14 @@ class cmd_domain_provision(Command): if eadb: self.logger.info("not using extended attributes to store ACLs and other metadata. If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.") + if ldap_backend_type == "existing": + if dap_backend_forced_uri is not None: + logger.warn("You have specified to use an existing LDAP server as the backend, please make sure an LDAP server is running at %s" % ldap_backend_forced_uri) + else: + logger.info("You have specified to use an existing LDAP server as the backend, please make sure an LDAP server is running at the default location") + else: + if ldap_backend_forced_uri is not None: + logger.warn("You have specified to use an fixed URI %s for connecting to your LDAP server backend. This is NOT RECOMMENDED, as our default communiation over ldapi:// is more secure and much less") session = system_session() try: @@ -393,9 +421,13 @@ class cmd_domain_provision(Command): users=users, serverrole=server_role, dom_for_fun_level=dom_for_fun_level, backend_type=ldap_backend_type, - ldapadminpass=ldapadminpass, ol_mmr_urls=ol_mmr_urls, + ldapadminpass=ldapadminpass, ol_mmr_urls=ol_mmr_urls, slapd_path=slapd_path, useeadb=eadb, next_rid=next_rid, lp=lp, use_ntvfs=use_ntvfs, - use_rfc2307=use_rfc2307, skip_sysvolacl=False) + use_rfc2307=use_rfc2307, skip_sysvolacl=False, + ldap_backend_extra_port=ldap_backend_extra_port, + ldap_backend_forced_uri=ldap_backend_forced_uri, + nosync=ldap_backend_nosync, ldap_dryrun_mode=ldap_dryrun_mode) + except ProvisioningError, e: raise CommandError("Provision failed", e) |