Univention Bugzilla – Full Text Bug Listing |
Summary: | Removing IP address from Computer leads to traceback | ||
---|---|---|---|
Product: | UCS | Reporter: | Dirk Wiesenthal <wiesenthal> |
Component: | UMC - Computers | Assignee: | Lukas Walter <walter> |
Status: | CLOSED FIXED | QA Contact: | Dirk Wiesenthal <wiesenthal> |
Severity: | normal | ||
Priority: | P5 | CC: | best, gohmann, jmm, klaeser |
Version: | UCS 3.2 | ||
Target Milestone: | UCS 3.2-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): | Error handling | |
Max CVSS v3 score: |
Description
Dirk Wiesenthal
2014-01-06 09:04:53 CET
Reported by UMC Traceback Reported again: Ticket #2014032321001653 This was a common traceback which could occur when adding/removing DHCP or DNS zone to computer objects without IP address. I've fixed the problem in all code paths concerning the treatment of DHCP and DNS zones during computer creation as well as computer modification. YAML: 2014-04-07-univention-directory-manager-modules.yaml *** Bug 34508 has been marked as a duplicate of this bug. *** The problem was: self.ip not set: Prior to 3.2-0: self['ip'][0] == '' Now: self['ip'][0] => IndexError So: self.__modify_dhcp_object( dn, self[ 'name' ], self[ 'ip' ][ 0 ], self[ 'mac' ][ 0 ] ) could be called when ip was set or not set and mac was set or not set. After the patch, you check if self['ip'] and self['mac'] before calling which is not semantically the same. self.__modify_dhcp_object( dn, self[ 'name' ], self[ 'ip' ][ 0 ], self[ 'mac' ][ 0 ] ) will not be called with an IP but without a MAC. => REOPENED For backward compatibility, it might be better to have something like first_mac = '' if self['mac']: first_mac = self['mac'][0] and work with first_mac from now on. I removed the commits, so that we can release UDM: r49400 + r49401 + r49405 Though I've found the same behaviour in other segments of the code, the patch has been modified and re-integrated afterwards. The new patch restores the old functionality as of times where [''] was the default value for empty attributes. It does so in the most simple, but also most line-intensive way aswell. Code changes: svn 49721 YAML: svn 49725 The new changes modify the post create and modify methods, because they had the same problem. Seems to work - for most cases. Code review revealed: Line 1927 ff: ip = '' if self['ip']: ip = self['ip'][0] self.__add_dns_forward_object( self[ 'name' ], dn, ip ) self.__add_related_ptrrecords(dn, self['ip'][0]) (same with __remove_dns_forward_object / __remove_related_ptrrecords) (In reply to Dirk Wiesenthal from comment #8) > Seems to work - for most cases. Code review revealed: > > Line 1927 ff: > > ip = '' > if self['ip']: > ip = self['ip'][0] > self.__add_dns_forward_object( self[ 'name' ], dn, ip ) > self.__add_related_ptrrecords(dn, self['ip'][0]) > > (same with __remove_dns_forward_object / __remove_related_ptrrecords) Fixed (svn 49956). I've also had a look for similar occurences, but found noone. New version in YAML: 9.0.75-32.1195.201405071555 Ported to ucs-3.2-2 as well. VERIFIED, code review and testing for traceback. I also searched for problems in the code, did not find anything obvious. In any case, not scope of this bug. YAML Ok *** Bug 34250 has been marked as a duplicate of this bug. *** |