Univention Bugzilla – Full Text Bug Listing |
Summary: | [Syntax] TrueFalse allows any value on CLI | ||
---|---|---|---|
Product: | UCS | Reporter: | Lukas Walter <walter> |
Component: | UDM (Generic) | Assignee: | UMC maintainers <umc-maintainers> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P5 | CC: | best, galkin, gohmann, klaeser |
Version: | UNSTABLE | ||
Target Milestone: | UCS 3.x | ||
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: |
Description
Lukas Walter
2013-08-22 13:59:16 CEST
> This might be a general problem of the IState syntax TrueFalse, which just
^^^^^^^^^
ignore this
As you said, it seems that the parse method accepts any value... has this been done intentionally this way? ==================== class IStates( select ): values = [] @ClassProperty def choices( cls ): return map( lambda x: ( x[ 1 ] ), cls.values ) @classmethod def parse( cls, text ): if isinstance( text, basestring ): return text for value, choice in cls.values: if text == value: return choice[ 0 ] return text class TrueFalse( IStates ): values = ( ( None, ( '', '' ) ), ( True, ( 'true', _('True') ) ), ( False, ( 'false', _('False')) ) ) ==================== I could find the following occurrences:
> handlers/policies/release.py: syntax=univention.admin.syntax.TrueFalseUp,
> handlers/policies/pwhistory.py: syntax=univention.admin.syntax.TrueFalseUp,
> handlers/policies/dhcp_dnsupdate.py: syntax=univention.admin.syntax.ddnsUpdates,
> handlers/policies/dhcp_dnsupdate.py: syntax=univention.admin.syntax.TrueFalse,
> handlers/policies/dhcp_dnsupdate.py: syntax=univention.admin.syntax.TrueFalse,
> handlers/policies/dhcp_dnsupdate.py: syntax=univention.admin.syntax.AllowDeny,
> handlers/policies/dhcp_scope.py: syntax=univention.admin.syntax.AllowDenyIgnore,
> handlers/policies/dhcp_scope.py: syntax=univention.admin.syntax.AllowDenyIgnore,
> handlers/policies/dhcp_scope.py: syntax=univention.admin.syntax.AllowDenyIgnore,
> handlers/policies/dhcp_scope.py: syntax=univention.admin.syntax.AllowDeny,
> handlers/policies/dhcp_scope.py: syntax=univention.admin.syntax.AllowDenyIgnore,
> handlers/policies/dhcp_statements.py: syntax=univention.admin.syntax.booleanNone,
> handlers/policies/dhcp_statements.py: syntax=univention.admin.syntax.TrueFalse,
> handlers/policies/dhcp_statements.py: syntax=univention.admin.syntax.TrueFalse,
> handlers/policies/dhcp_statements.py: syntax=univention.admin.syntax.TrueFalse,
> handlers/settings/syntax.py: syntax = univention.admin.syntax.TrueFalseUp,
> handlers/settings/syntax.py: syntax=univention.admin.syntax.TrueFalseUp,
> handlers/dhcp/pool.py: syntax=univention.admin.syntax.AllowDeny,
> handlers/dhcp/pool.py: syntax=univention.admin.syntax.AllowDeny,
> handlers/dhcp/pool.py: syntax=univention.admin.syntax.AllowDeny,
> handlers/dhcp/pool.py: syntax=univention.admin.syntax.AllowDeny,
Revision 26262 introduced syntax IState and converted several syntax classes to IState (they used to be childs of syntax class select): > * all boolean syntax classes provide a mapping between the string > representation and the boolean value; Bug #23222 If I see it correctly, any string is accepted in the parse method, this should be wrong (and differs from the behaviour of the previously used select class): > def parse( cls, text ): > if isinstance( text, basestring ): > return text *** Bug 35023 has been marked as a duplicate of this bug. *** |