
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1242082293 25200 # Node ID 61d1a7aa49471be6604552efc2dba8491ccd0ad7 # Parent 92caf252c2fa8c8a7a9b70548d12b03c52f3935c Add vsss.py module For keeping functions related to the VirtualSystemSnapshotService Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 92caf252c2fa -r 61d1a7aa4947 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@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