Bug 33256 - Changing empty DNS TTL on Host record
Changing empty DNS TTL on Host record
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - DNS
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 4.0-0-errata
Assigned To: Drees Dormann
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-11 16:32 CET by Florian Best
Modified: 2015-01-29 11:45 CET (History)
2 users (show)

See Also:
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, External feedback
Max CVSS v3 score:
best: Patch_Available+


Attachments
Patch for conversion handling (943 bytes, patch)
2015-01-19 10:00 CET, Drees Dormann
Details | Diff
newer version of patch (3.22 KB, patch)
2015-01-19 13:11 CET, Drees Dormann
Details | Diff
Newest version of patch (1.48 KB, patch)
2015-01-21 16:57 CET, Drees Dormann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2013-11-11 16:32:08 CET
When adding TTL (time to live) to an DNS Host record with empty TTL the following error occurs:

umc-command udm/put -e -o '[{"object":{"zonettl": "3000","seconds"],"$dn$":"relativeDomainName=foo2,zoneName=product.tests,cn=dns,dc=product,dc=tests"},"options":null}]' -f "dns/dns"
→
  File "/usr/lib/pymodules/python2.6/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.6/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 339, in _thread
    module.modify( properties )
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 155, in wrapper_func
    ret = func( *args, **kwargs )
  File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 410, in modify
    obj.modify()
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 344, in modify
    return self._modify(modify_childs,ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 871, in _modify
    self._ldap_post_modify()
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/dns/host_record.py", line 218, in _ldap_post_modify
    if self.hasChanged(self.descriptions.keys()):
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 160, in hasChanged
    if self.hasChanged(i):
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 157, in hasChanged
    return not univention.admin.mapping.mapCmp(self.mapping, key, self.oldinfo.get(key, ''), self.info.get(key, ''))
  File "/usr/lib/pymodules/python2.6/univention/admin/mapping.py", line 193, in mapCmp
    return map[1](old) == map[1](new)
  File "/usr/lib/pymodules/python2.6/univention/admin/mapping.py", line 100, in mapUNIX_TimeInterval
    value = int( value )

ValueError: invalid literal for int() with base 10: ''
Comment 1 Florian Best univentionstaff 2013-11-11 16:34:40 CET
similar to Bug #8429

*** This bug has been marked as a duplicate of bug 8429 ***
Comment 2 Florian Best univentionstaff 2015-01-09 14:58:00 CET
This was reported 3 times (on Bug #8429).

I'll split the duplication as 2 code branches have to be adapted.
The patch is in attachment 5415 [details].
Comment 3 Drees Dormann univentionstaff 2015-01-19 10:00:44 CET
Created attachment 6608 [details]
Patch for conversion handling

 this patch is similar to the patch for bug 8429
Comment 4 Florian Best univentionstaff 2015-01-19 10:03:40 CET
(In reply to Drees Dormann from comment #3)
> Created attachment 6608 [details]
> Patch for conversion handling
> 
>  this patch is similar to the patch for bug 8429
FYI: int(None) will raise TypeError not ValueError, please catch this, too.
You can also use return directly without using 'result' as variable.
Comment 5 Drees Dormann univentionstaff 2015-01-19 13:11:22 CET
Created attachment 6609 [details]
newer version of patch

This is a newer version of the already posted patch , also kontaining a solution for bug8429
Comment 6 Drees Dormann univentionstaff 2015-01-21 16:57:35 CET
Created attachment 6620 [details]
Newest version of patch
Comment 7 Drees Dormann univentionstaff 2015-01-22 15:10:09 CET
patch has been applied
Comment 8 Florian Best univentionstaff 2015-01-26 11:23:58 CET
OK: when removing the ldap attribute dNSTTL from an object and adding it in UMC the traceback does not occur anymore.
Comment 9 Janek Walkenhorst univentionstaff 2015-01-29 11:45:25 CET
<http://errata.univention.de/ucs/4.0/65.html>