Bug 32654 - API: extend @%@ syntax to include default value and/or True/False handling
Summary: API: extend @%@ syntax to include default value and/or True/False handling
Status: RESOLVED WONTFIX
Alias: None
Product: UCS
Classification: Unclassified
Component: UCR
Version: UCS 4.4
Hardware: Other Linux
: P5 enhancement
Target Milestone: UCS 3.x
Assignee: UCS maintainers
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-20 11:44 CEST by Philipp Hahn
Modified: 2025-02-05 09:29 CET (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
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):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2013-09-20 11:44:30 CEST
May template files use the easier @%@ UCR syntax to reference a UCR variable, which often breaks the syntax when the variable is unset.

Because of that the Python-variant using @!@ is used in many cases, because there unset variables can be handled better. This is a lot more complicated, error prone and also requires a fork of a Python process for each @!@ block (see bug #29484).

@%@ should be extended to allow some more output handling, e.g.
  @%@foo?bar@%@
    Print content of UCRV $foo or fallback to string literal 'bar'.
  @%@foo?n?True=y@%@
  @%@foo?n?False=y@%@
    Use is_true() and is_false() and either print 'y' or 'n'.

'?' and '=' are good candidates, since UCRV names can't contains those two characters.
Together with UCRV types (Bug #8768) this could be even improved further for list handling.
Comment 1 Florian Best univentionstaff 2016-09-08 14:46:10 CEST
Bug #19768 and Bug #31606 would benefit from this.
Comment 2 Philipp Hahn univentionstaff 2017-01-11 12:21:45 CET
See Bug #38938 for an alternative for default handling
Comment 3 Jan-Luca Kiok univentionstaff 2025-02-05 09:29:13 CET
This issue has been filed against an older version of UCS.

With further development of our products affected components may have vastly changed while the corresponding use cases might have changed. Thus, this issue is now being closed.

If there still is a need for this feature, please use "Clone this bug" or reopen this issue. In this case please provide information on how this issue would benefit you.