Bug 24210 - univention-dnsedit - mehrmaliges Anlegen eines gleichartige host record führt zu Traceback
univention-dnsedit - mehrmaliges Anlegen eines gleichartige host record führt...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: DNS
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 3.0 - RC
Assigned To: Stefan Gohmann
Felix Botner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-26 14:12 CEST by Felix Botner
Modified: 2011-12-13 15:49 CET (History)
1 user (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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2011-10-26 14:12:09 CEST
Der zweite Join eine UCS 3.0 Backup ist in 05univention-bind.ins abgebrochen

Configure 05univention-bind.inst
wait for named ?
wait for named ?
Adding A record "backup 10.200.7.145" to zone zzz.iii...
Traceback (most recent call last):
  File "/usr/share/univention-admin-tools/univention-dnsedit", line 388, in <module>
    add_a_record(nargs)
  File "/usr/share/univention-admin-tools/univention-dnsedit", line 299, in add_a_record
    record.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 862, in _modify
    self.lo.modify(self.dn, ml, ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.6/univention/admin/uldap.py", line 385, in modify
    raise univention.admin.uexceptions.ldapError, _err2str(msg)
univention.admin.uexceptions.ldapError: Type or value exists: modify/add: aRecord: value #1 already exists

Der Fehler wurde durch "univention-dnsedit" (add_a_record) ausgelöst. Hier wird  nach einem vorhandenen Host Record mit gleichem Namen gesucht. 

        filter=univention.admin.filter.expression('name', name)
        records=univention.admin.handlers.dns.host_record.lookup(co, lo, filter, scope='domain', base=position.getDomain(), superordinate=zone, unique=1)
        if records:
                record=records[0]
        else:
                record=univention.admin.handlers.dns.host_record.object(co, lo, position, superordinate=zone)
                record['name']=name
                record['zonettl']='80600'

        t=record['a']

record['a'] war aber in meinen Tests immer eine leere Liste, wodurch er später einen falschen a Record gesetzt hat. Wenn ich an der entsprechenden Stelle "record.open()" hinzufüge, klappt es.
Comment 1 Stefan Gohmann univentionstaff 2011-10-26 14:26:56 CEST
fixed, kein changelog notwendig.

Die open Funktion wurde mit der IPv6 Unterstützung hinzugefügt, vorher war ein open nicht zwingend notwendig.
Comment 2 Felix Botner univentionstaff 2011-11-07 17:57:03 CET
OK, funktioniert

-> /usr/share/univention-admin-tools/univention-dnsedit --ignore-exists iii.zzz add a master 10.200.7.144
Adding A record "master 10.200.7.144" to zone iii.zzz... done
-> /usr/share/univention-admin-tools/univention-dnsedit --ignore-exists iii.zzz add a master 10.200.7.144
Adding A record "master 10.200.7.144" to zone iii.zzz... done
-> /usr/share/univention-admin-tools/univention-dnsedit --ignore-exists iii.zzz add a master 10.200.7.144
Adding A record "master 10.200.7.144" to zone iii.zzz... done

-> univention-ldapsearch -LLL '(&(arecord=10.200.7.144)(objectClass=dNSZone))'
dn: relativeDomainName=master,zoneName=iii.zzz,cn=dns,dc=iii,dc=zzz
aRecord: 10.200.7.144
objectClass: top
objectClass: dNSZone
objectClass: univentionObject
univentionObjectType: dns/host_record
dNSTTL: 80600
relativeDomainName: master
zoneName: iii.zzz
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2011-12-13 15:49:20 CET
UCS 3.0-0 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte dieser Bug dupliziert
werden: "Clone This Bug"