Univention Bugzilla – Attachment 9376 Details for
Bug 45842
Simplify user options (posix, samba, kerberos)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
create_all_users.py
create_all_users.py (text/x-python), 2.00 KB, created by
Florian Best
on 2018-01-31 16:22:47 CET
(
hide
)
Description:
create_all_users.py
Filename:
MIME Type:
Creator:
Florian Best
Created:
2018-01-31 16:22:47 CET
Size:
2.00 KB
patch
obsolete
>#!/usr/bin/python >import itertools >import subprocess >import pipes >options = ['posix', 'samba', 'kerberos', 'mail', 'pki', 'person', 'ldap_pwd'] > >length = range(1, 1 + len(options)) >combinations = tuple(itertools.chain(*(itertools.combinations(options, i) for i in length))) >#print length, len(combinations) >#print '\n'.join([', '.join(x) for x in sorted(combinations)]) >subprocess.call("sed -i 's/raise univention.admin.uexceptions.primaryGroupWithoutSamba/pass # univention.admin.uexceptions.primaryGroupWithoutSamba/' /usr/share/pyshared/univention/admin/handlers/users/user.py", shell=True) >subprocess.call("pkill -f cli-server", shell=True) > >for disabled in ('all', 'windows', 'kerberos', 'posix', 'windows_posix', 'windows_kerberos', 'posix_kerberos', 'none'): > for locked in ('all', 'windows', 'posix', 'none'): > for options in combinations: > cmd = ['udm', 'users/user', 'create', '--ignore_exists'] > for i in options: > cmd.extend(['--option', i]) > cmd.extend(['--set', 'locked=%s' % (locked,)]) > cmd.extend(['--set', 'disabled=%s' % (disabled,)]) > cmd.extend(['--set', 'username=x.%s.locked.%s.disabled.%s' % ('.'.join(sorted(options)), locked, disabled)]) > cmd.extend(['--set', 'lastname=%s' % ('.'.join(sorted(options)))]) > if 'posix' in options or 'samba' in options or 'kerberos' in options or 'ldap_pwd' in options: > cmd.extend(['--set', 'password=univention']) > if 'samba' in options and 'posix' not in options: > cmd.extend(['--set', 'primaryGroup=cn=Domain Users,cn=groups,dc=school,dc=local']) > if 'posix' not in options and 'samba' not in options and 'person' not in options and 'ldap_pwd' not in options: > continue > > print '#', ' '.join(pipes.quote(x) for x in cmd) > if subprocess.call(cmd): > print 'FAILED !!!' > >subprocess.call("sed -i 's/pass # univention.admin.uexceptions.primaryGroupWithoutSamba/raise univention.admin.uexceptions.primaryGroupWithoutSamba/' /usr/share/pyshared/univention/admin/handlers/users/user.py", shell=True) >subprocess.call("pkill -f cli-server", shell=True)
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 Raw
Actions:
View
Attachments on
bug 45842
:
9314
|
9320
|
9322
|
9323
| 9376 |
9397
|
9425