[openstack-dev] [devstack] Bug in is_*_enabled functions?

Carl Baldwin carl at ecbaldwin.net
Wed Feb 26 22:18:37 UTC 2014


Brian,

In shell it is correct to return 0 for success and non-zero for failure.

Carl
On Feb 26, 2014 10:54 AM, "Brian Haley" <brian.haley at hp.com> wrote:

> While trying to track down why Jenkins was handing out -1's in a Neutron
> patch,
> I was seeing errors in the devstack tests it runs.  When I dug deeper it
> looked
> like it wasn't properly determining that Neutron was enabled -
> ENABLED_SERVICES
> had multiple "q-*" entries, but 'is_service_enabled neutron' was returning
> 0.
>
> I boiled it down to a simple reproducer based on the many is_*_enabled()
> functions:
>
> #!/usr/bin/env bash
> set -x
>
> function is_foo_enabled {
>     [[ ,${ENABLED_SERVICES} =~ ,"f-" ]] && return 0
>     return 1
> }
>
> ENABLED_SERVICES=f-svc
>
> is_foo_enabled
>
> $ ./is_foo_enabled.sh
> + ENABLED_SERVICES=f-svc
> + is_foo_enabled
> + [[ ,f-svc =~ ,f- ]]
> + return 0
>
> So either the return values need to be swapped, or && changed to ||.  I
> haven't
> tested is_service_enabled() but all the is_*_enabled() functions are wrong
> at least.
>
> Is anyone else seeing this besides me?  And/or is someone already working
> on
> fixing it?  Couldn't find a bug for it.
>
> Thanks,
>
> -Brian
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140226/bf4e63fa/attachment.html>


More information about the OpenStack-dev mailing list