summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/vyos/util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index 531cd8182..3d9925a60 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -16,6 +16,11 @@
import re
import psutil
+def read_file(path):
+ """ Read a file to string """
+ with open(path, 'r') as f:
+ data = f.read().strip()
+ return data
def colon_separated_to_dict(data_string, uniquekeys=False):
""" Converts a string containing newline-separated entries