mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add python info to facts
This commit is contained in:
parent
7766a9a688
commit
7158eb489f
1 changed files with 16 additions and 0 deletions
|
@ -166,6 +166,7 @@ class Facts(object):
|
||||||
self.get_local_facts()
|
self.get_local_facts()
|
||||||
self.get_env_facts()
|
self.get_env_facts()
|
||||||
self.get_dns_facts()
|
self.get_dns_facts()
|
||||||
|
self.get_python_facts()
|
||||||
|
|
||||||
def populate(self):
|
def populate(self):
|
||||||
return self.facts
|
return self.facts
|
||||||
|
@ -782,6 +783,21 @@ class Facts(object):
|
||||||
pass
|
pass
|
||||||
return size_total, size_available
|
return size_total, size_available
|
||||||
|
|
||||||
|
def get_python_facts(self):
|
||||||
|
self.facts['python'] = {
|
||||||
|
'version': {
|
||||||
|
'major': sys.version_info[0],
|
||||||
|
'minor': sys.version_info[1],
|
||||||
|
'micro': sys.version_info[2],
|
||||||
|
'releaselevel': sys.version_info[3],
|
||||||
|
'serial': sys.version_info[4]
|
||||||
|
},
|
||||||
|
'version_info': list(sys.version_info),
|
||||||
|
'executable': sys.executable,
|
||||||
|
'type': sys.subversion[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class Hardware(Facts):
|
class Hardware(Facts):
|
||||||
"""
|
"""
|
||||||
This is a generic Hardware subclass of Facts. This should be further
|
This is a generic Hardware subclass of Facts. This should be further
|
||||||
|
|
Loading…
Add table
Reference in a new issue