From 6e4e39f285ed4e157afdeba5ad71cf2393035c6e Mon Sep 17 00:00:00 2001 From: Stephen Fromm Date: Wed, 18 Jul 2012 16:41:14 -0700 Subject: [PATCH] Add back erroneously deleted get_file_content() --- setup | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup b/setup index 5068f77f2e3..543886e82f8 100755 --- a/setup +++ b/setup @@ -562,6 +562,14 @@ class LinuxVirtual(Virtual): self.facts['virtualization_type'] = 'VirtualPC' 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(): facts = {} facts.update(Facts().populate())