Bug 790322
Summary: | RFE: Replacement of tokens with tag values during content bundle provisioning | ||||||
---|---|---|---|---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Torben Jaeger <torben> | ||||
Component: | Provisioning | Assignee: | John Mazzitelli <mazz> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||
Severity: | low | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 4.3 | CC: | hrupp, torben | ||||
Target Milestone: | --- | ||||||
Target Release: | RHQ 4.3.0 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
URL: | https://github.com/jicken/rhq/commit/dd763209538bc93cfd45735842e26f450f09e6fd | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2013-09-01 10:08:43 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Torben Jaeger
2012-02-14 09:08:56 UTC
note: the tag format supported by RHQ is: [namespace:][semantic=]name notice the semantic is also optional. With the attached patch, I believe this means the literal string "null" will be used in the name of the replacement token if there is no semantic in your tag. examples: for tag of "foo:bar": @@rhq.tag.foo.null@@ will be replaced with "bar" for tag of "abc": @@rhq.tag.null@@ will be replaced with "abc" After thinking about this, I do not think this is the proper behavior, at least in that second case where neither namespace nor semantic is specified, because if you have more than one tag that omits namespace and semantic specifiers, you won't be able to determine which one to replace the @@ token with. So if I have "foo" and "bar" as two tags on my resource, what does @@rhq.tag.null@@ get replaced with? Its indeterminant. So, I think, at least in the case where only name is in the tag, we don't populate that in the ant properties. We could put them perhaps in a comma-separated list on @@rhq.tags.null@@ but I would suggest we just don't do anything for this yet, ignore name-only tags and wait for a use-case to crop up before we do anything with those. As for the first case, its probably safe to do the same thing - ignore them. For example: foo:bar foo:abc What does @@rhq.tag.foo.null@@ get replaced with? Again, its indeterminate. bar and abc are in the same namespace, but have no semantic to qualify them. Thus, in both cases, I will ignore tags if semantic is not specified. the attached patch isn't all that is needed - the unit tests in the ant-bundle plugin are failing. nothing major, we just have to make sure we create a mock resource object to avoid NPEs in the tests. I have also tested replacing tag replacement tokens and I tested the cases where semantic is null (namespace:name or name-only tags). All enterprise/jar, common/ant and plugins/ant-bundle unit tests pass on my box. I'll commit this shortly. git commit master - c2c2f68 tweeked some things and added unit tests. Thanks for the patch torben! To Test: 1) Import a platform resource 2) Add a tag to it - provide a semantic in the tag. For example, tag names such as the following will work: it:group=qa organization=HR 3) Create an ant bundle that has a file with replacement tokens. To match the example above, such replacement tokens could be: @@rhq.tag.it.group@@ @@rhq.tag.organization@@ 4) Deploy the bundle to the platform resource that is tagged 5) After the bundle is deployed, confirm file has been realized with the appropriate tag names (to follow the examples above, @@rhq.tag.it.group@@ should have been replaced with the string "qa" and @@rhq.tag.organization@@ should have been replaced with "HR". Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since. |