[host][linux] Properly handle double quotes in /etc/os-release in PlatformInformation
This commit is contained in:
parent
a0019d431c
commit
3af6e1ffe7
|
@ -247,9 +247,9 @@ func getOSRelease() (platform string, version string, err error) {
|
|||
}
|
||||
switch field[0] {
|
||||
case "ID": // use ID for lowercase
|
||||
platform = field[1]
|
||||
platform = strings.Trim(field[1], `"`)
|
||||
case "VERSION":
|
||||
version = field[1]
|
||||
version = strings.Trim(field[1], `"`)
|
||||
}
|
||||
}
|
||||
return platform, version, nil
|
||||
|
|
Loading…
Reference in New Issue