diff options
author | 2017-06-02 15:31:53 -0600 | |
---|---|---|
committer | 2017-06-05 13:22:49 -0600 | |
commit | 48da17bfedb683b624faf08d2e0b7552d56cff21 (patch) | |
tree | 9219ed4ab9872b26f7ff685c4d3378212a641d08 /snaps/file_utils.py | |
parent | c01f193cad22895f86f726f588a46e44ed4ab68a (diff) |
Added support for applying Heat Templates
Second patch expanded support to both files and dict() objects.
Third patch exposes new accessor for status and outputs.
JIRA: SNAPS-86
Change-Id: Ie7e8d883b4cc1a08dbe851fc9cbf663396334909
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/file_utils.py')
-rw-r--r-- | snaps/file_utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/snaps/file_utils.py b/snaps/file_utils.py index 819c707..f7c9af4 100644 --- a/snaps/file_utils.py +++ b/snaps/file_utils.py @@ -123,3 +123,16 @@ def read_os_env_file(os_env_filename): # Remove leading and trailing ' & " characters from value out[tokens[0]] = tokens[1].lstrip('\'').lstrip('\"').rstrip('\'').rstrip('\"') return out + + +def read_file(filename): + """ + Returns the contents of a file as a string + :param filename: the name of the file + :return: + """ + out = str() + for line in open(filename): + out += line + + return out |