History | View | Annotate | Download (5.9 kB)
jstore: Nicer error message on non-numeric file content
An error like “invalid literal for int() with base 10” can be quiteconfusing.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Migrate lib/{jqueue,jstore}.py from constants to pathutils
File system paths moved from constants to pathutils.
Switch job IDs to numeric
This has been a long-standing cleanup item, which we've alwaysrefrained from doing due to the high estimated effort needed.
In reality, it turned out that after some infrastructure improvements(the previous patches), the actual job queue-related changes are quite...
query: Comparison of timestamps, job IDs
This patch adds the necessary conversions for comparing split timestamps(such as used by jobs) and job IDs (by defining custom converters).Unittests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
jqueue: Move functions related to job ID to jstore
These don't really need to be in jqueue, and a new function willbe added to convert job IDs to an integer for queries.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
gnt-cluster master-failover: Undrain queue
- Move functions for drain status (tracked via file) from jqueue to jstore- Undrain queue on master failover if necessary- Add QA test
Move job queue to new ganeti.runtime
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
jstore._ReadNumericFile: use utils.ReadFile
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
jstore: use EnsureDirs, and add more constants
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Balazs Lecz <leczb@google.com>
Support passing in file object in utils.FileLock
This way we can re-use file objects opened in other places. Also add moreunittests.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add targetted pylint disables
This patch adds targeted pylint disables, where it makes sense (eitherdue to limitations in pylint or due to historical usage), and also a fewblanket ones in rapi where all the names are… “different”.
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix pylint warnings
Fix race locking issue in noded
Noded didn't release the job queue lock after initialising it. Thispatch makes sure to unlock once the work is done.
Reviewed-by: ultrotter
jstore: Change to not always require a lock
This way we can do locking when both noded and masterd are runningon the same machine, the latter holding an exclusive lock on thequeue.
Reviewed-by: iustinp
jstore: Add queue helper functions
This will be used to move common code out of jqueue.