mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Updated stopdomain.py to use vmmDomain types.
This commit is contained in:
parent
1bd06908eb
commit
41c98a1822
@ -145,11 +145,6 @@ class LibvirtWorker:
|
||||
if name in domains: return True
|
||||
return False
|
||||
|
||||
def destroy_domain(self, name):
|
||||
'''Destroys the specified domain.'''
|
||||
domain = self.get_domain(name)
|
||||
domain.destroy()
|
||||
|
||||
def undefine_domain(self, name):
|
||||
'''Undefines the specified domain.'''
|
||||
domain = self.get_domain(name)
|
||||
|
@ -47,10 +47,13 @@ class StopDomainConfigScreen(DomainListConfigScreen):
|
||||
if self.get_selected_domain() is not None:
|
||||
domain = self.get_selected_domain()
|
||||
try:
|
||||
self.get_libvirt().destroy_domain(domain)
|
||||
return True
|
||||
if domain.is_stoppable():
|
||||
domain.destroy()
|
||||
return True
|
||||
else:
|
||||
errors.append("%s is not in a stoppable state: state=%s" % (domain.get_name(), domain.run_status()))
|
||||
except Exception, error:
|
||||
errors.append("There was an error stop the domain: %s" % domain)
|
||||
errors.append("There was an error stopping the domain: %s" % domain)
|
||||
errors.append(str(error))
|
||||
else:
|
||||
errors.append("You must first select a domain to stop.")
|
||||
@ -58,7 +61,7 @@ class StopDomainConfigScreen(DomainListConfigScreen):
|
||||
|
||||
def get_stop_page(self, screen):
|
||||
grid = Grid(1, 1)
|
||||
grid.setField(Label("%s was successfully stoped." % self.get_selected_domain()), 0, 0)
|
||||
grid.setField(Label("%s was successfully stopped." % self.get_selected_domain().get_name()), 0, 0)
|
||||
return [grid]
|
||||
|
||||
def StopDomain():
|
||||
|
Loading…
Reference in New Issue
Block a user