History | View | Annotate | Download (22.8 kB)
Add a generic write file function
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 allthe other versions.
The "take attributes from the target file" option, while useful, is not...
Enhance GetHomeDir to accept either names or UIDs
Currently GetHomeDir accepts UIDs only. Enhance it to accept either auser name or a user id, to allow for nicer usage.
Reviewed-by: imsnah
Use the kernel's ability to generate UUIDs.
This removes the dependency on either the uuid module or e2fsprogs' uuidgen.
Reviewed-by: iustinp
Add small function to read the homedir of a user
This can be used to replace hardcoded "/root/" paths.
Remove fping as a dependency for Ganeti.
This patch completely gets rid of fping - replace all fping invocations with TcpPing calls - update documentation accordingly. - associated cleanups (use constant for localhost IP, use more sensible defaults for TcpPing and use those)...
Remove the shebang from modules
Since modules are not directly executables, remove the shebang fromthem. This helps with lintian warnings.
Also make the autogenerated _autoconf.py contain two comment lines atthe beginning, like the other modules.
Reviewed-by: ultrotter
Add function to list files in a directory, excluding those beginning with adot.
Prevent race condition in CreateBackup().
Remove requirement that host names are FQDN
We currently require that hostnames are FQDN not short names(node1.example.com instead of node1). We can allow short names as longas: - we always resolve the names as returned by socket.gethostname() - we rely on having a working resolver...
Change resolved hostname from dict to a class
The current result of utils.LookupHostname() is a dict, but this doesnot allow static checkers to check the correctness of the code. Thispatch introduces a new class names HostInfo and changes LookupHostname...
Cleanup up selective imports for utils and utils unit test.
Reviewed-by: iustinp, imsnah
Added TcpPing to do ping-alike via TCP connect(2) with defined source address.To be used to replace the currently fping(8) based reachability test.
Change the way how locales are overridden:- Set only LC_ALL, it overrides any other variable- Restore environment after unittest
Filters out LANG and LC_* on RunCmd
This filters out the LANG and LC_ variables from the environment of programsexecuted by RunCmd, in order to get consistent output of execute programs likelvs, etc.
Add function to get all local IP addresses, will be used in cmdlib.py.
Reviewed-by: schreiberal
Switch utils.RunCmd from popen2 to subprocess
This changes the implementation of RunCmd from using the popen2 moduleto using the (new in 2.4) subprocess module.
This is helpful because the subprocess module has more advanced featuresthan popen2, the most important ones being the ability to run code in the...
Style changes for pep-8 and python-3000 compliance.
This changes the raising of exceptions from: raise Exception, valueto raise Exception(value)
as the first form will be removed in python-3000 and the second form ispreferred now.
The changes also involve a few cases of changing from raising standard...
Comment formatting updates.
Initial commit.