<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>+1. This sounds good. The lack of any conditionals at all has caused a lot of pain.<br>
<br>
Thanks,<br>
Kevin <strong>
<div><font face="Tahoma" color="#000000" size="2"> </font></div>
</strong>
<hr tabindex="-1">
<font face="Tahoma" size="2"><b>From:</b> Huangtianhua<br>
<b>Sent:</b> Thursday, March 31, 2016 5:25:29 AM<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> [openstack-dev] 答复: [Heat] Re-evaluate conditions specification<br>
</font><br>
<div></div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">The conditions function has been requested for a long time, and there have been several previous discussions, which all ended up in debating the implementation, and no result.<br>
<a href="https://review.openstack.org/#/c/84468/3/doc/source/template_guide/hot_spec.rst">https://review.openstack.org/#/c/84468/3/doc/source/template_guide/hot_spec.rst</a><br>
<a href="https://review.openstack.org/#/c/153771/1/specs/kilo/resource-enabled-meta-property.rst">https://review.openstack.org/#/c/153771/1/specs/kilo/resource-enabled-meta-property.rst</a><br>
<br>
I think we should focus on the simplest possible way(same as AWS) to meet the user requirement, and follows the AWS, there is no doubt that we will get a very good compatibility.<br>
And the patches are good in-progress. I don't want everything back to zero:)<br>
<a href="https://review.openstack.org/#/q/status:open+project:openstack/heat+branch:master+topic:bp/support-conditions-function">https://review.openstack.org/#/q/status:open+project:openstack/heat+branch:master+topic:bp/support-conditions-function</a><br>
<br>
In the example you given of 'variables', seems there's no relation with resource/output/property conditions, it seems as another function which likes really 'variables' to used in template.<br>
<br>
-----邮件原件-----<br>
发件人: Thomas Herve [<a href="mailto:therve@redhat.com">mailto:therve@redhat.com</a>]
<br>
发送时间: 2016年3月31日 19:55<br>
收件人: OpenStack Development Mailing List (not for usage questions)<br>
主题: Re: [openstack-dev] [Heat] Re-evaluate conditions specification<br>
<br>
On Thu, Mar 31, 2016 at 10:40 AM, Thomas Herve <therve@redhat.com> wrote:<br>
> Hi all,<br>
><br>
> As the patches for conditions support are incoming, I've found <br>
> something in the code (and the spec) I'm not really happy with. We're <br>
> creating a new top-level section in the template called "conditions"<br>
> which holds names that can be reused for conditionally creating <br>
> resource.<br>
><br>
> While it's fine and maps to what AWS does, I think it's a bit <br>
> short-sighted and limited. What I have suggested in the past is to <br>
> have a "variables" (or whatever you want to call it) section, where <br>
> one can declare names and values. Then we can add an intrinsic <br>
> function to retrieve data from there, and use that for examples for <br>
> conditions.<br>
<br>
I was asked to give examples, here's at least one that can illustrate what I meant:<br>
<br>
parameters:<br>
   host:<br>
      type: string<br>
   port:<br>
      type: string<br>
<br>
variables:<br>
   endpoint:<br>
      str_replace:<br>
        template:<br>
           <a href="http://HOST:PORT/">http://HOST:PORT/</a><br>
        params:<br>
           HOST: {get_param: host}<br>
           PORT: {get_param: port}<br>
<br>
resources:<br>
   config1:<br>
      type: OS::Heat::StructuredConfig<br>
      properties:<br>
        config:<br>
           hosts: [{get_variable: endpoint}]<br>
<br>
--<br>
Thomas<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div>
</span></font>
</body>
</html>