Description of problem: When defining a default value for a user-provided variable within a bundle's deploy.xml, the default value is not used or appears to be ignored. This results in the deployment of the bundle failing unless a value was explicitly specified by the user when deploying the bundle. Version-Release number of selected component (if applicable): JON 2.4 How reproducible: Always Steps to Reproduce: 1. Add a new bundle that defines a rhq:input-property with a defaultValue. <?xml version="1.0"?> <project name="calculator-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle"> <rhq:bundle name="Example Calculator App" version="1.0" description="an example bundle of the Calculator EAR"> <rhq:input-property name="a.user.value" description="A user specified value to demonstrate the default value is not used" required="true" defaultValue="a default value" type="string"/> <rhq:deployment-unit name="calculator-ear" preinstallTarget="preinstall" postinstallTarget="postinstall"> <rhq:archive name="ear-calculator.ear"/> </rhq:deployment-unit> </rhq:bundle> <target name="main" /> <target name="preinstall"> <echo>Deploying bundle ${rhq.deploy.name} to ${rhq.deploy.dir}...</echo> <property name="preinstallTargetExecuted" value="true"/> </target> <target name="postinstall"> <echo>Done deploying bundle ${rhq.deploy.name} to ${rhq.deploy.dir}</echo> <property name="postinstallTargetExecuted" value="true"/> </target> </project> 2. Once the bundle has been added, deploy it to a group 3. When prompted for a value for a.user.value, leave it blank Actual results: The deployment of the bundle fails with no evident reason/error Expected results: The deployment of the bundle should be successful Additional info: I would also expect that the default value would pre-populate the field in the UI.
git commits: 2c87326ad0fa9449ef0e351e0f241d36ec4566da 0e90bc94eb626e05b55fd5f2f1a2eeaac7e25c4e This bug actually shows up in both ant and filetemplate bundle types (the bug description only mentions the ant input-property, but there was no way to set a default value in file template recipes, these commits fix that also). This was a larger fix that anticipated. It turns out we were never persisting any default template with the config def object. The fix includes this now. The fix was in the core bundle subsystem, so it is supported for any bundle type (ant or file template recipes for now). If you have any required properties OR properties that define a default value, the configuration definition will get assigned a default template. If a required property does not set a default in the recipe, null will be used.
Verified on build#1090 (Version: 4.0.0-SNAPSHOT Build Number: f19c23e) Uploaded the bundle that defines a rhq:input-property with defaultValue. While deploying the bundle to a group, observed that on prompting value (for a.user.value), it displayed the default value ("a default value" as defined in recipe). Please refer the attached screenshot. The bundle got deployed successfully. Marking the bug as verified.
Created attachment 484112 [details] Screenshot
Bookkeeping - closing bug - fixed in recent release.