Skip to content

Commit 039b7d3

Browse files
committed
Make pylint happy after python-black
1 parent ba412a9 commit 039b7d3

7 files changed

Lines changed: 34 additions & 21 deletions

File tree

qubes/storage/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,9 @@ async def destroy(self):
970970
raise self._not_implemented("destroy")
971971

972972
def init_volume(self, vm, volume_config):
973-
"""Initialize a :py:class:`qubes.storage.Volume` from `volume_config`."""
973+
"""
974+
Initialize a :py:class:`qubes.storage.Volume` from `volume_config`.
975+
"""
974976
raise self._not_implemented("init_volume")
975977

976978
async def setup(self):
@@ -1039,7 +1041,8 @@ def _not_implemented(self, method_name):
10391041

10401042

10411043
def _sanitize_config(config):
1042-
"""Helper function to convert types to appropriate strings""" # FIXME: find another solution for serializing basic types
1044+
"""Helper function to convert types to appropriate strings"""
1045+
# FIXME: find another solution for serializing basic types
10431046
result = {}
10441047
for key, value in config.items():
10451048
if isinstance(value, bool):
@@ -1109,7 +1112,9 @@ def search_pool_containing_dir(pools, dir_path):
11091112

11101113

11111114
class VmCreationManager:
1112-
"""A `ContextManager` which cleans up if volume creation fails.""" # pylint: disable=too-few-public-methods
1115+
"""A `ContextManager` which cleans up if volume creation fails."""
1116+
1117+
# pylint: disable=too-few-public-methods
11131118

11141119
def __init__(self, vm):
11151120
self.vm = vm

qubes/storage/callback.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,17 +509,15 @@ def __init__(self, pool, impl):
509509
self._cb_impl = impl #: Backend volume implementation instance.
510510

511511
async def _assert_initialized(self, **kwargs):
512-
await self._cb_pool._assert_initialized(
513-
**kwargs
514-
) # pylint: disable=protected-access
512+
# pylint: disable=protected-access
513+
await self._cb_pool._assert_initialized(**kwargs)
515514

516515
async def _callback(self, cb, cb_args=None, **kwargs):
517516
if cb_args is None:
518517
cb_args = []
519518
vol_args = [self.name, self.vid, self.source, *cb_args]
520-
await self._cb_pool._callback(
521-
cb, cb_args=vol_args, **kwargs
522-
) # pylint: disable=protected-access
519+
# pylint: disable=protected-access
520+
await self._cb_pool._callback(cb, cb_args=vol_args, **kwargs)
523521

524522
@property
525523
def backend_class(self):

qubes/storage/file.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def setup(self): # pylint: disable=invalid-overridden-method
187187

188188
@staticmethod
189189
def _vid_prefix(vm):
190-
"""Helper to create a prefix for the vid for volume""" # FIX Remove this if we drop the file backend
190+
"""Helper to create a prefix for the vid for volume"""
191+
# FIXME: remove this if we drop the file backend
191192
import qubes.vm.templatevm # pylint: disable=redefined-outer-name
192193
import qubes.vm.dispvm # pylint: disable=redefined-outer-name
193194

qubes/storage/lvm.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ async def destroy(self):
117117
pass # TODO Should we remove an existing pool?
118118

119119
def init_volume(self, vm, volume_config):
120-
"""Initialize a :py:class:`qubes.storage.Volume` from `volume_config`."""
120+
"""
121+
Initialize a :py:class:`qubes.storage.Volume` from `volume_config`.
122+
"""
121123

122124
if "revisions_to_keep" not in volume_config.keys():
123125
volume_config["revisions_to_keep"] = self.revisions_to_keep
@@ -339,7 +341,9 @@ def _revision_sort_key(revision):
339341

340342

341343
class ThinVolume(qubes.storage.Volume):
342-
"""Default LVM thin volume implementation""" # pylint: disable=too-few-public-methods
344+
"""Default LVM thin volume implementation"""
345+
346+
# pylint: disable=too-few-public-methods
343347

344348
def __init__(self, volume_group, **kwargs):
345349
self.volume_group = volume_group
@@ -621,9 +625,8 @@ async def import_data(self, size):
621625
"""Returns an object that can be `open()`."""
622626
if self.is_dirty():
623627
raise qubes.storage.StoragePoolException(
624-
"Cannot import data to dirty volume {}, stop the qube first".format(
625-
self.vid
626-
)
628+
"Cannot import data to dirty volume {},"
629+
" stop the qube first".format(self.vid)
627630
)
628631
self.abort_if_import_in_progress()
629632
# pylint: disable=protected-access

qubes/storage/reflink.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,8 @@ def verify(self): # pylint: disable=invalid-overridden-method
227227
@qubes.storage.Volume.locked
228228
@_coroutinized
229229
def remove(self): # pylint: disable=invalid-overridden-method
230-
self.pool._volumes.pop(
231-
self.vid, None
232-
) # pylint: disable=protected-access
230+
# pylint: disable=protected-access
231+
self.pool._volumes.pop(self.vid, None)
233232
self._remove_all_images()
234233
_remove_empty_dir(os.path.dirname(self._path_vid))
235234
return self

qubes/vm/mix/net.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ def visible_netmask(self):
211211

212212
@staticmethod
213213
def get_ip_for_vm(vm):
214-
"""Get IP address for (appvm) domain connected to this (netvm) domain."""
214+
"""
215+
Get IP address for (appvm) domain connected to this (netvm) domain.
216+
"""
215217
import qubes.vm.dispvm # pylint: disable=redefined-outer-name
216218

217219
if isinstance(vm, qubes.vm.dispvm.DispVM):

qubes/vm/qubesvm.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@
6565

6666

6767
def _setter_kernel(self, prop, value):
68-
"""Helper for setting the domain kernel and running sanity checks on it.""" # pylint: disable=unused-argument
68+
"""
69+
Helper for setting the domain kernel and running sanity checks on it.
70+
"""
71+
# pylint: disable=unused-argument
6972
if not value:
7073
return ""
7174
value = str(value)
@@ -77,7 +80,9 @@ def _setter_kernel(self, prop, value):
7780

7881

7982
def _setter_kernelopts(self, prop, value):
80-
"""Helper for setting the domain kernelopts and running sanity checks on it."""
83+
"""
84+
Helper for setting the domain kernelopts and running sanity checks on it.
85+
"""
8186
if not value:
8287
return ""
8388
value = str(value)

0 commit comments

Comments
 (0)