watcher devstack plugin doesn't work in unclean environment

Bug #1539422 reported by Zhai, Edwin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
watcher
Fix Released
Low
Zhai, Edwin

Bug Description

On system previously installing watcher manually, there is probably "Permission denied" error for policy.json copying when running devstack.

Revision history for this message
Zhai, Edwin (edwin-zhai) wrote :

The issue is current devstack plugin doesn't handle directory creation in clean way.

    if [[ ! -d $WATCHER_CONF_DIR ]]; then
        sudo mkdir -p $WATCHER_CONF_DIR
        sudo chown $STACK_USER $WATCHER_CONF_DIR
    fi

If WATCHER_CONF_DIR existed with root owner, this code doesn't change it to the right ownership. Then copying policy.json failed.

So need use "sudo install -d ..." as clean way of making directory

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to watcher (master)

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

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

Reviewed: https://review.openstack.org/273936
Committed: https://git.openstack.org/cgit/openstack/watcher/commit/?id=278b1819d64c04162d939fe34d3691baf352b6ab
Submitter: Jenkins
Branch: master

commit 278b1819d64c04162d939fe34d3691baf352b6ab
Author: Edwin Zhai <email address hidden>
Date: Fri Jan 29 06:52:52 2016 +0000

    Use install instead of mkdir for DevStack dirs

    The current code will not work if WATCHER_CONF_DIR or
    WATCHER_AUTH_CACHE_DIR already exist but are owned by a different user
    such as root. Use install instead of mkdir to handle this scenario.

    Change-Id: Ie582a4b393e898e007d73f31de490c4b77e40be3
    Closes-Bug: #1539422

Changed in watcher:
status: In Progress → Fix Released
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.