Skip to content

Commit 06be15a

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "run tgt-admin --delete only if input not empty"
2 parents 351272a + 084efc7 commit 06be15a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/lvm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function init_lvm_volume_group {
124124
if [ "$CINDER_ISCSI_HELPER" = "lioadm" ]; then
125125
sudo cinder-rtstool get-targets | sudo xargs -rn 1 cinder-rtstool delete
126126
else
127-
sudo tgtadm --op show --mode target | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
127+
sudo tgtadm --op show --mode target | awk '/Target/ {print $3}' | sudo xargs -r -n1 tgt-admin --delete
128128
fi
129129
_clean_lvm_volume_group $vg
130130
}

0 commit comments

Comments
 (0)