mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Add back erroneously deleted get_file_content()
This commit is contained in:
parent
97c64f3632
commit
e3dd25b1b2
1 changed files with 8 additions and 0 deletions
|
@ -562,6 +562,14 @@ class LinuxVirtual(Virtual):
|
||||||
self.facts['virtualization_type'] = 'VirtualPC'
|
self.facts['virtualization_type'] = 'VirtualPC'
|
||||||
self.facts['virtualization_role'] = 'guest'
|
self.facts['virtualization_role'] = 'guest'
|
||||||
|
|
||||||
|
def get_file_content(path):
|
||||||
|
data = None
|
||||||
|
if os.path.exists(path) and os.access(path, os.R_OK):
|
||||||
|
data = open(path).read().strip()
|
||||||
|
if len(data) == 0:
|
||||||
|
data = None
|
||||||
|
return data
|
||||||
|
|
||||||
def ansible_facts():
|
def ansible_facts():
|
||||||
facts = {}
|
facts = {}
|
||||||
facts.update(Facts().populate())
|
facts.update(Facts().populate())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue