storage/reflink: prefer canonical values for setup_check

This commit is contained in:
Rusty Bird 2020-06-22 14:03:19 +00:00
parent 6f2d82fd20
commit c2ce28936e
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF
3 changed files with 4 additions and 4 deletions

View File

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

View File

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

View File

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