devstack lib function is_ovn_service_enabled seems not work

Bug #1743487 reported by ZongKai LI
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-ovn
Fix Released
Undecided
ZongKai LI

Bug Description

When I try to setup a devstack environment with ovn-controller enabled but without ovn-controller-vtep enabled, I write the following into local.conf:

enable_service ovn-controller
disable_service ovn-controller-vtep

But after ./stack.sh completed, I found devstack@ovn-controller-vtep service is installed and get started. I checked https://github.com/openstack/networking-ovn/blob/master/devstack/lib/networking-ovn#L129-L134, I think its current behavior is to return 0 once ovn is enabled and no matter what kind of ovn sub-service it is:

    function is_ovn_service_enabled {
        ovn_service=$1
        is_service_enabled ovn && return 0
        is_service_enabled $ovn_service && return 0
        return 1
    }

it makes the second checking "is_service_enabled $ovn_service" have no chance to run. I think it's not what it is expected to do.

ZongKai LI (zongkai)
Changed in networking-ovn:
assignee: nobody → ZongKai LI (zongkai)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to networking-ovn (master)

Fix proposed to branch: master
Review: https://review.openstack.org/533846

Changed in networking-ovn:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (master)

Reviewed: https://review.openstack.org/533846
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=2af637e1af350adddb45a6f3ade87813ab6e61df
Submitter: Zuul
Branch: master

commit 2af637e1af350adddb45a6f3ade87813ab6e61df
Author: zongkai <lizk1989@126.com>
Date: Tue Jan 16 09:52:26 2018 +0800

    drop is_ovn_service_enabled in devstack

    In devstack/lib/networking-ovn, function is_ovn_service_enabled is used
    to check whether a service such as ovn-controller is enabled.

    It should have similar behavior than function is_service_enabled in
    devstack, since they have the same usage, like:

        if THE_ENABLED_CHECK_FUNCTION SOME_SERVICE ; then
            TRY_TO_CONFIG_IT
        fi

    But currently, is_ovn_service_enabled doesn't work as expected, since it
    will always return 0 if ovn is enabled and no matter what kind of sub-
    service it is.

    Think more, since "enable_service ovn" doesn't enable any service indeed,
    it makes sense to replace is_ovn_service_enabled with is_service_enabled.
    This patch is going to do that, and it will also fix logical error introduced
    by is_ovn_service_enabled.

    Closes-Bug: #1743487
    Change-Id: Ic1213d0c93aea3f73f8c092b3ffb69ff23382735

Changed in networking-ovn:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-ovn 4.0.0.0b3

This issue was fixed in the openstack/networking-ovn 4.0.0.0b3 development milestone.

tags: added: networking-ovn-proactive-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.