- 23 Jul, 2008 1 commit
-
-
Guido Trotter authored
This helper function reads a pid from a file containing it and checks whether it refers to a live process. Reviewed-by: iustinp
-
- 21 Jul, 2008 1 commit
-
-
Michael Hanselmann authored
This signal handler class abstracts some of the code previously used in other places. It also uninstalls its handler when Reset() is called or the class is destructed, thereby restoring the previous behaviour. Reviewed-by: iustinp
-
- 10 Jul, 2008 2 commits
-
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
Iustin Pop authored
This is just a simple, hardcoded decorator for object methods needing synchronization on the _lock instance attribute. Reviewed-by: ultrotter
-
- 09 Jul, 2008 2 commits
-
-
Iustin Pop authored
The patch also logs all commands executed from RunCmd when we are at debug level. Reviewed-by: imsnah
-
Iustin Pop authored
This removes (hopefully) all traces of the old locking functions and uses. Reviewed-by: imsnah
-
- 01 Jul, 2008 1 commit
-
-
Iustin Pop authored
This function will return the first unused integer based on a list of used integers (e.g. [0, 1, 3] will return 2). Reviewed-by: imsnah
-
- 23 Jun, 2008 1 commit
-
-
Michael Hanselmann authored
cfgupgrade will not work with relative paths at all, but rather get them from constants.py. Reviewed-by: iustinp
-
- 18 Jun, 2008 1 commit
-
-
Michael Hanselmann authored
- Make closing file optional: Required by ganeti-watcher to keep file open after writing it. Changes return value of utils.WriteFile if "close" parameter evaluates to True. - Pre- and post-write functions: Can be used to lock files. This will be used by ganeti-watcher to lock the temporary file before renaming. Reviewed-by: iustinp
-
- 12 Jun, 2008 2 commits
-
-
Michael Hanselmann authored
This is required for splitting the cluster initialization code. Reviewed-by: iustinp
-
Michael Hanselmann authored
This is required for the split of the cluster initialization code. Reviewed-by: iustinp, ultrotter
-
- 09 May, 2008 1 commit
-
-
Michael Hanselmann authored
There are a couple of reasons for doing so: - /proc is not OS independent, it's only supported by Linux (there are emulations on other systems, but those might differ from the way Linux represents data). - Checking a daemon's state doesn't necessarily mean it's usable. Connecting to the socket using “xm info” is much safer. - Reduce code size. Reviewed-by: iustinp
-
- 29 Apr, 2008 1 commit
-
-
Iustin Pop authored
This patch adds a mechanism to disable utils.RunCmd in selected programs. This is needed in the master daemon unless we confirm threading doesn't pose any problems. This makes cluster init fail, but creating new trunk clusters is anyway broken at the moment. Reviewed-by: ultrotter
-
- 25 Apr, 2008 1 commit
-
-
Michael Hanselmann authored
Add parameters to not check the path for absoluteness, implement a dry run mode and automatically create a backup if requested. This will be used by the cfgupgrade utility. Reviewed-by: schreiberal
-
- 10 Apr, 2008 1 commit
-
-
Iustin Pop authored
Based on the previous OS search code changes, we can now move the OS search code into a generic look-for-file function in utils.py. This means that the allocator code can use the same function. Reviewed-by: ultrotter
-
- 04 Apr, 2008 2 commits
-
-
Iustin Pop authored
This patch implements an optional parameter to utils.Daemonize() which allows that function to not close some file descriptors. This will allow the master daemon to open the listening socket before fork - in order to be able to notify errors and return a meaningful exit code, and then when we fork we don't close that fd. Reviewed-by: imsnah
-
Iustin Pop authored
Currently, in ganeti-noded we have the createDaemon function. Since we'll need the same in other daemons, we move this function to utils.py With the move, a few changes were also done: - change the name to Daemonize() - add a parameter, logfile, as different daemons will want to log to different files - remove the try.. except.. around the fork calls, since they were only re-raising the OS exception with less data; unless we want to actually handle fork error (not just re-raising), these try blocks are not useful - change the return style at the end of the function Reviewed-by: imsnah
-
- 11 Mar, 2008 1 commit
-
-
Iustin Pop authored
This patch modifies TcpPing and its callers to make the source address selection optional. Usually, the kernel will know better what source address to use, just in some cases we want to enforce a given source address so it makes sense to make this optional. Reviewed-by: ultrotter
-
- 05 Mar, 2008 1 commit
-
-
Michael Hanselmann authored
Reviewed-by: ultrotter
-
- 05 Feb, 2008 1 commit
-
-
Iustin Pop authored
This can be used for testing purposes. Reviewed-by: ultrotter,imsnah
-
- 27 Dec, 2007 1 commit
-
-
Alexander Schreiber authored
Allow the MAC address of an instance to be specified optionally during instance creation and later to be changed via instance modify. Reviewed-by: iustinp
-
- 19 Dec, 2007 1 commit
-
-
Iustin Pop authored
Currently, RunCmd is written with the assumption that programs will have a small stderr output, therefore we read the child's stdout (which can be big, so we don't want to block the child) and then the stderr (which is small, so it shouldn't block). However, with the ‘gnt-cluster verify-disks’ command, we ourselves generate heavy stderr, therefore we break the ganeti-watcher which runs the verify-disks via utils.RunCmd. This patch turns the RunCmd command into an poll-based one, which means any kind of interleaved output by a child on stdout/stderr will be handled correctly. Of course, since the output is buffered in memory, there are other ways to break RunCmd(). But at least this should fix the common case. Reviewed-by: hansmi
-
- 29 Nov, 2007 2 commits
-
-
Iustin Pop authored
This patch replaces the hardcoded ‘/var/lock/’ directory with one based on LOCALSTATEDIR. Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds logging of command failures to the debug log in case the user either started the command (gnt-*) or the node daemon with the debug flag. Reviewed-by: imsnah
-
- 22 Nov, 2007 1 commit
-
-
Michael Hanselmann authored
If we didn't sort this list, files would be in arbitrary order. Reviewed-by: iustinp
-
- 20 Nov, 2007 2 commits
-
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
Michael Hanselmann authored
Reviewed-by: ultrotter
-
- 12 Nov, 2007 6 commits
-
-
Iustin Pop authored
The code assumes all lines have at least two elements which are whitespace separated - i.e. it does not deal with empty lines or comment lines with no spaces. This patch fixes this. Also, the patch replaces the blank between IP and the canonical name with a tab (restoring previous behaviour). Reviewed-by: imsnah
-
Michael Hanselmann authored
This is a critical file. Breaking it would be very bad. Thus, if the system crashes before the data is synched to the disk, it should have the complete file afterwards. Reviewed-by: iustinp
-
Michael Hanselmann authored
- Combine hostname and aliases on one line - Fix bug with wrongfully removed newline characters - Use wrapper for SetEtcHostsEntry in cmdlib Reviewed-by: iustin
-
Michael Hanselmann authored
-
Michael Hanselmann authored
Reviewed-by: TODO
-
Michael Hanselmann authored
Reviewed-by: schreiberal
-
- 09 Nov, 2007 3 commits
-
-
Michael Hanselmann authored
Reviewed-by: schreiberal
-
Michael Hanselmann authored
Reviewed-by: schreiberal
-
Michael Hanselmann authored
Reviewed-by: schreiberal
-
- 05 Nov, 2007 2 commits
-
-
Iustin Pop authored
This patch fixes some minor pylint warnings (unused variables, wrong indentation, etc.) and a real bug in the recovery for drbd8 rename procedure. Reviewed-by: imsnah
-
Michael Hanselmann authored
Reviewed-by: schreiberal
-
- 28 Oct, 2007 1 commit
-
-
Guido Trotter authored
The two function 'any' and 'all' are copied as-is from the python 2.4 documentation for the itertools module. They are useful (and are already builtin function in python 2.5). Reviewed-by: iustinp
-
- 12 Oct, 2007 1 commit
-
-
Iustin Pop authored
Currently there are a few version of "write a file safely" in the code. This patch adds a generic function that should be able to replace all the other versions. The "take attributes from the target file" option, while useful, is not implemented by this patch. Reviewed-by: imsnah,ultrotter
-