qubes/tools/qubes-create: reject overriding existing qubes.xml

If someone really want do to this, need to manually remove the file
first.

QubesOS/qubes-issues#2412
This commit is contained in:
Marek Marczykowski-Górecki 2016-11-02 06:10:54 +01:00
parent c08766e157
commit 80c0093c77
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -870,6 +870,9 @@ class Qubes(qubes.PropertyHolder):
@classmethod
def create_empty_store(cls, lock=False, *args, **kwargs):
self = cls(*args, load=False, **kwargs)
if os.path.exists(self.store):
raise qubes.exc.QubesException(
'{} already exists, aborting'.format(self.store))
self.load_initial_values()
self.save(lock=lock)