From fe7f4db6e7f864db9fa33bab2f19b1ab71149547 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 22 May 2021 16:17:02 -0400 Subject: [PATCH] host: Use libvirtobject.run_status Fixes uitest coverage when the host doesn't have any inactive non-domain objects Signed-off-by: Cole Robinson --- virtManager/hostnets.py | 3 +-- virtManager/hoststorage.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/virtManager/hostnets.py b/virtManager/hostnets.py index 2213d391c..c12a29833 100644 --- a/virtManager/hostnets.py +++ b/virtManager/hostnets.py @@ -246,9 +246,8 @@ class vmmHostNets(vmmGObjectUI): uiutil.set_grid_row_visible(self.widget("net-name-domain"), bool(net.get_name_domain())) - state = active and _("Active") or _("Inactive") icon = (active and ICON_RUNNING or ICON_SHUTOFF) - self.widget("net-state").set_text(state) + self.widget("net-state").set_text(net.run_status()) self.widget("net-state-icon").set_from_icon_name(icon, Gtk.IconSize.BUTTON) diff --git a/virtManager/hoststorage.py b/virtManager/hoststorage.py index 190a8a11c..b1b7cf6b4 100644 --- a/virtManager/hoststorage.py +++ b/virtManager/hoststorage.py @@ -320,8 +320,7 @@ class vmmHostStorage(vmmGObjectUI): self.widget("pool-state-icon").set_from_icon_name( ((active and ICON_RUNNING) or ICON_SHUTOFF), Gtk.IconSize.BUTTON) - self.widget("pool-state").set_text( - (active and _("Active")) or _("Inactive")) + self.widget("pool-state").set_text(pool.run_status()) self.widget("pool-autostart").set_label(_("On Boot")) self.widget("pool-autostart").set_active(auto)