-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update new elastic search request #105
Conversation
sarathbrp
commented
Jan 10, 2024
- Added verification is set to False since new elastic search uses https
- And while making requests it uses authentication header where it fetches key from Jenkins pipeline
added verification false for https
@@ -6,7 +6,7 @@ | |||
|
|||
|
|||
session = requests.Session() | |||
|
|||
session.verify=False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Sarath. This is a generic library. Do not do changes like this here.
|
||
import opl.http | ||
import opl.status_data | ||
|
||
# Environment variables for OpenSearch credentials | ||
open_search_username = "insights_perf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not hardcode stuff here. This should come from investigator config.
|
||
import opl.http | ||
import opl.status_data | ||
|
||
# Environment variables for OpenSearch credentials | ||
open_search_username = "insights_perf" | ||
open_search_password = os.environ.get('OPEN_SEARCH_PASSWORD') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add name of the variable to investigator config just to force user to understand it is needed.
@@ -21,7 +26,7 @@ def load(server, index, query, paths): | |||
f"Querying ES with url={url}, headers={headers} and json={json.dumps(data)}" | |||
) | |||
|
|||
response = opl.http.get(url, headers=headers, json=data) | |||
response = opl.http.get(url, auth=HTTPBasicAuth(open_search_username, open_search_password), headers=headers, json=data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not backwards compatible. We will not be able to migrate all our tests at one moment. We need the change that will not break current setup.