From 7abff493fa01b5f7e7d6bc6013dddbc625af0bee Mon Sep 17 00:00:00 2001 From: CSY Date: Thu, 5 Dec 2024 11:48:51 +0800 Subject: [PATCH] remove gnu/linux --- .github/workflows/unit_tests.yml | 5 ----- device_smi/os.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 1f8add6..7a6dc7b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -84,11 +84,6 @@ jobs: - name: test os shell: wsl-bash -u root {0} run: | - echo 1 - cat /etc/os-release - - echo 4 - cat /etc/issue python3 -m venv venv source venv/bin/activate pip install . diff --git a/device_smi/os.py b/device_smi/os.py index 4dea029..ba1a06a 100644 --- a/device_smi/os.py +++ b/device_smi/os.py @@ -15,7 +15,7 @@ def __init__(self, cls): if platform.system().lower() == "linux" or platform.system().lower() == "freebsd" or platform.system().lower() == "solaris" or platform.system().lower() == "sunos": release_info = self.to_dict(_run(["cat", "/etc/os-release"]).replace("\"", "").lower(), "=") - cls.name = release_info["name"].replace("oracle", "").strip() + cls.name = release_info["name"].replace("oracle", "").replace("gnu/linux", "").strip() cls.version = release_info["version_id"] match = re.match(r"(\d+\.\d+)", cls.version)