Merge pull request #2323 from israelshirk/feature/vmware-nonesum
builder/vmware: Run stat on vmware when checksum type = none
This commit is contained in:
commit
677498a55c
@ -396,10 +396,17 @@ func (d *ESX5Driver) upload(dst, src string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *ESX5Driver) verifyChecksum(ctype string, hash string, file string) bool {
|
func (d *ESX5Driver) verifyChecksum(ctype string, hash string, file string) bool {
|
||||||
stdin := bytes.NewBufferString(fmt.Sprintf("%s %s", hash, file))
|
if (ctype == "none") {
|
||||||
_, err := d.run(stdin, fmt.Sprintf("%ssum", ctype), "-c")
|
err := d.sh("stat", file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
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
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user