mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-03 23:14:02 -07:00
Port from plaform.dist to ansible.module_utils.distro.linux_distribution
ci_complete
This commit is contained in:
parent
be65d9cfe5
commit
61b1daa65f
10 changed files with 248 additions and 114 deletions
|
@ -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']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue