Change classmethods to staticmethods (#4114)
This commit is contained in:
parent
43509d8ce1
commit
b1290672bb
|
|
@ -101,13 +101,8 @@ class Fido2:
|
|||
|
||||
return cls._cryptenroll_devices
|
||||
|
||||
@classmethod
|
||||
def fido2_enroll(
|
||||
cls,
|
||||
hsm_device: Fido2Device,
|
||||
dev_path: Path,
|
||||
password: Password,
|
||||
) -> None:
|
||||
@staticmethod
|
||||
def fido2_enroll(hsm_device: Fido2Device, dev_path: Path, password: Password) -> None:
|
||||
worker = SysCommandWorker(f'systemd-cryptenroll --fido2-device={hsm_device.path} {dev_path}', peek_output=True)
|
||||
pw_inputted = False
|
||||
pin_inputted = False
|
||||
|
|
|
|||
|
|
@ -1495,9 +1495,8 @@ class DiskEncryption:
|
|||
|
||||
return obj
|
||||
|
||||
@classmethod
|
||||
@staticmethod
|
||||
def validate_enc(
|
||||
cls,
|
||||
modifications: list[DeviceModification],
|
||||
lvm_config: LvmConfiguration | None = None,
|
||||
) -> bool:
|
||||
|
|
|
|||
|
|
@ -266,8 +266,8 @@ class WifiConfiguredNetwork:
|
|||
|
||||
return networks
|
||||
|
||||
@classmethod
|
||||
def _extract_flags(cls, flag_string: str) -> list[str]:
|
||||
@staticmethod
|
||||
def _extract_flags(flag_string: str) -> list[str]:
|
||||
pattern = r'\[([^\]]+)\]'
|
||||
|
||||
extracted_values = re.findall(pattern, flag_string)
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@ if TYPE_CHECKING:
|
|||
|
||||
|
||||
class FormattedOutput:
|
||||
@classmethod
|
||||
@staticmethod
|
||||
def _get_values(
|
||||
cls,
|
||||
o: 'DataclassInstance',
|
||||
class_formatter: str | Callable | None = None, # type: ignore[type-arg]
|
||||
filter_list: list[str] = [],
|
||||
|
|
@ -110,8 +109,8 @@ class FormattedOutput:
|
|||
|
||||
return output
|
||||
|
||||
@classmethod
|
||||
def as_columns(cls, entries: list[str], cols: int) -> str:
|
||||
@staticmethod
|
||||
def as_columns(entries: list[str], cols: int) -> str:
|
||||
"""
|
||||
Will format a list into a given number of columns
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue