cleanup: remove unused host cache

Signed-off-by: 24sama <jacksama@foxmail.com>
This commit is contained in:
24sama 2022-06-09 10:01:31 +08:00
parent 7b0ce709f2
commit ee24ae51bd
2 changed files with 0 additions and 13 deletions

View File

@ -18,5 +18,4 @@ package os
const (
Release = "release"
PkgTool = "pkgTool"
)

View File

@ -232,21 +232,9 @@ func (g *GetOSData) Execute(runtime connector.Runtime) error {
}
osrData := osrelease.Parse(strings.Replace(osReleaseStr, "\r\n", "\n", -1))
pkgToolStr, err := runtime.GetRunner().SudoCmd(
"if [ ! -z $(which yum 2>/dev/null) ]; "+
"then echo rpm; "+
"elif [ ! -z $(which apt 2>/dev/null) ]; "+
"then echo deb; "+
"fi", false)
if err != nil {
return err
}
host := runtime.RemoteHost()
// type: *osrelease.data
host.GetCache().Set(Release, osrData)
// type: string
host.GetCache().Set(PkgTool, pkgToolStr)
return nil
}