1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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>
This commit is contained in:
Ivan Bakalov 2023-02-17 08:48:46 +02:00 committed by GitHub
parent 24efe9ee9a
commit 33df7b61c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -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)."

View file

@ -168,7 +168,7 @@ class DNSimpleV2():
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 " \