mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
Fix get_distribution for Alpine Linux (#17224)
To override a generic class that is subclassed based on platform, the subclass must define platform and distribution. The load_platform_subclass() calls the get_platform() and get_distribution() methods to detect the platform and the distribution. On Alpine Linux, get_distribution() method returns None and it is not possible to have different implementations based on detected platform.
This commit is contained in:
parent
3ab9dddb3a
commit
8fd3935029
1 changed files with 1 additions and 1 deletions
|
@ -218,7 +218,7 @@ def get_distribution():
|
|||
''' return the distribution name '''
|
||||
if platform.system() == 'Linux':
|
||||
try:
|
||||
supported_dists = platform._supported_dists + ('arch',)
|
||||
supported_dists = platform._supported_dists + ('arch','alpine')
|
||||
distribution = platform.linux_distribution(supported_dists=supported_dists)[0].capitalize()
|
||||
if not distribution and os.path.isfile('/etc/system-release'):
|
||||
distribution = platform.linux_distribution(supported_dists=['system'])[0].capitalize()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue