Skip to content

Commit

Permalink
Refactor: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtsfrei committed Dec 10, 2024
1 parent b59c433 commit 7ff456e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions ospd_openvas/preferencehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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', '')
Expand Down

0 comments on commit 7ff456e

Please sign in to comment.