fix(log): output version to log for debugging purpose (#1163)

This commit is contained in:
Kota Kanbe
2021-02-04 07:47:56 +09:00
committed by GitHub
parent 64a6222bf9
commit 290edffccf
7 changed files with 33 additions and 31 deletions

View File

@@ -31,15 +31,14 @@ func newBsd(c config.ServerInfo) *bsd {
}
//https://github.com/mizzy/specinfra/blob/master/lib/specinfra/helper/detect_os/freebsd.rb
func detectFreebsd(c config.ServerInfo) (itsMe bool, bsd osTypeInterface) {
bsd = newBsd(c)
func detectFreebsd(c config.ServerInfo) (bool, osTypeInterface) {
// Prevent from adding `set -o pipefail` option
c.Distro = config.Distro{Family: config.FreeBSD}
if r := exec(c, "uname", noSudo); r.isSuccess() {
if strings.Contains(strings.ToLower(r.Stdout), config.FreeBSD) == true {
if b := exec(c, "freebsd-version", noSudo); b.isSuccess() {
bsd := newBsd(c)
rel := strings.TrimSpace(b.Stdout)
bsd.setDistro(config.FreeBSD, rel)
return true, bsd
@@ -47,7 +46,7 @@ func detectFreebsd(c config.ServerInfo) (itsMe bool, bsd osTypeInterface) {
}
}
util.Log.Debugf("Not FreeBSD. servernam: %s", c.ServerName)
return false, bsd
return false, nil
}
func (o *bsd) checkScanMode() error {