The stop function is removed since 0.5.0, update delete function
using virsh destroy to stop container.

Signed-off-by: Wayne Sun <[email protected]>
---
 bin/virt-sandbox-service |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
index 550d46c..926d1d5 100755
--- a/bin/virt-sandbox-service
+++ b/bin/virt-sandbox-service
@@ -254,9 +254,11 @@ class Container:
 
     def delete(self):
         self.connect()
-        # Stop service if it is running
+        # Stop container if it is running
         try:
-            self.stop()
+            p = Popen(["/usr/bin/virsh", "-c", self.uri, "destroy", self.name],
+                      stdout=PIPE, stderr=PIPE)
+            p.communicate()
         except:
             pass
 
-- 
1.7.1

--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to