History | View | Annotate | Download (23.9 kB)
Add function for getting the timestamp in nanoseconds
The timestamp is returned as an integer number of nanoseconds since the Unixepoch.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Check that device names are unique and valid
Extend the CheckArguments phase of LUInstanceCreate and CheckPrereqphase of LUInstanceSetParams to also check if the name parameters ofdisks and NICs are unique and valid.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>...
Added class to contain information about a PV
This makes the code more readable and easier to upgrade.bdev.LogicalVolume.GetPVInfo and the code that depends on it have beenrefactored to use the new class.
utils.CheckVolumeGroupSize() has been moved to lib/utils/lvm.py, where more...
Add function for generating UUIDs in the Haskell codebase
Its first use will be to generate the salt for ConfD requests of the Haskellclient, as in the Python client.
Unit test added as well.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fixes to pass pep8 (make lint)
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Iustin Pop <iustin@google.com>
Migrate lib/utils/*.py from constants to pathutils
File system paths moved from constants to pathutils.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Verify user supplied dicts against defaults
This verifies the user (especially in nested dicts) does notprovide a key which is not seen in the defaults dict for that dict.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Replace single- with double-quotes
In at least two cases "%s" is replaced with str(), too.
Revert "Rename utils.mlock to utils.cfunc"
The rename is not needed either, since we're not adding more code as ofnow.This reverts commit 57ca011e1cd2681948969724e2646edaac22da28.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Rename utils.mlock to utils.cfunc
Renaming so that more code using ctypes could be added to the same file.
Move _TimeoutExpired to utils
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Merge branch 'devel-2.5'
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
Added function for parsing multiple CPU pinning mask
Signed-off-by: Tsachy Shacham <tsachy@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Most boring patch ever
s/'/"/ in (hopefully) the right places.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
cluster verify: add hvparams verification
Currently, the validity of the hypervisor parameters is only checkedat init/modification time, and not in the cluster verify. This is bad,as it can lead to inconsistent state that is only detected when thenext modification (which can be unrelated) is made, leading to...
utils: Cleanup and sort wildcard imports
Also convert the per-line pylint instructions to one per-moduleinstruction.
utils: Move NewUUID to utils.io
utils: Move more text-related code
utils: Move process-related code into separate file
utils: Move ResetTempfileModule to wrappers module
It's not exactly a wrapper, but this seemed like the best place.
utils: Move RunningTimeout to utils.algo
utils: Move code manipulating /etc/hosts to separate file
utils: Move X509-related code into separate file
utils: Move I/O-related code into separate file
utils: Move code related to file locking into separate file
utils: Move wrappers into separate file
utils: Use function to disable fork
Use a function instead of a variable written by another module.
utils: Change RemovePidFile to take path, not name
This avoids having to monkey-patch the utils module for unittests.Monkey patching is evil and caused a bug while moving code around.
utils: Move logging-related code into separate file
utils: Rename _CloseFDNoErr to CloseFdNoError
This makes it a public function, which is necessary formoving code into separate files.
utils: Move hashing-related code into separate file
utils: Remove unused variables
utils: Split algorithms into separate file
utils: Split Retry & co. into separate file
utils: Move text-related functions into separate file
utils: Move Mlockall into separate file
The unittest file is renamed to match the other utils.* tests.
utils: Move to separate module
This is preparing for splitting the whole units module.