Statistics
| Branch: | Tag: | Revision:

root / test / ganeti.utils.io_unittest.py @ 05484a24

History | View | Annotate | Download (25.1 kB)

# Date Author Comment
1d39e245 04/28/2011 01:02 pm Iustin Pop

Fix WriteFile with unicode data

Unicode is fun, indeed:

len(buffer("abc"))

3

len(buffer(u"abc"))

12

So we can't pass unicode data to buffer(), as the result will be to
write the in-memory (usually UTF-32) representation to disk.

Signed-off-by: Iustin Pop <>...

a9d68e40 04/13/2011 01:01 pm Michael Hanselmann

utils.WriteFile: Close file before renaming

Issue 154 (http://code.google.com/p/ganeti/issues/detail?id=154)
reported an “Operation not supported” error when writing instance
exports to a mounted CIFS filesystem. Experimentation showed the error
to only occur when using rename(2) on an opened file. Various references...

79b60c1c 01/11/2011 05:33 pm Michael Hanselmann

utils: Drop RemovePidFile

It's equivalent to a simple RemoveFile now.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

90e234a6 01/11/2011 05:33 pm Michael Hanselmann

utils: Move NewUUID to utils.io

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

3ae8dd03 01/11/2011 04:53 pm Michael Hanselmann

Fix utils.io unittest

“import signal” was missing, but of course it didn't show during my
testing.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

3865ca48 01/11/2011 04:25 pm Michael Hanselmann

utils: Move I/O-related code into separate file

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>