Skip to content

Fix user_deprovision: use is_success from python-pagerduty SDK#145

Open
gian25-work wants to merge 1 commit into
PagerDuty:masterfrom
gian25-work:fix/user-deprovision-pagerduty-sdk-response
Open

Fix user_deprovision: use is_success from python-pagerduty SDK#145
gian25-work wants to merge 1 commit into
PagerDuty:masterfrom
gian25-work:fix/user-deprovision-pagerduty-sdk-response

Conversation

@gian25-work

Copy link
Copy Markdown

Summary

  • After the recent migration from pdpyras to python-pagerduty (commit 89b773f), DeleteUser.delete_user still returns r.ok.
  • The new SDK's response object is httpx-style and exposes is_success, not the requests-style ok attribute, so delete_user raises AttributeError on every successful deletion.
  • One-line fix replacing r.ok with r.is_success in user_deprovision/user_deprovision.py.

Test plan

  • Run user_deprovision.py against a test PagerDuty account and confirm a user is deleted without AttributeError.
  • Verify the return value is True on a successful delete (HTTP 2xx).

The pdpyras→python-pagerduty migration switched the underlying HTTP
client; the response object exposes is_success (httpx-style) rather
than the requests-style ok attribute, so delete_user always raised
AttributeError on success.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant