Expand attribute expansion capabilities
Right now, the only place where we allow for attribute expansion is in the FE expressions.
This functionality would instead be useful everywhere else.
Including nested/recursive (but no loops) expansion.
#2 Updated by Igor Sfiligoi over 5 years ago
Looking into the details of $$ expansion, I see it honors the attribute type.
Which means, strings get quoted during expansion.
This makes is useless for generic expansion;
e.g. could not be used to propagate the host name in the factory config.
Moreover, it is also hard to imagine doing recursive expansions this way.We need a way to get "plain expansion" semantics.
I see three possible ways:
- just change the $$ semantics, and break backwards compatibility
- having different semantics depending where it is used, so current use cases are covered in backwards-compatible way
- use a different symbol for plain expansion, and keep $$ semantics as is (just extended to all strings)
I don't really like any of the above solutions, so if you can come up with a better idea, please let me know ASAP.
#3 Updated by Igor Sfiligoi over 5 years ago
Looking at the XML files I have access to, I see that single $ is only used in
I think we can deal with this backward incompatibility.
So I am proposing to use single $() expansion for straight replacement, and keep $$() for quoted replacement.
We also define $(DOLLAR) as being expanded to $.
If anyone objects to this plan, please let me know ASAP.
#4 Updated by Igor Sfiligoi over 5 years ago
Looking in more details, it looks like this is going to be harder than I thought, unless we make some semantic changes.
The main problem is that we may have entry/group attributes influence the global values.
Since we write (a subset of) the global values to disk, and reuse them for all the entries/groups,
we would need to do the expansion at runtime.
Which would include both the python processes AND in the glideins.
And in the glideins we actually currently lacking some of the info, too.
I don't think that is really reasonable, so I am proposing to "promote" any global value that needs expansion into the entry/group level.
This way I can do the expansion at (re)config time.
This may slightly increase the disc space used, but I think the benefits way outweigh the drawbacks.
Let me know if you disagree with this plan.
#6 Updated by Igor Sfiligoi over 5 years ago
- Status changed from Assigned to Feedback
- Assignee changed from Igor Sfiligoi to Parag Mhashilkar
- Priority changed from High to Normal
- Target version changed from v3_x to v3_2_x
The proposed semantics was implemented both for factory and frontend.
I have committed the code in
PS: I am selectively promoting only attributes than need expansion.
As mentioned on the phone call, we can extend that in a separate ticket.