utils.ReadOneLineFile()
authorGuido Trotter <ultrotter@google.com>
Tue, 11 May 2010 16:00:22 +0000 (17:00 +0100)
committerGuido Trotter <ultrotter@google.com>
Wed, 12 May 2010 11:10:18 +0000 (12:10 +0100)
commite587b46abe8c6413fb52cfd5e584819e3a96a4a4
tree1aaa62570f3de3b5a605de703fec1247e898f147
parent582ed043d3e7594ae59340673a6bc851c850c12b
utils.ReadOneLineFile()

Read the first non-empty file line. When strict is set, abort if more
than one line is non-empty. Some unittests inspired by the reverted ones
from commit b774bb106cc28d008e790ad2666eb64c76866fa0, and some new ones.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/utils.py
test/ganeti.utils_unittest.py