<div dir="ltr">Hey Yanis,<div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 3:56 AM, Yanis Guenane <span dir="ltr"><<a href="mailto:yguenane@redhat.com" target="_blank">yguenane@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello everyone,<br>
<br>
Based on the conversation we had during last meeting I went ahead and<br>
created an<br>
ini_setting provider[1] that will act as a proxy between our provider<br>
and the<br>
upstream one, this way we don't have to fork, only overload the method<br>
we want.<br>
<br>
The second step towards parameter default management was to provide a<br>
way that<br>
means if 'X' is specified as the value for the provider then ensure it<br>
is absent.<br>
<br>
This way we could move from the following pattern :<br>
<br>
  if $myvar {<br>
    keystone_config {'DEFAULT/foo': value => $myvar,<br>
  } else {<br>
    keystone_config {'DEFAULT/foo': ensure => absent,<br>
  }<br>
<br>
to a more readable one that would have been<br>
<br>
  keystone_config {'DEFAULT/foo': value => $myvar, }<br>
<br>
that based on the value of $myvar would have ensure absent the parameter.<br>
<br>
In a first time the empty string seemed to have been a good idea, so we<br>
could<br>
have default all the parameters to '' (empty string) and live happily<br>
ever after,<br>
if set the value would have been set else it would default to upstream<br>
default.<br>
<br>
But Mathieu raised a fair point here[2] is that an empty string for some<br>
settings is a valid value, and hence we can't rely on<br>
it.<br>
<br></blockquote><div><br></div><div>Does it make sense for undef to be the 'magic' string for this? As '' or false may be valid settings, but undef currently is basically ignored (or so I've been told). Would we want to use undef to indicate the removal of an option from a configuration?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Since the beginning we are trying to avoid the use of a magic string, but<br>
I am starting to run out of idea here.<br>
<br>
Does someone has an idea on which sane value the default could be ?<br>
<br>
Thanks in advance,<br>
<br>
[1] <a href="https://review.openstack.org/#/c/202488" rel="noreferrer" target="_blank">https://review.openstack.org/#/c/202488</a><br>
[2] <a href="https://review.openstack.org/#/c/202574" rel="noreferrer" target="_blank">https://review.openstack.org/#/c/202574</a><br>
--<br>
Yanis Guenane<br>
<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>
</blockquote></div><br></div><div class="gmail_extra"><div><br></div><div>Thanks,</div><div>-Alex</div><div><br></div></div></div>