- Jun 16, 2009
-
-
Guido Trotter authored
This was introduced as a typo in commit 7e66c35b while removing duplicate code from the KVM hypervisor. Signed-off-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
Commit c26a6bd2 changed GetMasterInfo not to return a tuple anymore, but didn't update its two callers in backend.py, which were trying to extract the values from the second tuple element. This causes a stack trace in node-daemon.log. Signed-off-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
* next: (22 commits) Update NEWS and version for 2.0.1 release gnt-{instance,backup}(8) --nic is actually --net Fix a wrong function name in backend.DrbdAttachNet GNT-CLUSTER(8) fix search-tags example Enable stripped LVs Add a lvm stripecount configure parameter Add more constants for DRBD and change sync tests Wait for a while in failed resyncs Assemble DRBD using the known size Fix two issues with exports and snapshot errors Set the size on new DRBDs in replace secondary Change the bdev init signatures Release 2.0.0 final watcher: automatically restart noded/rapi watcher: handle full and drained queue cases rapi: rework error handling Fix backend.OSEnvironment be/hv parameters rapi: make tags query not use jobs Change failover instance when instance is stopped Export more instance information in hooks ... Conflicts: lib/cmdlib.py test/ganeti.utils_unittest.py Signed-off-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
* master: Update NEWS and version for 2.0.1 release gnt-{instance,backup}(8) --nic is actually --net Fix a wrong function name in backend.DrbdAttachNet GNT-CLUSTER(8) fix search-tags example
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Guido Trotter authored
Fix a typo in the man pages that used the wrong option name. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jun 15, 2009
-
-
Iustin Pop authored
Patch "Simplify the RPC result framework in backend.py" changed all RPCs, and thus the hooks results where also changed. This needs changes to the hooks unittests too. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Some indentation was wrong, and pylint rightfully complained. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Now that all results are the same, we can even more simplify the handling in cmdlib more. Almost all if result.RemoteFailMsg()… constructs are similar, and we resurect the RpcResult.Raise() function to take a message argument, which it will process and raise an appropriate exception. This means a significant reduce in boilerplate code. Only the cases which handle the error specially (e.g. by warning only) need to touch directly the failure message, which was renamed on the RpcResult object for more clarity. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Since now all functions fail via _Fail, the return True, … is redundant as all normal return paths have it, and thus the True value can be added in the ganeti-noded handler. This means that all functions can now forget about the special result type, and instead return normally, but signal all failures via _Fail(). Only a few functions must be handled specially (the recursive ones). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Instead of returning (False, msg) from rpc endpoints, we raise always exceptions (the non-endpoint, internal functions can remain as is). This means that the error paths are agnostic to how the failure is signalled (i.e. by False, msg) and instead use only this method (exceptions) to signal failures. The patch also adds a log=False argument to _Fail so that trivial cases are not logged (but usually it's a good idea to log all failures, for the record). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Since all users of _FindDisks now return new-style results, we can simply make it raise an exception and not deal with the status field. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Since now all RPCs have the new style result type, we can pre-compute the error message at RpcResult() init time and not wait until it's requested. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Since all rpc calls were converted, we can now: - enforce result type to (status, data) - convert all unhandled exceptions to (False, str(err)) This makes sure that all unhandled errors are reported to rpc users. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
We no longer need OS objects to be able to represent invalid OSes. This cleans up the code handling those cases. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Currently the OSes have a special, customized error handling: the OS object can represent either a valid OS, or an invalid OS. The associated function, instead of raising other exception or failing, create custom OS objects representing failed OSes. While this was good when no other RPC had failure handling, it's extremely different from how other function in backend.py expect failures to be signalled. This patch reworks this completely: - the OS object always represents valid OSes (the next patch will remove the valid/invalid field and associated constants) - the call_os_diagnose returns instead of a list of OS objects, a list of (name, path, status, diagnose_msg); the status is then used in cmdlib to determine validity and the status and diagnose_msg values are used in gnt-os for display - call_os_get returns either a valid OS or a RPC remote failure (with the error message) - the other functions in backend.py now just call backend.OSFromDisk() which will return either a valid OS object or raise an exception - the bulk of the OSFromDisk was moved to _TryOSFromDisk which returns status, value for the functions which don't want an exception raised The gnt-os list and diagnose commands still work after this patch. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch converts the job queue rpc calls to the new style result. It's done in a single patch as there are helper function (in both jqueue and backend) that are used by multiple rpcs and need synchronized change. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch converts all three file-storage rpc (create, delete, rename) to new style result. This is done in a single patch as they all use a helper function which itself needs to/can be converted. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch converts this rpc into the new style. Since the function already had some error handling, we remove this custom error reporting and replace it with our (new-style) result type. This allows significant cleaning up of this code. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This also converts (and fixes) unittests and mock objects to deal with this change, and the custom hook verifier in cmdlib.LUClusterVerify. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This also removes custom post-processing from rpc.py; since this call has only one user, it was simple to move it back to the caller. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This also cleans up its single use in cmdlib.py. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
The patch also adds logging of errors from the ConfigWriter in case the RPC fails (although today we don't have failure modes). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This was more tricky as the backend function is used by other function in backend.py. As such, it must be handled specially - it must raise always an exception and not simply return False, err. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch converts this rpc call to the new style result, and also changes in the process the meaning of the QuitGanetiException's arguments and the node daemon rpc call exception handler. The problem with the exception handler is that we used a two-stage one, and the inner used to catch all exception (including this one), so in the logs we always had an exception logged, instead of the normal 'leaving cluster message'. The patch also adds logging of the exception's arguments, so that we have a trail in the logs about the shutdown mode. The exception's arguments were reversed from the normal RPC results style. While it makes somewhat more sense for this exception, we change them such that they match the rpc result format. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This is used in multiple places outside cmdlib.py, so it's a more interesting patch. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Only the custom handling in rpc.py for call_node_info used this, so now it can be removed. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch also does some cleanup and enforces valid results (with proper type, i.e. int for memory/disk values) from remote node, otherwise we handle the result as failure. We do this so that we can remove custom processing in rpc.py which is very old and doesn't play with the new style result (and has bit me by modifying the result received from the remote node). After this change, the node_info rpc becomes a normal one. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This should actually have a function in backend, but it's fine for now. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Since backend.GetInstanceList() is used both as RPC endpoint and as internal function, it can't return (status, value). Instead it returns only valid instance info, and failures are denoted by exceptions; and the ganeti-noded function adds the (True,) status. The patch also fixes a typo. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This changes from a list of booleans to «status, error messages». This means that instead knowing which disk has failed (position based), we get a list of all failures (with details how they failed). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This was a very simple (boolean) RPC, so converting it to actually have more value with the new style results was more difficult. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This doesn't have known failure modes but converting will help later. We also now call directly utils.ListVolumeGroups() instead of the backend.ListVolumeGroups() so that we don't have to undo the (status, value) result type. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This is a big change, because we need to cleanup its users too. The call and thus LUVerifyDisks LU used to differentiate between failure at node level and failure at LV level, by returning different types in the RPC result. This is way too complicated for our needs. The patch changes to new style result (easy change), and then: - changes LUVerifyDisks.Exec() to return a tuple of 3-elements instead of 4-elements; we collapse the «nodes not reachable» and «nodes with LVM errors» in a single dict - changes gnt-cluster to parse 3-element results and simplifies the different by-error handling code Note that the status is added in ganeti-noded, and not in the function itself, as the function is used in other places too. This was tested with down nodes and broken VGs. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-