Merge remote-tracking branch 'qubesos/pr/176'

* qubesos/pr/176:
  Do not remove VMs installed via rpm
This commit is contained in:
Marek Marczykowski-Górecki 2018-01-05 16:27:12 +01:00
commit d83a07177b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1052,6 +1052,10 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI):
if not self.dest.is_halted():
raise qubes.exc.QubesVMNotHaltedError(self.dest)
if self.dest.installed_by_rpm:
raise qubes.exc.QubesVMInUseError(self.dest, \
"VM installed by package manager: " + self.dest.name)
del self.app.domains[self.dest]
try:
yield from self.dest.remove_from_disk()