Have nonesum run stat rather than nonesum because nonesum sums none. k.

This commit is contained in:
Israel Shirk 2015-06-25 19:03:00 -06:00
parent fe0fde195d
commit 88fac0b49c
1 changed files with 11 additions and 4 deletions

View File

@ -396,10 +396,17 @@ func (d *ESX5Driver) upload(dst, src string) error {
}
func (d *ESX5Driver) verifyChecksum(ctype string, hash string, file string) bool {
stdin := bytes.NewBufferString(fmt.Sprintf("%s %s", hash, file))
_, err := d.run(stdin, fmt.Sprintf("%ssum", ctype), "-c")
if err != nil {
return false
if (ctype == "none") {
err := d.sh("stat", file)
if err != nil {
return false
}
} else {
stdin := bytes.NewBufferString(fmt.Sprintf("%s %s", hash, file))
_, err := d.run(stdin, fmt.Sprintf("%ssum", ctype), "-c")
if err != nil {
return false
}
}
return true
}