FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 06-27-2008, 11:52 AM
"Bryan M. Kearney
 
Default 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
 

Thread Tools




All times are GMT. The time now is 03:03 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org