Univention Bugzilla – Attachment 5976 Details for
Bug 35208
add ldap server option to univention-policy-update-config-registry.py
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
add-ldap-server-option.patch
add-ldap-server-option.patch (text/plain), 1.63 KB, created by
Felix Botner
on 2014-06-27 12:46:17 CEST
(
hide
)
Description:
add-ldap-server-option.patch
Filename:
MIME Type:
Creator:
Felix Botner
Created:
2014-06-27 12:46:17 CEST
Size:
1.63 KB
patch
obsolete
>Index: univention-directory-policy/univention-policy-update-config-registry.py >=================================================================== >--- univention-directory-policy/univention-policy-update-config-registry.py (Revision 51240) >+++ univention-directory-policy/univention-policy-update-config-registry.py (Arbeitskopie) >@@ -35,17 +35,19 @@ > import univention.config_registry as confreg > from optparse import OptionParser > >-def get_policy(host_dn, verbose=False): >+def get_policy(host_dn, verbose=False, server=None): > """Retriev policy for host_dn.""" > set_list = {} > > # get policy result > if verbose: > print >> sys.stderr, 'Retrieving policy for %s...' % (host_dn,) >- cmd = ('univention_policy_result', >- '-D', host_dn, >- '-y', '/etc/machine.secret', >- host_dn) >+ cmd = ['univention_policy_result'] >+ cmd += ['-D', host_dn] >+ cmd += ['-y', '/etc/machine.secret'] >+ if server: >+ cmd += ['-h', server] >+ cmd += [host_dn] > proc = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE) > for line in proc.stdout: > line = line.rstrip('\n') >@@ -81,6 +83,7 @@ > parser.add_option('-v', '--verbose', > dest='verbose', action='store_true', > help='print verbose information') >+ parser.add_option('-l', '--ldap-server', dest='server', help='connect to this ldap host') > options, args = parser.parse_args() > > if 'UNIVENTION_BASECONF' in os.environ: >@@ -110,7 +113,7 @@ > ucr_ldap = confreg.ConfigRegistry(filename=confregfn) > ucr_ldap.load() > >- set_list = get_policy(host_dn, options.verbose) >+ set_list = get_policy(host_dn, options.verbose, options.server) > if set_list: > new_set_list = [] > for key, value in set_list.items():
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35208
: 5976