Преглед изворни кода

Fix /etc/os-release parsing.
In some cases, there are trailing whitespaces in /etc/os-release
causing the os version to not be parsed correctly.

Arin Toaca пре 7 година
родитељ
комит
4fb9161a3c
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      coriolis/utils.py

+ 2 - 0
coriolis/utils.py

@@ -112,6 +112,8 @@ def parse_os_release(ssh):
         if "=" not in line:
         if "=" not in line:
             continue
             continue
         k, v = line.split("=")
         k, v = line.split("=")
+        k = k.strip()
+        v = v.strip()
         info[k] = v.strip('"')
         info[k] = v.strip('"')
     if info.get("ID") and info.get("VERSION_ID"):
     if info.get("ID") and info.get("VERSION_ID"):
         return (info.get("ID"), info.get("VERSION_ID"))
         return (info.get("ID"), info.get("VERSION_ID"))