From 18686fcd019f4d4f9b7ef61eb28e9ff00b161593 Mon Sep 17 00:00:00 2001 From: Anael Beutot Date: Wed, 16 May 2012 11:42:45 +0200 Subject: [PATCH] Added libvirt connection status tag. --- ccnode/hypervisor/tags.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ccnode/hypervisor/tags.py b/ccnode/hypervisor/tags.py index 09e7d4f..95cbad8 100644 --- a/ccnode/hypervisor/tags.py +++ b/ccnode/hypervisor/tags.py @@ -2,6 +2,11 @@ from ccnode.utils import and_ from ccnode.hypervisor.lib import vir_tag +def vir_status(handl): + """Local libvirt connection status.""" + return {True: 'connected', False: 'disconnected'}[handl.virt_connected] + + # hypervisor related tags def htype(): """Hypervisor type.""" -- GitLab