Browse Source

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
Marek Marczykowski-Górecki 7 years ago
parent
commit
80c0093c77
1 changed files with 3 additions and 0 deletions
  1. 3 0
      qubes/app.py

+ 3 - 0
qubes/app.py

@@ -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)