Univention Bugzilla – Full Text Bug Listing |
Summary: | univention.admin.syntax import depends on previous import | ||
---|---|---|---|
Product: | UCS | Reporter: | Florian Best <best> |
Component: | UDM (Generic) | Assignee: | Florian Best <best> |
Status: | CLOSED FIXED | QA Contact: | Felix Botner <botner> |
Severity: | normal | ||
Priority: | P5 | CC: | best, geerds, gohmann, troeder, walkenhorst |
Version: | UCS 3.2 | Flags: | best:
Patch_Available+
|
Target Milestone: | UCS 4.1-1-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
What kind of report is it?: | --- | What type of bug is this?: | --- |
Who will be affected by this bug?: | --- | How will those affected feel about the bug?: | --- |
User Pain: | Enterprise Customer affected?: | ||
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | Bug group (optional): | ||
Max CVSS v3 score: | |||
Bug Depends on: | |||
Bug Blocks: | 41164 | ||
Attachments: | patch |
Description
Florian Best
2013-11-13 15:40:39 CET
*** Bug 28179 has been marked as a duplicate of this bug. *** If I had any free votes I would vote for this! The fix is a one liner: Index: univention-directory-manager-modules/modules/univention/admin/__init__.py =================================================================== --- univention-directory-manager-modules/modules/univention/admin/__init__.py (Revision 47702) +++ univention-directory-manager-modules/modules/univention/admin/__init__.py (Arbeitskopie) @@ -31,7 +31,7 @@ # <http://www.gnu.org/licenses/>. import copy, types, string, re -import mapping +from univention.admin import mapping import univention.config_registry import univention.debug I would also like to see a cleanup of the existing import statements… FYI: http://www.python.org/dev/peps/pep-0328/ (In reply to Florian Best from comment #2) > The fix is a one liner: Sorry, this was wrong. lo = getMachineConnection() dn = lo.search(filter="(uid={})".format(username))[0][0] config = univention.admin.config.config() univention.admin.modules.update() usersmod = univention.admin.modules.get("users/user") lo, position = univention.admin.uldap.getAdminConnection() univention.admin.modules.init(lo, position, usersmod) dn_part = dn.partition(",") user = usersmod.lookup(config, lo, dn_part[0], base=dn_part[-1])[0] user.open() user["password"] = password user.modify() File "/usr/lib/pymodules/python2.7/univention/management/console/modules/passwordreset/__init__.py", line 302, in set_password user.modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 1564, in modify return super(object, self).modify(*args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 364, in modify return self._modify(modify_childs,ignore_license=ignore_license) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 839, in _modify ml=self._ldap_modlist() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 2060, in _ldap_modlist pwhistoryPolicy = self.loadPolicyObject('policies/pwhistory') File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1102, in loadPolicyObject self.policyObjects[policy_type]=univention.admin.objects.get(policy_module, None, self.lo, policy_position) AttributeError: 'module' object has no attribute 'objects' Does not happen, if "import univention.admin.objects" is before that. Created attachment 7598 [details]
patch
This patch is working :)
Fixed in: Package: univention-directory-manager-modules Version: 11.0.2-26.1381.201604191507 univention-directory-manager-modules (11.0.2-26): r68791 | Bug #33359: importing univention.admin modules doesn't depend on previous imports anymore univention-directory-manager-modules.yaml: r68792 | YAML Bug #33359 OK - univention-directory-manager-modules OK - ucs-test-udm* OK - import univention.admin.syntax as udm_syntax OK - univention-directory-manager-modules.yaml |