From 6997cb8eba3ac45536f12b6570e1b766f65eb70b Mon Sep 17 00:00:00 2001 From: Matt Wyen Date: Fri, 19 Apr 2024 15:50:00 -0400 Subject: [PATCH] fix looping days --- src/rapid7/api_r7_isvm_sonar_add.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rapid7/api_r7_isvm_sonar_add.py b/src/rapid7/api_r7_isvm_sonar_add.py index 1932a1f..bb62fea 100644 --- a/src/rapid7/api_r7_isvm_sonar_add.py +++ b/src/rapid7/api_r7_isvm_sonar_add.py @@ -69,6 +69,10 @@ def main(): # Clean data by stripping any leading/trailing whitespace from string data df = df.apply(lambda x: x.map(str.strip) if x.dtype == "object" else x) + # Prompt for days + days = input("Enter the number of days for 'scan-date-within-the-last' (default 30): ").strip() + days = int(days) if days.isdigit() else 30 + # Loop over rows in DataFrame for _, row in df.iterrows(): filters = [] @@ -93,9 +97,6 @@ def main(): print(f"Invalid target: {target}") continue - # Prompt for days - days = input("Enter the number of days for 'scan-date-within-the-last' (default 30): ").strip() - days = int(days) if days.isdigit() else 30 filters.append({ "type": "scan-date-within-the-last", "days": days