diff --git a/qubes/storage/__init__.py b/qubes/storage/__init__.py index ecbf04452..5577728b4 100644 --- a/qubes/storage/__init__.py +++ b/qubes/storage/__init__.py @@ -970,7 +970,9 @@ async def destroy(self): raise self._not_implemented("destroy") def init_volume(self, vm, volume_config): - """Initialize a :py:class:`qubes.storage.Volume` from `volume_config`.""" + """ + Initialize a :py:class:`qubes.storage.Volume` from `volume_config`. + """ raise self._not_implemented("init_volume") async def setup(self): @@ -1039,7 +1041,8 @@ def _not_implemented(self, method_name): def _sanitize_config(config): - """Helper function to convert types to appropriate strings""" # FIXME: find another solution for serializing basic types + """Helper function to convert types to appropriate strings""" + # FIXME: find another solution for serializing basic types result = {} for key, value in config.items(): if isinstance(value, bool): @@ -1109,7 +1112,9 @@ def search_pool_containing_dir(pools, dir_path): class VmCreationManager: - """A `ContextManager` which cleans up if volume creation fails.""" # pylint: disable=too-few-public-methods + """A `ContextManager` which cleans up if volume creation fails.""" + + # pylint: disable=too-few-public-methods def __init__(self, vm): self.vm = vm diff --git a/qubes/storage/callback.py b/qubes/storage/callback.py index ce18278ea..8b3a7a864 100644 --- a/qubes/storage/callback.py +++ b/qubes/storage/callback.py @@ -509,17 +509,15 @@ def __init__(self, pool, impl): self._cb_impl = impl #: Backend volume implementation instance. async def _assert_initialized(self, **kwargs): - await self._cb_pool._assert_initialized( - **kwargs - ) # pylint: disable=protected-access + # pylint: disable=protected-access + await self._cb_pool._assert_initialized(**kwargs) async def _callback(self, cb, cb_args=None, **kwargs): if cb_args is None: cb_args = [] vol_args = [self.name, self.vid, self.source, *cb_args] - await self._cb_pool._callback( - cb, cb_args=vol_args, **kwargs - ) # pylint: disable=protected-access + # pylint: disable=protected-access + await self._cb_pool._callback(cb, cb_args=vol_args, **kwargs) @property def backend_class(self): diff --git a/qubes/storage/file.py b/qubes/storage/file.py index b44997afe..d47ff7392 100644 --- a/qubes/storage/file.py +++ b/qubes/storage/file.py @@ -187,7 +187,8 @@ def setup(self): # pylint: disable=invalid-overridden-method @staticmethod def _vid_prefix(vm): - """Helper to create a prefix for the vid for volume""" # FIX Remove this if we drop the file backend + """Helper to create a prefix for the vid for volume""" + # FIXME: remove this if we drop the file backend import qubes.vm.templatevm # pylint: disable=redefined-outer-name import qubes.vm.dispvm # pylint: disable=redefined-outer-name diff --git a/qubes/storage/lvm.py b/qubes/storage/lvm.py index d10746894..1012bb3fb 100644 --- a/qubes/storage/lvm.py +++ b/qubes/storage/lvm.py @@ -117,7 +117,9 @@ async def destroy(self): pass # TODO Should we remove an existing pool? def init_volume(self, vm, volume_config): - """Initialize a :py:class:`qubes.storage.Volume` from `volume_config`.""" + """ + Initialize a :py:class:`qubes.storage.Volume` from `volume_config`. + """ if "revisions_to_keep" not in volume_config.keys(): volume_config["revisions_to_keep"] = self.revisions_to_keep @@ -339,7 +341,9 @@ def _revision_sort_key(revision): class ThinVolume(qubes.storage.Volume): - """Default LVM thin volume implementation""" # pylint: disable=too-few-public-methods + """Default LVM thin volume implementation""" + + # pylint: disable=too-few-public-methods def __init__(self, volume_group, **kwargs): self.volume_group = volume_group @@ -621,9 +625,8 @@ async def import_data(self, size): """Returns an object that can be `open()`.""" if self.is_dirty(): raise qubes.storage.StoragePoolException( - "Cannot import data to dirty volume {}, stop the qube first".format( - self.vid - ) + "Cannot import data to dirty volume {}," + " stop the qube first".format(self.vid) ) self.abort_if_import_in_progress() # pylint: disable=protected-access diff --git a/qubes/storage/reflink.py b/qubes/storage/reflink.py index a7168f950..42e325dc0 100644 --- a/qubes/storage/reflink.py +++ b/qubes/storage/reflink.py @@ -227,9 +227,8 @@ def verify(self): # pylint: disable=invalid-overridden-method @qubes.storage.Volume.locked @_coroutinized def remove(self): # pylint: disable=invalid-overridden-method - self.pool._volumes.pop( - self.vid, None - ) # pylint: disable=protected-access + # pylint: disable=protected-access + self.pool._volumes.pop(self.vid, None) self._remove_all_images() _remove_empty_dir(os.path.dirname(self._path_vid)) return self diff --git a/qubes/vm/mix/net.py b/qubes/vm/mix/net.py index 82d511a66..24702cdaf 100644 --- a/qubes/vm/mix/net.py +++ b/qubes/vm/mix/net.py @@ -211,7 +211,9 @@ def visible_netmask(self): @staticmethod def get_ip_for_vm(vm): - """Get IP address for (appvm) domain connected to this (netvm) domain.""" + """ + Get IP address for (appvm) domain connected to this (netvm) domain. + """ import qubes.vm.dispvm # pylint: disable=redefined-outer-name if isinstance(vm, qubes.vm.dispvm.DispVM): diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index b10c5fb5d..195b28510 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -65,7 +65,10 @@ def _setter_kernel(self, prop, value): - """Helper for setting the domain kernel and running sanity checks on it.""" # pylint: disable=unused-argument + """ + Helper for setting the domain kernel and running sanity checks on it. + """ + # pylint: disable=unused-argument if not value: return "" value = str(value) @@ -77,7 +80,9 @@ def _setter_kernel(self, prop, value): def _setter_kernelopts(self, prop, value): - """Helper for setting the domain kernelopts and running sanity checks on it.""" + """ + Helper for setting the domain kernelopts and running sanity checks on it. + """ if not value: return "" value = str(value)