mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 06:46:36 +01:00
scripts/maintenance/virsh-cleanup: shellcheck cleanup
Address [1]: .../virsh-cleanup.sh:4:1: note: read without -r will mangle backslashes. [SC2162] .../virsh-cleanup.sh:26:63: note: read without -r will mangle backslashes. [SC2162] .../virsh-cleanup.sh:26:75: warning: DETAILS appears unused. Verify use (or export if used externally). [SC2034] I don't expect any backslashes in these values, but it doesn't hurt to protect against them anyway. And using _ instead of DETAILS for the dummy variable that keeps VOLUME limited to the first field seems to be enough to avoid SC2034 triggering. [1]: https://travis-ci.org/openshift/installer/jobs/411041440#L388
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
printf 'Warning: This will destroy effectively all libvirt resources\nContinue [yN]? '
|
||||
read CONTINUE
|
||||
read -r CONTINUE
|
||||
if test "${CONTINUE}" != y -a "${CONTINUE}" != Y
|
||||
then
|
||||
echo 'Aborted' >&2
|
||||
@@ -23,7 +23,7 @@ do
|
||||
run virsh -c "${CONNECT}" undefine "${DOMAIN}"
|
||||
done
|
||||
|
||||
virsh -c "${CONNECT}" vol-list "${POOL}" | tail -n +3 | while read VOLUME DETAILS
|
||||
virsh -c "${CONNECT}" vol-list "${POOL}" | tail -n +3 | while read -r VOLUME _
|
||||
do
|
||||
if test -z "${VOLUME}"
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user