more flexible config support

This commit is contained in:
pemontto
2019-04-29 16:55:17 +01:00
parent 47409ba0b9
commit eb9695605b
2 changed files with 8 additions and 4 deletions

View File

@ -46,8 +46,8 @@ class NessusAPI(object):
self.logger = logging.getLogger('NessusAPI')
if verbose:
self.logger.setLevel(logging.DEBUG)
if username is None or password is None:
raise Exception('ERROR: Missing username or password.')
if not all((username, password)) and not all((access_key, secret_key)):
raise Exception('ERROR: Missing username, password or API keys.')
self.user = username
self.password = password