<div dir="ltr">+1 to way from paste above.</div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-23 16:42 GMT+03:00 Martin Mágr <span dir="ltr"><<a href="mailto:mmagr@redhat.com" target="_blank">mmagr@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
    <br>
    <br>
    <div>On 09/23/2015 02:17 AM, Cody Herriges
      wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>Alex Schultz wrote:
</pre>
      <blockquote type="cite">
        <pre>Hey puppet folks,

Based on the meeting yesterday[0], I had proposed creating a parser
function called is_service_default[1] to validate if a variable matched
our agreed upon value of '<SERVICE DEFAULT>'.  This got me thinking
about how can we maybe not use the arbitrary string throughout the
puppet that can not easily be validated.  So I tested creating another
puppet function named service_default[2] to replace the use of '<SERVICE
DEFAULT>' throughout all the puppet modules.  My tests seemed to
indicate that you can use a parser function as parameter default for
classes. 

I wanted to send a note to gather comments around the second function. 
When we originally discussed what to use to designate for a service's
default configuration, I really didn't like using an arbitrary string
since it's hard to parse and validate. I think leveraging a function
might be better since it is something that can be validated via tests
and a syntax checker.  Thoughts?


Thanks,
-Alex

[0] <a href="http://eavesdrop.openstack.org/meetings/puppet_openstack/2015/puppet_openstack.2015-09-15-15.00.html" target="_blank">http://eavesdrop.openstack.org/meetings/puppet_openstack/2015/puppet_openstack.2015-09-15-15.00.html</a>
[1] <a href="https://review.openstack.org/#/c/223672" target="_blank">https://review.openstack.org/#/c/223672</a>
[2] <a href="https://review.openstack.org/#/c/224187" target="_blank">https://review.openstack.org/#/c/224187</a>

</pre>
      </blockquote>
      <pre>I've been mulling this over the last several days and I just can't
accept an entire ruby function which would be ran for every parameter
with the desired static value of "<SERVICE DEFAULT>" when the class is
declared and parsed.  I am not generally against using functions as a
parameter default just not a fan in this case because running ruby just
to return a static string seems inappropriate and not optimal.

In this specific case I think the params pattern and inheritance can
obtain us the same goals.  I also find this a valid us of inheritance
cross module namespaces but...only because all our modules must depend
on puppet-openstacklib.

<a href="http://paste.openstack.org/show/473655" target="_blank">http://paste.openstack.org/show/473655</a>
</pre>
    </blockquote>
    <br></div></div>
    +1 for implementation in pastebin above. Much better solution than
    running function.<br>
    <br>
    Regards,<br>
    Martin<span class=""><br>
     <br>
    <blockquote type="cite">
      <pre>
</pre>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
    </blockquote>
    <br>
  </span></div>

<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="color:rgb(136,136,136)"><span style="font-family:arial;font-size:small">Best Regards,</span><br></div><span style="color:rgb(136,136,136)">Egorenko Denis</span>,</div><div><span style="color:rgb(136,136,136)">Deployment Engineer</span><br style="color:rgb(136,136,136)"><span style="color:rgb(136,136,136)">Mirantis</span><br></div></div></div></div>
</div>