Remove any quotes around distribution id

Some distributions add extra quotes, even to fields like ID
that doesn't really need them. Make sure to remove them too.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
This commit is contained in:
Anders F Björklund
2023-07-24 19:51:27 +02:00
parent 5f90fbcdc1
commit ac212605c9

View File

@ -287,7 +287,7 @@ func (r *Runtime) GetHostDistributionInfo() define.DistributionInfo {
l := bufio.NewScanner(f)
for l.Scan() {
if strings.HasPrefix(l.Text(), "ID=") {
dist.Distribution = strings.TrimPrefix(l.Text(), "ID=")
dist.Distribution = strings.Trim(strings.TrimPrefix(l.Text(), "ID="), "\"")
}
if strings.HasPrefix(l.Text(), "VARIANT_ID=") {
dist.Variant = strings.Trim(strings.TrimPrefix(l.Text(), "VARIANT_ID="), "\"")