Skip to content

Commit

Permalink
applying opsramp changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lokesh.balla committed Oct 18, 2023
1 parent 93d32e3 commit 076d8d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions host/host_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func PlatformInformationWithContext(ctx context.Context) (string, string, string
}

//added by opsramp
out, err = invoke.CommandWithContext(ctx, sw_vers, "-productName")
out, err := invoke.CommandWithContext(ctx, "sw_vers", "-productName")
if err == nil {
productName := strings.TrimSpace(string(out))
if strings.HasPrefix(productName, "Mac") {
Expand All @@ -115,7 +115,7 @@ func PlatformInformationWithContext(ctx context.Context) (string, string, string
family = productName
}

out, err := invoke.CommandWithContext(ctx, "sw_vers", "-productVersion")
out, err = invoke.CommandWithContext(ctx, "sw_vers", "-productVersion")
if err == nil {
pver = strings.ToLower(strings.TrimSpace(string(out)))
pver = strings.Replace(pver, "\"", "", -1)
Expand Down
8 changes: 4 additions & 4 deletions host/host_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ func getlsbStruct(ctx context.Context) (*lsbStruct, error) {
}
switch strings.TrimSpace(field[0]) {
case "Distributor ID":
ret.ID = strings.ReplaceAll(field[1], `"`, ``)
ret.ID = strings.TrimSpace(strings.ReplaceAll(field[1], `"`, ``))
case "Release":
ret.Release = strings.ReplaceAll(field[1], `"`, ``)
ret.Release = strings.TrimSpace(strings.ReplaceAll(field[1], `"`, ``))
case "Codename":
ret.Codename = strings.ReplaceAll(field[1], `"`, ``)
ret.Codename = strings.TrimSpace(strings.ReplaceAll(field[1], `"`, ``))
case "Description":
ret.Description = strings.ReplaceAll(field[1], `"`, ``)
ret.Description = strings.TrimSpace(strings.ReplaceAll(field[1], `"`, ``))
}
}

Expand Down

0 comments on commit 076d8d7

Please sign in to comment.