Add an UnescapeAndSplit function
authorIustin Pop <iustin@google.com>
Wed, 13 Jan 2010 15:56:42 +0000 (16:56 +0100)
committerIustin Pop <iustin@google.com>
Thu, 14 Jan 2010 09:26:18 +0000 (10:26 +0100)
commit5b69bc7ca790156ee4422fa1611c05ad6d5ebc47
treedd61baad134f410c2b9ee38efd794690b484358b
parentb13dfb92ab93b63c3feb238d27e8b5cd2a495fce
Add an UnescapeAndSplit function

In many cases, where we accept (usually from the command line) a list of
parameters, we remove the use of the separator as an component of any of
the elements.

This patch adds a new function that can split strings of the form
'a,b\,c,d' into ['a', 'b,c', 'd'], with proper un-escaping of
double-backslashes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
lib/utils.py
test/ganeti.utils_unittest.py