mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-27 13:28:51 +07:00
move gen_testcase to hacking/tests
* also use json instead of pprint
This commit is contained in:
@@ -12,7 +12,6 @@ import platform
|
||||
import os.path
|
||||
import subprocess
|
||||
import json
|
||||
import pprint
|
||||
|
||||
filelist = [
|
||||
'/etc/oracle-release',
|
||||
@@ -53,10 +52,14 @@ ansible_facts = {}
|
||||
for fact in facts:
|
||||
ansible_facts[fact] = parsed['ansible_facts']['ansible_'+fact]
|
||||
|
||||
nicename = ansible_facts['distribution'] + ' ' + ansible_facts['distribution_version']
|
||||
|
||||
output = {
|
||||
'name': nicename,
|
||||
'input': fcont,
|
||||
'platform.dist': dist,
|
||||
'result': ansible_facts,
|
||||
}
|
||||
|
||||
pprint.pprint(output)
|
||||
print(json.dumps(output, indent=4))
|
||||
|
||||
Reference in New Issue
Block a user