oracle: Fix missing close calls

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Stéphane Graber 2019-02-27 09:47:05 +01:00
parent ce1df55da0
commit b2e34747d2
No known key found for this signature in database
GPG Key ID: C638974D64792D67

View File

@ -165,16 +165,19 @@ func (s *OracleLinuxHTTP) unpackISO(latestUpdate, filePath, rootfsDir string) er
if err != nil {
return err
}
rpmFile.Close()
_, err = lxd.DownloadFileHash(http.DefaultClient, "", nil, nil, yumFileName, fmt.Sprintf("%s/%s", baseURL, yumPkg), "", nil, yumFile)
if err != nil {
return err
}
yumFile.Close()
_, err = lxd.DownloadFileHash(http.DefaultClient, "", nil, nil, gpgFileName, "https://oss.oracle.com/ol6/RPM-GPG-KEY-oracle", "", nil, gpgFile)
if err != nil {
return err
}
gpgFile.Close()
// Setup the mounts and chroot into the rootfs
exitChroot, err := shared.SetupChroot(tempRootDir, shared.DefinitionEnv{})