- Jun 23, 2010
-
-
Guido Trotter authored
This is needed to convert waitforjobchanges to use inotify and the on-disk version and decouple it from the job queue lock. No replication to remote nodes is done, to keep the operation fast. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
We move from querying the in-memory version to loading all jobs from the disk. Since the jobs are written/deleted on disk in an atomic manner, we don't need to lock at all. Also, since we're just looking at the contents of a directory, we don't need to check that the job queue is "open". If some jobs are removed between when we listed them and us loading them, we need to be able to cope: if we were asked to load those jobs specifically, we must report the failure, but if we were just asked to "load all" we shall just not consider them as part of the "all" set, since they were deleted. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
This will be used to read a job file without having to deal with exceptions from _LoadJobFromDisk. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Currently _LoadJobFromDisk archives job files it finds corrupted. Since we want to use it to load files without holding locks, this could cause a conflict: we just move the feature to _LoadJobUnlocked which is always called with the lock held. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
If the repetition count is not passed or is passed as 0 we sleep exactly one time, otherwise we sleep "repeat" times and log in between. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jun 22, 2010
-
-
Iustin Pop authored
* devel-2.1: Add "adopt" to the allowed disk parameters Improve pylintrc for pylint 0.21+ Fix warnings with Python 2.6 Fix a small bug introduced in cf26a87a Fix the type of 'valid' attribute in LUDiagnoseOS Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Apollon Oikonomopoulos authored
"adopt" was missing from bd061c35, thus breaking disk adoption. Signed-off-by:
Apollon Oikonomopoulos <apollon@noc.grnet.gr> Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
While we'll need to update the source files too, at least this change makes pylint 0.21 not fail on the current source tree. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
'format' is a new built-in function, and 'bytes' is a new builtin type. We rename this to make pylint happy (and remove potential bugs). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Commit cf26a87a added a tiny typo, which would break non-FQDN arguments to modify node storage. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
The update of the valid status in LUDiagnoseOS says: valid = valid and osl and osl[0][1] However, in Python, “True and []” (which '[]' we get for an invalid OS) will result in “[]”, and thus the valid field for an OS will be either True or an empty list. Which is not what we want… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Jun 21, 2010
-
-
Apollon Oikonomopoulos authored
"adopt" was missing from bd061c35, thus breaking disk adoption. Signed-off-by:
Apollon Oikonomopoulos <apollon@noc.grnet.gr> Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jun 18, 2010
-
-
Guido Trotter authored
* stable-2.1: Bump up version for the 2.1.4 release Update NEWS about the latest 2.1 change Fix handling of errors from socket.gethostbyname Update a comment in qa-sample.json RAPI client: Add support for Python 2.6 Update NEWS for Ganeti 2.1.4 Conflicts: NEWS: keep both configure.ac: keep the 2.2 version qa/qa-sample.json: merge nearby changes Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Socket functions can raise more than just gaierror. Most of the times, socket.gethostbyname_ex will return gaierror, but rarely it will also raise herror. For completeness, we catch all socket exceptions with data of type (code, description). Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
Fix the sentence to say what it means. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jun 17, 2010
-
-
Guido Trotter authored
- the function is not broken, and we're using in nowadays - we have example json files and all, which show its usage => the todo is incorrect Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Rather than adding the jobs to the worker pool one at a time, we add them all together, which is slightly faster, and ensures they don't get started while we loop. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Each task has to be a sequence, or the RunTask call will fail. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Currently there's no way to know if something actually gets done. After this check we actually test that the threads do their job. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
The httplib module used by urllib2 requires its sockets to have a makefile() method to provide a file-like interface (or rather file-in-Python-like) to the socket. PyOpenSSL doesn't implement makefile() as the semantics require files to call dup(2) on the underlying file descriptors, something not easily done on SSL sockets. Python up to and including 2.5 have a class to simulate makefile(), httplib.FakeSocket. With the addition of SSL support in Python 2.6, this class was deprecated and no longer functions. This patch adds a new, simpler wrapper class which is used in Python 2.6 and above only. It's good enough for this use. There are general problems in these generic wrapper classes--none of them handles SSL I/O properly. They break, for example, when the server requests a renegotiation. This will need more work. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
The httplib module used by urllib2 requires its sockets to have a makefile() method to provide a file-like interface (or rather file-in-Python-like) to the socket. PyOpenSSL doesn't implement makefile() as the semantics require files to call dup(2) on the underlying file descriptors, something not easily done on SSL sockets. Python up to and including 2.5 have a class to simulate makefile(), httplib.FakeSocket. With the addition of SSL support in Python 2.6, this class was deprecated and no longer functions. This patch adds a new, simpler wrapper class which is used in Python 2.6 and above only. It's good enough for this use. There are general problems in these generic wrapper classes--none of them handles SSL I/O properly. They break, for example, when the server requests a renegotiation. This will need more work. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Many RPC calls have changed in Ganeti 2.2, hence bumping the RPC protocol version. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Using random values in unittests isn't good. This one broke exactly when building the 2.2.0~beta0 release. I suspect there were duplicate job IDs generated (due to $large being not so large). Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
This makes sure the out_socket can only be used for writing, and the in_socket for reading. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Useful if we want to add many tasks at once, without contention with the previous one we added starting. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Sometimes it's useful to write to the local filesystem, but immediate replication to all master candidates is not needed. The _WriteAndReplicateFileUnlocked function gets renamed to _UpdateJobQueueFile, as calling "write and replicate, but don't replicate" seemed a bit strange. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
The job queue currently has a static _GetJobInfoUnlocked method. Changing it to be a normal method of _QueuedJob, which makes more sense. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Move the work from _LoadJobUnlocked to _LoadJobFileFromDisk, which can then be used in other contexts as well. Also, if we fail to deserialize the job, archive it as well (before we archived it only if we failed to create the related object, but kept it there if deserialization failed. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
With the recent addition of a check for directories listed in Makefile local custom directories are always reported as unlisted. This patch adds support for a “Makefile.local” file, which can adjust settings in Makefile. Example: “DIRCHECK_EXCLUDE += xyz .mydata doc/manhtml”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Jun 15, 2010
-
-
Guido Trotter authored
Among all users, turns out just one *may* need the output to be sorted. All the others can cope without. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Somewhere we do try/del/except and somewhere just pop. Using pop everywhere saves lines of code. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jun 14, 2010
-
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
Since OS objects are not stored in the configuration, we cannot put os_hvp there, therefore the TODO is obsolete… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Currently, this function does three things: - special handling of constants.VALUE_DEFAULT - type enforcing of the resulting dict - filling the dictionary with defaults However, except for the first one, the second two do not belong in this function: - in the future, not all parameter dictionaries will be able to be enforced - filling the dictionary with defaults cannot be done via a defaults dict in all cases, and should be done by the specialized functions (ideally we'd pass a partial function instance here, but we don't have that yet…) As such, we remove the last items, and move them to the callers; this is overall the same complexity, as we were calling this function in just three places and constructing the many arguments was also complicated. Furthermore, we move the function out of LUSetInstanceParams, as in the future it will be used by LUSetClusterParams too. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Since we'll need to be able to generate the OS-specific environment separately from the instance one, we move it to a separate function. We also add a new OS_NAME env. var which is identical to the INSTANCE_OS one (which won't exist for OS-only environments). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-