Skip to content

Commit 6cdb2e0

Browse files
kk7dsianw
authored andcommitted
Remove the lvm.conf filter during cleanup
This avoids us leaving the filter in the global lvm config. Without cleaning this up, we can hit some failures to run stack.sh because devices are excluded that we need to be able to see. This resets it to what it was before when we do a cleanup. Also, do this before we add the line, so we don't add multiple lines on successive runs. Closes-bug: #1437998 Change-Id: Idbf8a06b723f79ef16a7c175ee77a8c25f813244
1 parent cd7655c commit 6cdb2e0

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎lib/cinder_backends/lvm‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function cleanup_cinder_backend_lvm {
3939

4040
# Campsite rule: leave behind a volume group at least as clean as we found it
4141
clean_lvm_volume_group $VOLUME_GROUP_NAME-$be_name
42+
clean_lvm_filter
4243
}
4344

4445
# configure_cinder_backend_lvm - Set config files, create data dirs, etc

‎lib/lvm‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ function init_default_lvm_volume_group {
145145
fi
146146
}
147147

148+
# clean_lvm_filter() Remove the filter rule set in set_lvm_filter()
149+
#
150+
# Usage: clean_lvm_filter()
151+
function clean_lvm_filter {
152+
sudo sed -i "s/^.*# from devstack$//" /etc/lvm/lvm.conf
153+
}
154+
148155
# set_lvm_filter() Gather all devices configured for LVM and
149156
# use them to build a global device filter
150157
# set_lvm_filter() Create a device filter
@@ -154,7 +161,7 @@ function init_default_lvm_volume_group {
154161
#
155162
# Usage: set_lvm_filter()
156163
function set_lvm_filter {
157-
local filter_suffix='"r|.*|" ]'
164+
local filter_suffix='"r|.*|" ] # from devstack'
158165
local filter_string="global_filter = [ "
159166
local pv
160167
local vg
@@ -167,6 +174,7 @@ function set_lvm_filter {
167174
done
168175
filter_string=$filter_string$filter_suffix
169176

177+
clean_lvm_filter
170178
sudo sed -i "/# global_filter = \[*\]/a\ $global_filter$filter_string" /etc/lvm/lvm.conf
171179
echo_summary "set lvm.conf device global_filter to: $filter_string"
172180
}

‎unstack.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,4 @@ fi
192192

193193
# BUG: maybe it doesn't exist? We should isolate this further down.
194194
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true
195+
clean_lvm_filter

0 commit comments

Comments
 (0)