# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1242082293 25200
# Node ID f12adddd10e4f40bd338f17ca99b2d246b8ba176
# Parent 95b9360a2d1c3dce540ea9eeb965bec86ebbdfab
[TEST] Add vsss.py module
For keeping functions related to the VirtualSystemSnapshotService
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 95b9360a2d1c -r f12adddd10e4 suites/libvirt-cim/lib/XenKvmLib/vsss.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsss.py Mon May 11 15:51:33 2009 -0700
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+#
+# Copyright 2009 IBM Corp.
+#
+# Authors:
+# Kaitlin Rupert <karupert(a)us.ibm.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+import pywbem
+from VirtLib.utils import run_remote
+from CimTest.Globals import logger
+from CimTest.ReturnCodes import FAIL, PASS
+
+#Path to snapshot save location
+snapshot_save_loc = '/var/lib/libvirt/'
+
+def remove_snapshot(ip, vm_name):
+ snapshot = "%s%s" % (snapshot_save_loc, vm_name)
+
+ cmd = "rm %s.save" % snapshot
+ ret, out = run_remote(ip, cmd)
+ if ret != 0:
+ logger.error("Failed to remove snapshot file for %s", vm_name)
+ return FAIL
+
+ return PASS