Bugfix: load_images cleanup, shellcheck fixes 57/31457/1
authorRoss Brattain <ross.b.brattain@intel.com>
Thu, 9 Mar 2017 04:17:40 +0000 (20:17 -0800)
committerJing Lu <lvjing5@huawei.com>
Thu, 23 Mar 2017 02:06:51 +0000 (02:06 +0000)
commit886fdfbf0b9d3def9d66f324885aabf3586d09b1
treedc9a0d5ed7231d47a1df530cdaaab6ba0ddf6528
parent2ee902070084ebec2f3bf3d5729a6766d634758d
Bugfix: load_images cleanup, shellcheck fixes

We should have run shellcheck on this.

This is why we don't use the shell, too many
obscure gotchas.

shellcheck: load_images.sh:25:75: warning: sudo doesn't affect redirects. Use .. | sudo tee -a file [SC2024]

  sudo echo foo >> /etc/foo won't work,

the >> will be run in the current shell,
replace with:

  echo foo | sudo tee -a /etc/foo

shellcheck: load_images.sh:47:15: warning: Declare and assign separately to avoid masking return values. [SC2155]

replace local cmd='a' with two line version

shellcheck: load_images.sh:141:32: error: [ .. ] can't match globs. Use [[ .. ]] or grep. [SC2081]

use [[ ]]

Change-Id: I14d9768612ea147eaf139603f7eb8753e979ba2c
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
(cherry picked from commit 892d2e536e46a6e6427c061931c58f80b542589d)
tests/ci/load_images.sh