Skip to content

Commit

Permalink
Set User-Agent for API requests to DNSimple (#5927)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
DXTimer and felixfontein authored Feb 17, 2023
1 parent 24efe9e commit 33df7b6
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 33df7b6

Please sign in to comment.