Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora/Linux Management Tools (http://www.linux-archive.org/fedora-linux-management-tools/)
-   -   Added suggestion from Daniel Berrange to always do the undefine (http://www.linux-archive.org/fedora-linux-management-tools/114572-added-suggestion-daniel-berrange-always-do-undefine.html)

"Bryan M. Kearney 06-27-2008 11:52 AM

Added suggestion from Daniel Berrange to always do the undefine
 
# HG changeset patch
# User "Bryan M. Kearney <bkearney@redhat.com>"
# Date 1214567351 14400
# Node ID 09f0cc44fc08b377aab683e583e73294156c0e3c
# Parent efba908eb79ad0bf2805c27f784de92578207f1b
Added suggestion from Daniel Berrange to always do the undefine

diff -r efba908eb79a -r 09f0cc44fc08 virtinst/Guest.py
--- a/virtinst/Guest.py Thu Jun 26 12:32:47 2008 -0400
+++ b/virtinst/Guest.py Fri Jun 27 07:49:11 2008 -0400
@@ -937,12 +937,14 @@ class Guest(object):
vm = self.conn.lookupByName(self.name)
if removeOld:
if vm is not None:
- if vm.ID() == -1:
+ if vm.ID() != -1:
+ logging.info("Destroying image %s" %(self.name))
+ vm.destroy()
+ try:
logging.info("Removing old definition for image %s" %(self.name))
vm.undefine()
- else:
- logging.info("Destroying image %s" %(self.name))
- vm.destroy()
+ except:
+ pass
else:
if vm is not None:
raise RuntimeError, _("Domain named %s already exists!") %(self.name,)

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools


All times are GMT. The time now is 04:15 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.