@@ -73,11 +73,10 @@ def random_string(length):
7373 :param length: Length of random part of string
7474 :return: String
7575 """
76- return f' stratis_{ "" .join (random .choice (string .ascii_uppercase ) for _ in range (length ))} '
76+ return f" stratis_{ '' .join (random .choice (string .ascii_uppercase ) for _ in range (length ))} "
7777
7878
79- # pylint: disable=too-many-statements
80- def create_pool (
79+ def create_pool ( # noqa: PLR0915
8180 name , devices , * , key_description = None , clevis_info = None , overprovision = True
8281):
8382 """
@@ -119,11 +118,7 @@ def create_legacy_pool():
119118 else :
120119 cmdline .extend (["--thumbprint" , thp ])
121120
122- with subprocess .Popen (
123- cmdline ,
124- text = True ,
125- stdin = subprocess .PIPE ,
126- ) as process :
121+ with subprocess .Popen (cmdline , text = True , stdin = subprocess .PIPE ) as process :
127122 process .stdin .write ( # pyright: ignore [reportOptionalMemberAccess]
128123 f"Yes{ os .linesep } "
129124 )
@@ -137,7 +132,7 @@ def create_legacy_pool():
137132 newly_created = True
138133
139134 i = 0
140- while get_pools (name ) == [] and i < 5 :
135+ while get_pools (name ) == [] and i < 5 : # noqa PLR2004
141136 i += 1
142137 time .sleep (1 )
143138 (pool_object_path , _ ) = next (iter (get_pools (name )))
@@ -165,13 +160,10 @@ def create_v2_pool():
165160 dbus_slot = (True , slot )
166161
167162 if pin == "tang" :
168- (pin , config ) = (
169- "tang" ,
170- json .dumps (
171- {"url" : tang_url , "stratis:tang:trust_url" : True }
172- if thp is None
173- else {"url" : tang_url , "thp" : thp }
174- ),
163+ config = json .dumps (
164+ {"url" : tang_url , "stratis:tang:trust_url" : True }
165+ if thp is None
166+ else {"url" : tang_url , "thp" : thp }
175167 )
176168 else :
177169 raise RuntimeError (
@@ -350,8 +342,8 @@ def wait_for_udev(fs_type, expected_paths):
350342
351343 except RetryError as err :
352344 raise RuntimeError (
353- f' Found unexpected devnodes: expected devnodes: { ", " .join (expected_devnodes )} '
354- f' != found_devnodes: { ", " .join (err .last_attempt .result ())} '
345+ f" Found unexpected devnodes: expected devnodes: { ', ' .join (expected_devnodes )} "
346+ f" != found_devnodes: { ', ' .join (err .last_attempt .result ())} "
355347 ) from err
356348
357349
@@ -389,9 +381,8 @@ def start_service(self):
389381 if next (processes ("stratisd" ), None ) is not None :
390382 raise RuntimeError ("A stratisd process is already running" )
391383
392- service = subprocess .Popen ( # pylint: disable=consider-using-with
393- [x for x in _STRATISD .split (" " ) if x != "" ],
394- text = True ,
384+ service = subprocess .Popen (
385+ [x for x in _STRATISD .split (" " ) if x != "" ], text = True
395386 )
396387
397388 try :
@@ -462,10 +453,7 @@ def __enter__(self):
462453 with open (temp_file .name , "r" , encoding = "utf-8" ) as fd_for_dbus :
463454 (_ , return_code , message ) = Manager .Methods .SetKey (
464455 get_object (TOP_OBJECT ),
465- {
466- "key_desc" : key_desc ,
467- "key_fd" : fd_for_dbus .fileno (),
468- },
456+ {"key_desc" : key_desc , "key_fd" : fd_for_dbus .fileno ()},
469457 )
470458
471459 if return_code != StratisdErrors .OK :
0 commit comments