Implemented hooks for external logging infrastructure for storing both server-side and client-side logs.
Signed-off-by: Svitlana Tumanova <stumanova@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1408 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index 1b18a03..f3805dc 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -18,7 +18,7 @@
keyval = {}
for line in open(path):
line = re.sub('#.*', '', line.rstrip())
- if not re.search(r'^\w+=', line):
+ if not re.search(r'^[-\w]+=', line):
raise ValueError('Invalid format line: %s' % line)
key, value = line.split('=', 1)
if re.search('^\d+$', value):
@@ -35,7 +35,7 @@
keyval = open(path, 'a')
try:
for key, value in dictionary.iteritems():
- if re.search(r'\W', key):
+ if re.search(r'[^-\w]', key):
raise ValueError('Invalid key: %s' % key)
keyval.write('%s=%s\n' % (key, value))
finally: