unstack.sh fails with sed lvm.conf

Bug #1619195 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
clayg

Bug Description

unstack.sh seems to take great care to be idempotent and atomic.

But if you run unstack.sh on a fresh new system before you initially stack it [1] - you get the following no-zero exit:

+./unstack.sh:main:197 clean_lvm_volume_group stack-volumes-default
+lib/lvm:clean_lvm_volume_group:71 local vg=stack-volumes-default
+lib/lvm:clean_lvm_volume_group:73 _clean_lvm_volume_group stack-volumes-default
+lib/lvm:_clean_lvm_volume_group:44 local vg=stack-volumes-default
+lib/lvm:_clean_lvm_volume_group:47 sudo lvremove -f stack-volumes-default
sudo: lvremove: command not found
++lib/lvm:clean_lvm_volume_group:76 sudo lvs --noheadings -o lv_name stack-volumes-default
+lib/lvm:clean_lvm_volume_group:76 [[ -z '' ]]
+lib/lvm:clean_lvm_volume_group:77 _clean_lvm_backing_file /opt/stack/data/stack-volumes-default-backing-file
+lib/lvm:_clean_lvm_backing_file:55 local backing_file=/opt/stack/data/stack-volumes-default-backing-file
+lib/lvm:_clean_lvm_backing_file:58 [[ -n /opt/stack/data/stack-volumes-default-backing-file ]]
+lib/lvm:_clean_lvm_backing_file:58 [[ -e /opt/stack/data/stack-volumes-default-backing-file ]]
+./unstack.sh:main:198 clean_lvm_filter
+lib/lvm:clean_lvm_filter:154 sudo sed -i 's/^.*# from devstack$//' /etc/lvm/lvm.conf
sed: can't read /etc/lvm/lvm.conf: No such file or directory

I think this was mostly meant to be addressed by https://review.openstack.org/#/c/186696/

1. You can imagine that `unstack.sh && stack.sh` might always pass and result in a cleaned fresh stack regardless of if you're running that on a old setup or a fresh new box

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

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

Changed in devstack:
assignee: nobody → clayg (clay-gerrard)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.openstack.org/364181
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=40b433fb07d2612075a30e2e18fbae094c2c8ec0
Submitter: Jenkins
Branch: master

commit 40b433fb07d2612075a30e2e18fbae094c2c8ec0
Author: Clay Gerrard <email address hidden>
Date: Thu Sep 1 02:07:12 2016 -0700

    Make unstack.sh more independently deterministic

    In some initialization conditions (having never ran stack.sh) the
    result of unstack.sh is dependent on if the user had previously
    installed lvm2 or disabled the cinder service.

    This change makes all results the same with a bit of LBYL.

    There's also a drive-by to put a comment back where it belongs after
    being accidentally moved in the related change.

    Related-Change: I09b1a7bee0785e5e1bb7dc96158a654bd3f15c83

    Change-Id: I9a7e052677d60cbbbdd582877f3c6c48c387f668
    Closes-Bug: #1619195

Changed in devstack:
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.