Skip to content

Commit

Permalink
Refactor create_sonar_query function and update status code handling
Browse files Browse the repository at this point in the history
  • Loading branch information
talltechy committed Apr 19, 2024
1 parent 089cff9 commit 4a13ad4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rapid7/api_r7_isvm_sonar_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import requests
from dotenv import dotenv_values
from requests.auth import HTTPBasicAuth
from status_codes import create_sonar_query_sm
from api_r7_status_codes import create_sonar_query_sm

secrets = dotenv_values(".env")

Expand Down Expand Up @@ -35,7 +35,7 @@ def create_sonar_query(url, name, criteria, username, password):
"name": name,
"criteria": criteria
}
response = requests.post(url, auth=HTTPBasicAuth(username, password), headers=headers, json=payload, timeout=1, verify=False)
response = requests.post(url, auth=HTTPBasicAuth(username, password), headers=headers, json=payload, timeout=10, verify=False)

# Get the user-friendly message based on the status code
message = create_sonar_query_sm(response.status_code, response)
Expand Down
File renamed without changes.

0 comments on commit 4a13ad4

Please sign in to comment.