Univention Bugzilla – Attachment 8293 Details for
Bug 41989
Moving user from school A to B does not move its home directory to backup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
41989.patch (text/plain), 1.57 KB, created by
Florian Best
on 2016-12-08 09:45:27 CET
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-12-08 09:45:27 CET
Size:
1.57 KB
patch
obsolete
>diff --git a/ucs-school-old-homedirs/remove-old-homedirs.py b/ucs-school-old-homedirs/remove-old-homedirs.py >index 31edd55..933e008 100755 >--- a/ucs-school-old-homedirs/remove-old-homedirs.py >+++ b/ucs-school-old-homedirs/remove-old-homedirs.py >@@ -29,7 +29,7 @@ > # /usr/share/common-licenses/AGPL-3; if not, see > # <http://www.gnu.org/licenses/>. > >-__package__ = '' # workaround for PEP 366 >+from __future__ import absolute_import > import listener > import os > import shutil >@@ -53,6 +53,7 @@ > target_dir = listener.configRegistry.get("ucsschool/listener/oldhomedir/targetdir") > fs_types = listener.configRegistry.get("ucsschool/listener/oldhomedir/fs_types", DEFAUL_FS).split(":") > lo = None >+local_ous = [] > > > def check_target_dir(dir): >@@ -141,16 +142,12 @@ def warn(msg): > ) > > >-def get_my_ous(): >- """find out which OUs this host is responsible for, returns list of strings""" >- return [s.name for s in School.get_all(lo)] >- >- > def prerun(): >- global lo >+ global lo, local_ous > listener.setuid(0) > try: > lo, po = getMachineConnection(ldap_master=False) >+ local_ous = [s.name for s in School.get_all(lo)] > except LDAPError as exc: > warn(str(exc)) > return >@@ -164,12 +161,11 @@ def postrun(): > > > def handler(dn, new, old, command): >- my_ous = set(get_my_ous()) >- users_ous = set(new.get("ucsschoolSchool", [])) >+ users_ous = set(new.get("ucsschoolSchool", local_ous)) > > if ( > old and not new and not command == "r" or >- old and new and command == "m" and my_ous.isdisjoint(users_ous) >+ old and new and command == "m" and local_ous.isdisjoint(users_ous) > ): > uid = old["uid"][0] >
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 41989
: 8293