watcher devstack plugin doesn't work in unclean environment

Bug #1539422 reported by Zhai, Edwin on 2016-01-29
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zhai, Edwin

Bug Description

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

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

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

Fix proposed to branch: master

Changed in watcher:
status: New → In Progress

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  Edit
Everyone can see this information.

Other bug subscribers