From 306fbbeeb2eb13b5f9660f2f5a136dce731b9a60 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 03:52:59 +0000 Subject: [PATCH 1/4] chore(deps): update ubuntu docker tag to v24 Signed-off-by: Olivier FAURAX --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7791a4b..86933b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive ENV LANG=C.UTF-8 From 80a91699ae58607e148790906439fd9187351828 Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Thu, 16 May 2024 08:28:17 +0000 Subject: [PATCH 2/4] ubuntu 24.04: use distro pip3, use break system package option Signed-off-by: Olivier FAURAX --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86933b7..aac36ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,9 +71,8 @@ RUN apt-get update && apt-get install -y alien && \ COPY ./ /opt/packet-hardware/ # Install packet-hardware RUN apt update && \ - apt install -y git python3 && \ - curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 && \ - pip3 install --no-cache-dir /opt/packet-hardware && \ + apt install -y git python3 python3-pip && \ + pip3 install --no-cache-dir --break-system-packages /opt/packet-hardware && \ apt clean -qy && \ rm -rf /var/lib/apt/lists/* && \ rm -rf /opt/packet-hardware From 7ab4a49ca2778a17662b53d692a23dbc1f8afd3f Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Mon, 4 Nov 2024 16:50:58 +0000 Subject: [PATCH 3/4] OT: Normalize lsblk data for stability in output Signed-off-by: Olivier FAURAX --- packethardware/component/disk.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packethardware/component/disk.py b/packethardware/component/disk.py index ca8db87..5e35744 100644 --- a/packethardware/component/disk.py +++ b/packethardware/component/disk.py @@ -30,10 +30,24 @@ def __init__(self, lsblk): "rota": ( self.lsblk["rota"] if isinstance(self.lsblk["rota"], str) - else "1" if self.lsblk["rota"] else "0" + else "1" + if self.lsblk["rota"] + else "0" ), "tool": self.lsblk["tool"], } + self.lsblk["rota"] = self.data["rota"] + self.lsblk["size"] = self.data["size"] + if "children" in self.lsblk: + for c in self.lsblk["children"]: + c["rota"] = ( + c["rota"] + if isinstance(c["rota"], str) + else "1" + if c["rota"] + else "0" + ) + c["size"] = str(c["size"]) if self.__is_nvme(): self.data["smart"] = utils.get_nvme_attributes(self.lsblk["name"]) From 37b7bb9597868fb732bb5445beebdc0165f2eac3 Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Mon, 4 Nov 2024 17:39:48 +0000 Subject: [PATCH 4/4] old black vs new black Signed-off-by: Olivier FAURAX --- packethardware/component/disk.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packethardware/component/disk.py b/packethardware/component/disk.py index 5e35744..07aac5d 100644 --- a/packethardware/component/disk.py +++ b/packethardware/component/disk.py @@ -30,9 +30,7 @@ def __init__(self, lsblk): "rota": ( self.lsblk["rota"] if isinstance(self.lsblk["rota"], str) - else "1" - if self.lsblk["rota"] - else "0" + else "1" if self.lsblk["rota"] else "0" ), "tool": self.lsblk["tool"], } @@ -43,9 +41,7 @@ def __init__(self, lsblk): c["rota"] = ( c["rota"] if isinstance(c["rota"], str) - else "1" - if c["rota"] - else "0" + else "1" if c["rota"] else "0" ) c["size"] = str(c["size"])