From 225d19a78e5b7507ee644b19b99f7e8c84c32bea Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Mon, 27 Mar 2023 21:01:27 +0330 Subject: fixed a bug where an inactive pool would throw exceptions --- pyproject.toml | 2 +- virttop/virttop.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 73afd96..e5ead81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "virttop" -version = "0.2.2" +version = "0.2.3" description = "A top like utility for libvirt" authors = ["terminaldweller "] license = "GPL-3.0" diff --git a/virttop/virttop.py b/virttop/virttop.py index 0794ea6..dd5b3cb 100755 --- a/virttop/virttop.py +++ b/virttop/virttop.py @@ -310,6 +310,8 @@ def fill_virt_data_uri( found_the_pool: bool = False disk = tree.find("devices/disk/source").get("file") for pool in virt_data.pools: + if not pool.isActive(): + continue if os.path.basename(disk) in pool.listVolumes(): virt_data.memory_pool.append(pool.name()) found_the_pool = True @@ -343,7 +345,6 @@ def fill_virt_data_uri( virt_data.ips.append("-") except Exception as exception: logging.exception(exception) - pass def read_config(config_path) -> ConfigData: -- cgit v1.2.3