linode module utils: update import to recent Ansible level (#10906)

* linode module utils: update import to recent Ansible level

* add changelog frag
This commit is contained in:
Alexei Znamensky
2025-10-12 00:42:19 +13:00
committed by GitHub
parent cc83188594
commit 85053728ce
2 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,2 @@
minor_changes:
- linode module utils - remove redundant code for ancient versions of Ansible (https://github.com/ansible-collections/community.general/pull/10906).

View File

@@ -11,11 +11,9 @@
from __future__ import annotations
from ansible.module_utils.ansible_release import __version__ as ansible_version
def get_user_agent(module):
"""Retrieve a user-agent to send with LinodeClient requests."""
try:
from ansible.module_utils.ansible_release import __version__ as ansible_version
except ImportError:
ansible_version = 'unknown'
return f'Ansible-{module}/{ansible_version}'