dom0: move remove_appmenus to separate subroutine
This commit is contained in:
parent
12b8ff7d17
commit
134af81b3b
@ -816,6 +816,14 @@ class QubesVm(object):
|
|||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
print >> sys.stderr, "Ooops, there was a problem creating appmenus for {0} VM!".format (self.name)
|
print >> sys.stderr, "Ooops, there was a problem creating appmenus for {0} VM!".format (self.name)
|
||||||
|
|
||||||
|
def remove_appmenus(self):
|
||||||
|
vmtype = None
|
||||||
|
if self.is_netvm():
|
||||||
|
vmtype = 'servicevms'
|
||||||
|
else:
|
||||||
|
vmtype = 'appvms'
|
||||||
|
subprocess.check_call ([qubes_appmenu_remove_cmd, self.name, vmtype])
|
||||||
|
|
||||||
def verify_files(self):
|
def verify_files(self):
|
||||||
if dry_run:
|
if dry_run:
|
||||||
return
|
return
|
||||||
@ -1291,11 +1299,14 @@ class QubesTemplateVm(QubesVm):
|
|||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
print >> sys.stderr, "Ooops, there was a problem creating appmenus for {0} VM!".format (self.name)
|
print >> sys.stderr, "Ooops, there was a problem creating appmenus for {0} VM!".format (self.name)
|
||||||
|
|
||||||
|
def remove_appmenus(self):
|
||||||
|
subprocess.check_call ([qubes_appmenu_remove_cmd, self.name, "vm-templates"])
|
||||||
|
|
||||||
def remove_from_disk(self):
|
def remove_from_disk(self):
|
||||||
if dry_run:
|
if dry_run:
|
||||||
return
|
return
|
||||||
|
|
||||||
subprocess.check_call ([qubes_appmenu_remove_cmd, self.name, "vm-templates"])
|
self.remove_appmenus()
|
||||||
super(QubesTemplateVm, self).remove_from_disk()
|
super(QubesTemplateVm, self).remove_from_disk()
|
||||||
|
|
||||||
def verify_files(self):
|
def verify_files(self):
|
||||||
@ -1801,12 +1812,7 @@ class QubesAppVm(QubesVm):
|
|||||||
if dry_run:
|
if dry_run:
|
||||||
return
|
return
|
||||||
|
|
||||||
vmtype = ''
|
self.remove_appmenus()
|
||||||
if self.is_netvm():
|
|
||||||
vmtype = 'servicevms'
|
|
||||||
else:
|
|
||||||
vmtype = 'appvms'
|
|
||||||
subprocess.check_call ([qubes_appmenu_remove_cmd, self.name, vmtype])
|
|
||||||
super(QubesAppVm, self).remove_from_disk()
|
super(QubesAppVm, self).remove_from_disk()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user