Skip to content
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

[f5bigipltm] - Bugfix: Remove requests dependency #9

Merged
merged 12 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright (c) 2019-2022 Splunk Inc.
Copyright (c) 2019-2024 Splunk Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Splunk SOAR F5 BIG-IP LTM
Copyright (c) 2019-2022 Splunk Inc.
Copyright (c) 2019-2024 Splunk Inc.

Third-party Software Attributions:

Expand Down
820 changes: 410 additions & 410 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: __init__.py
#
# Copyright (c) 2019-2022 Splunk Inc.
# Copyright (c) 2019-2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
36 changes: 14 additions & 22 deletions f5bigipltm.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"product_name": "Local Traffic Manager",
"product_version_regex": ".*",
"publisher": "Splunk",
"license": "Copyright (c) 2019-2022 Splunk Inc.",
"license": "Copyright (c) 2019-2024 Splunk Inc.",
"app_version": "2.1.1",
"python_version": "3",
"fips_compliant": true,
"utctime_updated": "2022-01-19T00:53:17.000000Z",
"package_name": "phantom_f5bigipltm",
"main_module": "f5bigipltm_connector.py",
"min_phantom_version": "5.1.0",
"min_phantom_version": "6.1.1",
"app_wizard_version": "1.0.0",
"latest_tested_versions": [
"BIG-IP 15.0.0 Build 0.0.39 Final"
Expand Down Expand Up @@ -3252,32 +3252,24 @@
"wheel": [
{
"module": "beautifulsoup4",
"input_file": "wheels/beautifulsoup4-4.9.1-py3-none-any.whl"
"input_file": "wheels/py3/beautifulsoup4-4.9.1-py3-none-any.whl"
},
{
"module": "certifi",
"input_file": "wheels/certifi-2021.10.8-py2.py3-none-any.whl"
},
{
"module": "chardet",
"input_file": "wheels/chardet-3.0.4-py2.py3-none-any.whl"
},
{
"module": "idna",
"input_file": "wheels/idna-2.10-py2.py3-none-any.whl"
},
"module": "soupsieve",
"input_file": "wheels/py3/soupsieve-2.3.2.post1-py3-none-any.whl"
}
]
},
"pip39_dependencies": {
"wheel": [
{
"module": "requests",
"input_file": "wheels/requests-2.25.0-py2.py3-none-any.whl"
"module": "beautifulsoup4",
"input_file": "wheels/py3/beautifulsoup4-4.9.1-py3-none-any.whl"
},
{
"module": "soupsieve",
"input_file": "wheels/soupsieve-2.3.1-py3-none-any.whl"
},
{
"module": "urllib3",
"input_file": "wheels/urllib3-1.26.7-py2.py3-none-any.whl"
"input_file": "wheels/py3/soupsieve-2.5-py3-none-any.whl"
}
]
}
}
}
14 changes: 7 additions & 7 deletions f5bigipltm_connector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: f5bigipltm_connector.py
#
# Copyright (c) 2019-2022 Splunk Inc.
# Copyright (c) 2019-2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -112,9 +112,9 @@ def _process_json_response(self, r, action_result):
message = "Error from server. Status Code: {0} Data from server: {1}".format(
r.status_code, error_msg)
except Exception as e:
_, error_msg = self._get_error_message_from_exception(e)
_, error_message = self._get_error_message_from_exception(e)
message = "Unknown error occurred while processing the output response from the server. " \
"Status Code: {0}. Data from server: {1}".format(r.status_code, error_msg)
"Status Code: {0}. Data from server: {1}".format(r.status_code, error_message)

return RetVal(action_result.set_status(phantom.APP_ERROR, message), None)

Expand Down Expand Up @@ -213,9 +213,9 @@ def _make_rest_call(self, endpoint, action_result, method="get", data=None, **kw
try:
url = "{}{}".format(self._base_url, endpoint)
except Exception as e:
error_code, error_msg = self._get_error_message_from_exception(e)
error_code, error_message = self._get_error_message_from_exception(e)
return RetVal(action_result.set_status(phantom.APP_ERROR, "Error occurred while creating the REST URL for the API call. "
"Error Code: {0}. Error Message: {1}".format(error_code, error_msg)), None)
"Error Code: {0}. Error Message: {1}".format(error_code, error_message)), None)

try:
r = request_func(
Expand All @@ -225,9 +225,9 @@ def _make_rest_call(self, endpoint, action_result, method="get", data=None, **kw
data=data,
**kwargs)
except Exception as e:
error_code, error_msg = self._get_error_message_from_exception(e)
error_code, error_message = self._get_error_message_from_exception(e)
return RetVal(action_result.set_status(phantom.APP_ERROR, "Error occurred while making the REST call to the F5 server. "
"Error Code: {0}. Error Message: {1}".format(error_code, error_msg)), None)
"Error Code: {0}. Error Message: {1}".format(error_code, error_message)), None)

return self._process_response(r, action_result)

Expand Down
1 change: 1 addition & 0 deletions release_notes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**Unreleased**
* Remove requests dependency and use the one built into the platform instead
sodle-splunk marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
beautifulsoup4==4.9.1
requests==2.25.0
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[flake8]
max-line-length = 145
max-complexity = 28
ignore = F403,E128,E126,E111,E121,E127,E731,E201,E202,F405,E722,D,W292
extend-ignore = F403,E128,E126,E111,E121,E127,E731,E201,E202,F405,E722,D,W292

[isort]
line_length = 145
Binary file removed wheels/certifi-2021.10.8-py2.py3-none-any.whl
Binary file not shown.
Binary file removed wheels/chardet-3.0.4-py2.py3-none-any.whl
Binary file not shown.
Binary file removed wheels/idna-2.10-py2.py3-none-any.whl
Binary file not shown.
Binary file added wheels/py3/soupsieve-2.3.2.post1-py3-none-any.whl
Binary file not shown.
Binary file added wheels/py3/soupsieve-2.5-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/requests-2.25.0-py2.py3-none-any.whl
Binary file not shown.
Binary file removed wheels/soupsieve-2.3.1-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/urllib3-1.26.7-py2.py3-none-any.whl
Binary file not shown.
Loading