code: func getOSInfo(c context.Context, b *buildbot.Build, m *buildstore.Master) (
  	family, version string) {
  	// Fetch the master info from datastore if not provided.
  	if m.Name == "" {
  		logging.Infof(c, "Fetching info for master %s", b.Master)
  		freshMaster, err := buildstore.GetMaster(c, b.Master, false)
  		if err != nil {
  			logging.WithError(err).Errorf(c, "fetching master %q", b.Master)
  			return
  		}
  		if freshMaster.Internal && !b.Internal {
  			logging.Errorf(c, "Build references an internal master, but build is not internal.")
  			return
  		}
  		*m = *freshMaster
  	}
  
  	s, ok := m.Slaves[b.Slave]
  	if !ok {
  		logging.Warningf(c, "Could not find slave %s in master %s", b.Slave, b.Master)
  		return
  	}
  	hostInfo := map[string]string{}
  	for _, v := range strings.Split(s.Host, "\n") {
  		if info := strings.SplitN(v, ":", 2); len(info) == 2 {
  			hostInfo[info[0]] = strings.TrimSpace(info[1])
  		}
  	}
  	// Extract OS and OS Family
  	if v, ok := hostInfo["os family"]; ok {
  		family = v
  	}
  	if v, ok := hostInfo["os version"]; ok {
  		version = v
  	}
  	return
  }
docs: // getOSInfo fetches the os family and version of the slave the build was
  // running on from the master json on a best-effort basis.