<p dir="ltr">Brian,</p>
<p dir="ltr">In shell it is correct to return 0 for success and non-zero for failure.</p>
<p dir="ltr">Carl</p>
<div class="gmail_quote">On Feb 26, 2014 10:54 AM, "Brian Haley" <<a href="mailto:brian.haley@hp.com">brian.haley@hp.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
While trying to track down why Jenkins was handing out -1's in a Neutron patch,<br>
I was seeing errors in the devstack tests it runs.  When I dug deeper it looked<br>
like it wasn't properly determining that Neutron was enabled - ENABLED_SERVICES<br>
had multiple "q-*" entries, but 'is_service_enabled neutron' was returning 0.<br>
<br>
I boiled it down to a simple reproducer based on the many is_*_enabled() functions:<br>
<br>
#!/usr/bin/env bash<br>
set -x<br>
<br>
function is_foo_enabled {<br>
    [[ ,${ENABLED_SERVICES} =~ ,"f-" ]] && return 0<br>
    return 1<br>
}<br>
<br>
ENABLED_SERVICES=f-svc<br>
<br>
is_foo_enabled<br>
<br>
$ ./is_foo_enabled.sh<br>
+ ENABLED_SERVICES=f-svc<br>
+ is_foo_enabled<br>
+ [[ ,f-svc =~ ,f- ]]<br>
+ return 0<br>
<br>
So either the return values need to be swapped, or && changed to ||.  I haven't<br>
tested is_service_enabled() but all the is_*_enabled() functions are wrong at least.<br>
<br>
Is anyone else seeing this besides me?  And/or is someone already working on<br>
fixing it?  Couldn't find a bug for it.<br>
<br>
Thanks,<br>
<br>
-Brian<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<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><br>
</blockquote></div>