Skip to content

Commit

Permalink
[PR #5927/33df7b61 backport][stable-6] Set User-Agent for API request…
Browse files Browse the repository at this point in the history
…s to DNSimple (#6005)

Set User-Agent for API requests to DNSimple (#5927)

* Set the user-agent for API requests to DNSimple

* Update user agent format

* Add changelog fragment

* Update changelogs/fragments/5927-set-user-agent-dnsimple.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 33df7b6)

Co-authored-by: Ivan Bakalov <ibbakalov@gmail.com>
  • Loading branch information
patchback[bot] and DXTimer authored Feb 17, 2023
1 parent 4266163 commit 00d1160
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/5927-set-user-agent-dnsimple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "dnsimple - set custom User-Agent for API requests to DNSimple (https://github.com/ansible-collections/community.general/pull/5927)."
2 changes: 1 addition & 1 deletion plugins/modules/dnsimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __init__(self, account_email, account_api_token, sandbox, module):
def dnsimple_client(self):
"""creates a dnsimple client object"""
if self.account_email and self.account_api_token:
client = Client(sandbox=self.sandbox, email=self.account_email, access_token=self.account_api_token)
client = Client(sandbox=self.sandbox, email=self.account_email, access_token=self.account_api_token, user_agent="ansible/community.general")
else:
msg = "Option account_email or account_api_token not provided. " \
"Dnsimple authentiction with a .dnsimple config file is not " \
Expand Down

0 comments on commit 00d1160

Please sign in to comment.