Risk: Low
Move read_one_line and write_one_line from the client utils into the
common utils.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1509 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index 2a9db31..d2fb9d3 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -7,6 +7,14 @@
import error
+def read_one_line(filename):
+ return open(filename, 'r').readline().strip()
+
+
+def write_one_line(filename, str):
+ open(filename, 'w').write(str.rstrip() + "\n")
+
+
def read_keyval(path):
"""
Read a key-value pair format file into a dictionary, and return it.