Commit 5644c956 authored by Benziane Chakib's avatar Benziane Chakib
Browse files

Added error handling for suspend and resume vm

parent 6012fcd5
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -173,10 +173,16 @@ class LibvirtVm(VM):
            raise VMError('%s is already running !' % self.get_name())

    def suspend(self):
        try:
            self._domain.suspend()
        except libvirt.libvirtError:
            raise VMError('%s is not running !' % self.get_name())

    def resume(self):
        try:
            self._domain.resume()
        except libvirt.libvirtError:
            raise VMError('%s is not running !' % self.get_name())

    def get_uuid(self):
        '''