mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Port from plaform.dist to ansible.module_utils.distro.linux_distribution
ci_complete
This commit is contained in:
@@ -3,17 +3,21 @@
|
||||
"""
|
||||
This script generated test_cases for test_distribution_version.py.
|
||||
|
||||
To do so it outputs the relevant files from /etc/*release, the output of platform.dist() and the current ansible_facts regarding the distribution version.
|
||||
To do so it outputs the relevant files from /etc/*release, the output of distro.linux_distribution()
|
||||
and the current ansible_facts regarding the distribution version.
|
||||
|
||||
This assumes a working ansible version in the path.
|
||||
"""
|
||||
|
||||
import platform
|
||||
|
||||
import os.path
|
||||
import subprocess
|
||||
import json
|
||||
import sys
|
||||
|
||||
from ansible.module_utils import distro
|
||||
|
||||
|
||||
filelist = [
|
||||
'/etc/oracle-release',
|
||||
'/etc/slackware-version',
|
||||
@@ -44,8 +48,7 @@ for f in filelist:
|
||||
with open(f) as fh:
|
||||
fcont[f] = fh.read()
|
||||
|
||||
dist = platform.dist()
|
||||
|
||||
dist = distro.linux_distribution(full_distribution_name=False)
|
||||
|
||||
facts = ['distribution', 'distribution_version', 'distribution_release', 'distribution_major_version', 'os_family']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user