opsgenie-python-sdk icon indicating copy to clipboard operation
opsgenie-python-sdk copied to clipboard

Deprecated function is removed from external package

Open norbinto opened this issue 3 years ago • 3 comments

Dear Opsgenie,

We are facing with an issue with the SDK. We use the version 2.0.3 You use an external package called "tenacity" In the requirements you declare it as "tenacity>= 5.0.4" api_client.py, line 197, "response_data = self.retrying.call(...)" With the latest version of tenacity retry.call function is not only deprecated anymore but even removed. It was realised at 8th of July. https://github.com/jd/tenacity/blob/master/releasenotes/notes/drop_deprecated-7ea90b212509b082.yaml And it is breaking right now.

norbinto avatar Jul 08 '21 15:07 norbinto

Yes! We are also facing similar issue with opsgenie and we cannot afford upgrading version of opsgenie, as it uses another dependency package called urllib, whose upgraded version is not suitable for our system. It would be great if we could get stable and workable version of 2.0.3.

Also, just a advice, it would be great if you defined correct version for each release in requirements. So, each version you release is workable. Otherwise, it's quite difficult to use the sdk

nikitashrestha avatar Jul 09 '21 11:07 nikitashrestha

We are using the opsgenie sdk to trigger alerts. Running a heartbeat_api.ping we end up with the following (partial) stacktrace

line 628, in ping (data) = self.ping_with_http_info(name, **kwargs) # noqa: E501 File "/home/site/wwwroot/.python_packages/lib/site-packages/opsgenie_sdk/api/heartbeat/__init__.py", 
line 689, in ping_with_http_info return self.api_client.call_api( File "/home/site/wwwroot/.python_packages/lib/site-packages/opsgenie_sdk/api_client.py", 
line 424, in call_api return self.__call_api(resource_path, method, File "/home/site/wwwroot/.python_packages/lib/site-packages/opsgenie_sdk/api_client.py", 
line 219, in __call_api raise exception File "/home/site/wwwroot/.python_packages/lib/site-packages/opsgenie_sdk/api_client.py", 
line 197, in __call_api response_data = self.retrying.call(fn=self.request, method=method, url=url,

As @norbinto mentioned above we too suspect this to be related to the 8.0.0 release of tenacity and the lack of restricting the auto-upgrade. Changing the version of tenacity to tenacity >= 5.0.4, < 8.0.0 in our requirements.txt worked for us as an intermediate fix but would be better to have the fix upstream.

Temporary fix PR created (#58) until all the method calls are updated to be compliant with 8.0.0 release of tenacity or switch to another library

mikhailadvani avatar Jul 12 '21 08:07 mikhailadvani

My bad. Not needed. The correct fix was already in place and we had not updated the opsgenie-sdk

mikhailadvani avatar Jul 12 '21 12:07 mikhailadvani