Bug 840221

Summary: Need more explanation about the application blueprint's "return" element.
Product: [Retired] CloudForms Cloud Engine Reporter: Etsuji Nakai <enakai>
Component: Docs User GuideAssignee: Dan Macpherson <dmacpher>
Status: CLOSED CURRENTRELEASE QA Contact: Rehana <aeolus-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: dajohnso, lbrindle
Target Milestone: beta6   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-10 21:54:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Etsuji Nakai 2012-07-14 12:34:47 UTC
In Appendix B of the Cloud Engine User Guide(Revision 0-53), the description of the "return" element in application blueprint XML is very unclear.

---
B.15. return
The return element is a single parameter value that an application service provides. Other assemblies utilize these return parameters for use in their own executable scripts. 
---

I couldn't see what parameters can be actually used. So, I looked into the codes and found that it internally uses Ruby's facter module. So the element such as <return name="hostname"/> provides what you can see in the following command (supposing that you installed the facter RPM package.)

# facter hostname

This should be exlained in the user guide.

And if my understanding is correct, the following description in "Procedure 7.3. Editing an Application Blueprint" is incorrect because facter doesn't have a parameter like "hostname-1", and it's not a return value of the executable script.

---
Define the return values (returns) for the service's executable script.

<deployable name="Application">
  <description>An example application</description>
  <assemblies>
    <assembly name="instance-1" hwp="hwp1">
      <image id="beedb0f9-ca05-46a1-bcbb-704887752d8e"/>
      <services>
        ...
      </services>
      <returns>
        <return name="hostname-1"/>
      </returns>
    </assembly>
    ...
  </assemblies>
</deployable>

This example contains a single return value called hostname-1. The application blueprint uses return value for other service parameters in other instances. 
---

Comment 2 Dan Macpherson 2012-09-09 18:02:20 UTC
(In reply to comment #0)
> In Appendix B of the Cloud Engine User Guide(Revision 0-53), the description
> of the "return" element in application blueprint XML is very unclear.
> 
> ---
> B.15. return
> The return element is a single parameter value that an application service
> provides. Other assemblies utilize these return parameters for use in their
> own executable scripts. 
> ---
> 
> I couldn't see what parameters can be actually used. So, I looked into the
> codes and found that it internally uses Ruby's facter module. 

Added the following paragraph to <return> element section:

The return element uses variables from the Facter Ruby library. For more information, read the full specification of Facter variables on the Facter Documentation website [1].

[1] Facter Documentation - http://docs.puppetlabs.com/facter/


> 
> And if my understanding is correct, the following description in "Procedure
> 7.3. Editing an Application Blueprint" is incorrect because facter doesn't
> have a parameter like "hostname-1", and it's not a return value of the
> executable script.
> 
> ---
> Define the return values (returns) for the service's executable script.
> 
> <deployable name="Application">
>   <description>An example application</description>
>   <assemblies>
>     <assembly name="instance-1" hwp="hwp1">
>       <image id="beedb0f9-ca05-46a1-bcbb-704887752d8e"/>
>       <services>
>         ...
>       </services>
>       <returns>
>         <return name="hostname-1"/>
>       </returns>
>     </assembly>
>     ...
>   </assemblies>
> </deployable>
> 
> This example contains a single return value called hostname-1. The
> application blueprint uses return value for other service parameters in
> other instances. 
> ---

Corrected Application Blueprint section to use the correct "hostname" variable from Facter.

Comment 4 Lana Brindley 2012-11-19 02:45:38 UTC
This documentation has now been dropped to translation ahead of publication. For any further issues, please open a new a bug.

LKB

Comment 5 Lana Brindley 2012-12-10 21:54:02 UTC
This document is now publicly available on access.redhat.com. For any further issues, please raise a new bug.

LKB