Statistics
| Branch: | Tag: | Revision:

root / lib / utils @ dcfb969a

Name Size
__init__.py 21 kB
algo.py 4 kB
filelock.py 5 kB
hash.py 2.4 kB
io.py 20.5 kB
log.py 8.4 kB
mlock.py 2.3 kB
nodesetup.py 3.3 kB
process.py 28.2 kB
retry.py 6.2 kB
text.py 14 kB
wrapper.py 4.8 kB
x509.py 9.2 kB

Latest revisions

# Date Author Comment
580c971e 04/29/2011 03:38 pm Michael Hanselmann

Merge branch 'devel-2.4'

  • devel-2.4: (24 commits)
    mlock: fail gracefully if libc.so.6 cannot be loaded
    Allow creating the DRBD metadev in a different VG
    Make _GenerateDRBD8Branch accept different VG names
    Fix WriteFile with unicode data
    Replace disks: keep the meta device in the same VG...
adc523ab 04/29/2011 03:05 pm Iustin Pop

mlock: fail gracefully if libc.so.6 cannot be loaded

This allows noded to continue instead of blowing up if the libc major
number changes.

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

55f67cc9 04/28/2011 03:24 pm Iustin Pop

Fix 'unused import' lint error

Sorry!

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

8f9a87c5 04/28/2011 01:06 pm Iustin Pop

SetEtcHostsEntry: maintain existing ordering

Currently RemoveEtcHostsEntry keeps the ordering, but SetEtcHostsEntry
not, as it will always write the new entry at the end of file. I
personally dislike this as it "uglifies" my custom host files, so this
patch makes it update the record instead in-place so to say instead of...

24c855a7 04/28/2011 01:06 pm Iustin Pop

Convert utils.nodesetup to utils.WriteFile(data=…)

It makes no sense to iteratively write the new etc/hosts file, as we
can pre-compute the desired contents (neither the old nor the new
versions are safe against concurrent changes anyway).

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

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 <>...

437c3e77 04/27/2011 06:26 pm Iustin Pop

Fix potential data-loss in utils.WriteFile

os.write can do incomplete writes, as long as at least some bytes have
been written (like write(2)):

os.write(fd, " " * 1300)

1300

os.write(fd, " " * 1300)

1300

os.write(fd, " " * 1300)

1300

os.write(fd, " " * 1300)...

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...

af7b6689 04/07/2011 01:24 pm Michael Hanselmann

Merge branch 'devel-2.4'

  • devel-2.4:
    LUInstanceQueryData: Don't acquire locks unless requested
    Increase the lock timeouts before we block-acquire
    daemon.py: move startup log message before prep_fn
    Display the actual memory values in N+1 failures...
76ae1d65 04/07/2011 12:46 pm Michael Hanselmann

Merge branch 'stable-2.4' into devel-2.4

  • stable-2.4:
    Add error checking and merging for cluster params
    Clarify --force-join parameter message
    Treat empty oob_program param as default
    Fix bug in instance listing with orphan instances
    Fix bug related to log opening failures...

View revisions

Also available in: Atom