This code is only useful to crash reports

Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
David Gageot 2016-01-06 11:08:14 +01:00
parent 7442ccc585
commit af09ebbe4e
5 changed files with 8 additions and 9 deletions

View File

@ -17,7 +17,6 @@ import (
"github.com/bugsnag/bugsnag-go" "github.com/bugsnag/bugsnag-go"
"github.com/docker/machine/libmachine/log" "github.com/docker/machine/libmachine/log"
"github.com/docker/machine/libmachine/mcnutils"
"github.com/docker/machine/version" "github.com/docker/machine/version"
) )
@ -146,5 +145,5 @@ func detectUname(metaData *bugsnag.MetaData) {
} }
func detectOSVersion(metaData *bugsnag.MetaData) { func detectOSVersion(metaData *bugsnag.MetaData) {
metaData.Add("device", "os version", mcnutils.LocalOSVersion()) metaData.Add("device", "os version", localOSVersion())
} }

View File

@ -1,8 +1,8 @@
package mcnutils package crashreport
import "os/exec" import "os/exec"
func LocalOSVersion() string { func localOSVersion() string {
command := exec.Command("bash", "-c", `sw_vers | grep ProductVersion | cut -d$'\t' -f2`) command := exec.Command("bash", "-c", `sw_vers | grep ProductVersion | cut -d$'\t' -f2`)
output, err := command.Output() output, err := command.Output()
if err != nil { if err != nil {

View File

@ -1,8 +1,8 @@
package mcnutils package crashreport
import "os/exec" import "os/exec"
func LocalOSVersion() string { func localOSVersion() string {
command := exec.Command("bash", "-c", `cat /etc/os-release | grep 'VERSION=' | cut -d'=' -f2`) command := exec.Command("bash", "-c", `cat /etc/os-release | grep 'VERSION=' | cut -d'=' -f2`)
output, err := command.Output() output, err := command.Output()
if err != nil { if err != nil {

View File

@ -1,11 +1,11 @@
package mcnutils package crashreport
import ( import (
"os/exec" "os/exec"
"strings" "strings"
) )
func LocalOSVersion() string { func localOSVersion() string {
command := exec.Command("ver") command := exec.Command("ver")
output, err := command.Output() output, err := command.Output()
if err == nil { if err == nil {

View File

@ -1,4 +1,4 @@
package mcnutils package crashreport
import ( import (
"testing" "testing"