From 7ff456ec5ef0fa899ca67966351e5f861e741dcd Mon Sep 17 00:00:00 2001 From: Philipp Eder Date: Tue, 10 Dec 2024 09:21:31 +0000 Subject: [PATCH] Refactor: formatting --- ospd_openvas/preferencehandler.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ospd_openvas/preferencehandler.py b/ospd_openvas/preferencehandler.py index 6551b70e..6138090e 100644 --- a/ospd_openvas/preferencehandler.py +++ b/ospd_openvas/preferencehandler.py @@ -579,7 +579,7 @@ def prepare_scan_params_for_openvas(self, ospd_params: Dict[str, Dict]): def disable_message(self, disabled: str) -> str: """Return a string with the message for exclusive services.""" - disabled = "Disabled {}".format(disabled) + disabled = "Disabled {}".format(disabled) return disabled + ": KRB5 and SMB credentials are mutually exclusive." def build_credentials_as_prefs(self, credentials: Dict) -> List[str]: @@ -591,7 +591,7 @@ def build_credentials_as_prefs(self, credentials: Dict) -> List[str]: A list with the credentials in string format to be added to the redis KB. """ - + cred_prefs_list = [] krb5_set = False smb_set = False @@ -674,9 +674,7 @@ def build_credentials_as_prefs(self, credentials: Dict) -> List[str]: # Check servic smb elif service == 'smb': if krb5_set: - self.errors.append( - self.disable_message("SMB") - ) + self.errors.append(self.disable_message("SMB")) continue smb_set = True cred_prefs_list.append( @@ -687,9 +685,7 @@ def build_credentials_as_prefs(self, credentials: Dict) -> List[str]: ) elif service == 'krb5': if smb_set: - self.errors.append( - self.disable_message("KRB5") - ) + self.errors.append(self.disable_message("KRB5")) continue krb5_set = True realm = cred_params.get('realm', '')