Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloperezj committed May 23, 2024
1 parent 80b6beb commit 5133de7
Showing 1 changed file with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1949,12 +1949,9 @@ def file_scan_and_get_analysis(client: Client, args: dict):
extended = argToBoolean(args.get('extended_data', False))

if not args.get('id'):
command_result = file_scan(client, args)
if isinstance(command_result, list):
command_result = command_result[0]
outputs = command_result.outputs
if isinstance(outputs, list):
outputs = outputs[0]
command_results = file_scan(client, args)
command_result = command_results[0]
outputs: dict = command_result.outputs
scheduled_command = ScheduledCommand(
command=f'{COMMAND_PREFIX}-file-scan-and-analysis-get',
next_run_in_seconds=interval,
Expand All @@ -1970,9 +1967,7 @@ def file_scan_and_get_analysis(client: Client, args: dict):
return command_result

command_result = get_analysis_command(client, args)
outputs = command_result.outputs
if isinstance(outputs, list):
outputs = outputs[0]
outputs: dict = command_result.outputs
if outputs.get('data', {}).get('attributes', {}).get('status') == 'completed':
return command_result
scheduled_command = ScheduledCommand(
Expand All @@ -1995,12 +1990,9 @@ def private_file_scan_and_get_analysis(client: Client, args: dict):
extended = argToBoolean(args.get('extended_data', False))

if not args.get('id'):
command_result = private_file_scan(client, args)
if isinstance(command_result, list):
command_result = command_result[0]
outputs = command_result.outputs
if isinstance(outputs, list):
outputs = outputs[0]
command_results = private_file_scan(client, args)
command_result = command_results[0]
outputs: dict = command_result.outputs
scheduled_command = ScheduledCommand(
command=f'{COMMAND_PREFIX}-private-file-and-analysis-get',
next_run_in_seconds=interval,
Expand All @@ -2016,9 +2008,7 @@ def private_file_scan_and_get_analysis(client: Client, args: dict):
return command_result

command_result = private_get_analysis_command(client, args)
outputs = command_result.outputs
if isinstance(outputs, list):
outputs = outputs[0]
outputs: dict = command_result.outputs
if outputs.get('data', {}).get('attributes', {}).get('status') == 'completed':
return command_result
scheduled_command = ScheduledCommand(
Expand All @@ -2042,9 +2032,7 @@ def url_scan_and_get_analysis(client: Client, args: dict):

if not args.get('id'):
command_result = scan_url_command(client, args)
outputs = command_result.outputs
if isinstance(outputs, list):
outputs = outputs[0]
outputs: dict = command_result.outputs
scheduled_command = ScheduledCommand(
command=f'{COMMAND_PREFIX}-url-scan-and-analysis-get',
next_run_in_seconds=interval,
Expand All @@ -2060,9 +2048,7 @@ def url_scan_and_get_analysis(client: Client, args: dict):
return command_result

command_result = get_analysis_command(client, args)
outputs = command_result.outputs
if isinstance(outputs, list):
outputs = outputs[0]
outputs: dict = command_result.outputs
if outputs.get('data', {}).get('attributes', {}).get('status') == 'completed':
return command_result
scheduled_command = ScheduledCommand(
Expand Down

0 comments on commit 5133de7

Please sign in to comment.