Skip to content

Commit 4b6e102

Browse files
committed
Don't assume English locale
We currently check the output of 'virsh vol-info' for an expected error message when checking for the presence of a volume. In non-English locales, this will not work. This change fixes the issue by assuming a failure of the command means that the volume does not exist. If there is another cause, this should be picked up when the volume is created. Fixes: #51
1 parent c39cf58 commit 4b6e102

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

files/virt_volume.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ result=$?
6161
if [[ $result -eq 0 ]]; then
6262
echo '{"changed": false}'
6363
exit 0
64-
elif ! echo "$output" | grep 'Storage volume not found' >/dev/null 2>&1; then
65-
echo "Unexpected error while getting volume info" >&2
66-
echo "$output"
67-
exit $result
6864
fi
6965

7066
# Stop here in check mode, there will be a change

0 commit comments

Comments
 (0)