Browse Source

storage/reflink: prefer canonical values for setup_check

Rusty Bird 3 years ago
parent
commit
c2ce28936e
3 changed files with 4 additions and 4 deletions
  1. 1 1
      qubes/app.py
  2. 2 2
      qubes/storage/reflink.py
  3. 1 1
      qubes/tests/integ/storage.py

+ 1 - 1
qubes/app.py

@@ -1227,7 +1227,7 @@ class Qubes(qubes.PropertyHolder):
                     os.makedirs(config['dir_path'], exist_ok=True)
                     if qubes.storage.reflink.is_supported(config['dir_path']):
                         config['driver'] = 'file-reflink'
-                        config['setup_check'] = 'no'  # don't check twice
+                        config['setup_check'] = False  # don't check twice
                 except PermissionError:  # looks like a testing environment
                     pass  # stay with 'file'
             self.pools[name] = self._get_pool(**config)

+ 2 - 2
qubes/storage/reflink.py

@@ -58,7 +58,7 @@ class ReflinkPool(qubes.storage.Pool):
     driver = 'file-reflink'
     _known_dir_path_prefixes = ['appvms', 'vm-templates']
 
-    def __init__(self, dir_path, setup_check='yes', revisions_to_keep=1,
+    def __init__(self, dir_path, setup_check=True, revisions_to_keep=1,
                  **kwargs):
         super().__init__(revisions_to_keep=revisions_to_keep, **kwargs)
         self._setup_check = qubes.property.bool(None, None, setup_check)
@@ -74,7 +74,7 @@ class ReflinkPool(qubes.storage.Pool):
             raise qubes.storage.StoragePoolException(
                 'The filesystem for {!r} does not support reflinks. If you'
                 ' can live with VM startup delays and wasted disk space, pass'
-                ' the "setup_check=no" option.'.format(self.dir_path))
+                ' the "setup_check=False" option.'.format(self.dir_path))
         for dir_path_prefix in self._known_dir_path_prefixes:
             _make_dir(os.path.join(self.dir_path, dir_path_prefix))
         return self

+ 1 - 1
qubes/tests/integ/storage.py

@@ -367,7 +367,7 @@ class StorageReflinkOnBtrfs(StorageReflinkMixin, qubes.tests.SystemTestCase):
 
 class StorageReflinkOnExt4(StorageReflinkMixin, qubes.tests.SystemTestCase):
     def init_pool(self):
-        super().init_pool('ext4', setup_check='no')
+        super().init_pool('ext4', setup_check=False)
 
 
 @qubes.tests.storage_lvm.skipUnlessLvmPoolExists