Bug 14199 - ConfigRegistry sollte __contains__ Methode implementieren
ConfigRegistry sollte __contains__ Methode implementieren
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 2.2
All All
: P5 normal (vote)
: UCS 2.3
Assigned To: Daniel Hofmann
Felix Botner
:
: 15519 (view as bug list)
Depends on:
Blocks: 14432
  Show dependency treegraph
 
Reported: 2009-04-16 13:51 CEST by Arvid Requate
Modified: 2009-12-21 08:49 CET (History)
3 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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2009-04-16 13:51:10 CEST
Die ConfigRegistry verhält sich nicht wie ein 'normales' Python Dictionary, da die Funktion __contains__ nicht implementiert ist. Statt dessen wird anscheinend eine gleichnamige Methode ererbt, die aber immer (?) False zurückliefert.

  >> ucr= univention.config_registry.ConfigRegistry()
  >> ucr.load()
  >> 'ldap/base' in ucr
  False

Da statt der Methode has_key inzwischen empfohlen wird 'key in dict' zu verwenden, was dann __contains__ verwendet, ist das unpraktisch.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2009-08-27 13:49:31 CEST
*** Bug 15519 has been marked as a duplicate of this bug. ***
Comment 2 Daniel Hofmann univentionstaff 2009-08-28 14:03:27 CEST
Gefixt in univention-config-registry r11769.
Methode hinzugefügt.
Comment 3 Daniel Hofmann univentionstaff 2009-08-28 14:28:10 CEST
In r11770 sinnvollere Implementierung für __iter__ hinzugefügt.
Changelogeintrag erstellt.
Comment 4 Felix Botner univentionstaff 2009-10-19 11:14:25 CEST
Funktioniert:

>cr= univention.config_registry.ConfigRegistry()
>cr.load()

> "ldap/base" in cr
True

> "ldap/basis" in cr
False
Comment 5 Stefan Gohmann univentionstaff 2009-12-21 08:49:41 CET
UCS 2.3 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer neueren Version von UCS erneut auftreten, so sollte der Bug dupliziert werden: "Clone This Bug".