From af4dc62e49128cb5e0be1fb244074b3a7c8733e8 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Fri, 10 Aug 2012 10:09:13 -0400 Subject: Implement get_host_uptime in libvirt driver. Updates the libvirt compute driver to support the host uptime call. Change-Id: Ife6aad55c5544177b4172487b4cae02f02dc247f --- nova/virt/libvirt/driver.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 836f8a34b..aeca7ab27 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -2769,6 +2769,13 @@ class LibvirtDriver(driver.ComputeDriver): """Sets the specified host's ability to accept new instances.""" pass + def get_host_uptime(self, host): + """Returns the result of calling "uptime".""" + #NOTE(dprince): host seems to be ignored for this call and in + # other compute drivers as well. Perhaps we should remove it? + out, err = utils.execute('env', 'LANG=C', 'uptime') + return out + def manage_image_cache(self, context): """Manage the local cache of images.""" self.image_cache_manager.verify_base_images(context) -- cgit