- Jul 01, 2010
-
-
Michael Hanselmann authored
Currently the RAPI client uses the urllib2 and httplib modules from Python's standard library. They're used with pyOpenSSL in a very fragile way, and there are known issues when receiving large responses from a RAPI server. By switching to PycURL we leverage the power and stability of the widely-used curl library (libcurl). This brings us much more flexibility than before, and timeouts were easily implemented (something that would have involved a lot of work with the built-in modules). There's one small drawback: Programs using libcurl have to call curl_global_init(3) (available as pycurl.global_init) while exactly one thread is running (e.g. before other threads) and are supposed to call curl_global_cleanup(3) (available as pycurl.global_cleanup) upon exiting. See the manpages for details. A decorator is provided to simplify this. Unittests for the new code are provided, increasing the test coverage of the RAPI client from 74% to 89%. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This does not yet fix all issues in the RAPI interface which were introduced with the type system. More testing is needed. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
René Nussbaumer authored
This will allow instance rename without dns check as it does for instance add. Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jun 30, 2010
-
-
Manuel Franceschini authored
Currently a TcpPing using the target address as source is used to determine wheter or not an IP address belongs to a node. This does not work for IPv6 anymore (I'm not sure why) as binding to IPv6 localhost as source for the TCP connection in TcpPing still results in a successful connection, even in case the target address is non-local. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
This needs lots of work, but it can successfully launch an LXC-based instance. See the docstring for the limitations/work to be done. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Balazs Lecz <leczb@google.com>
-
Manuel Franceschini authored
Support IPv6 configuration for 'drbdsetup show' parser and add unittests concerning that case. Renames some data files to use consistent names clarifying their usage. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Manuel Franceschini authored
This patch introduces functions to check for valid IPv4 and IPv6 addresses and converts IsValidIP() to return True if it is either a IPv4 or a IPv6 address. For now we do not change the functional behavior and replace IsValidIP with IsValidIP4. This might change in the future. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
Commit 625ac113 introduced 'osparams' slot in OPSetClusterParams which was not passed when invoked via gnt-cluster modify. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Jun 29, 2010
-
-
Guido Trotter authored
- It's ok if the optional modules functools, roman and hashlib are not there. - It's ok to reference any and all before defining them. We're doing all this exactly because, under python 2.4, they are undefined. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Currently the message stream can process any number of messages in parallel (if they get dispatched to different threads or processes). In order to limit their number we only handle messages and read from the socket if we're under a certain limit of unanswered ones. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
This function adds the ability for a AsyncTerminatedMessageStream to have a thread-safe message delivery function. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jun 28, 2010
-
-
Guido Trotter authored
The comments seem to imply we can remove deprecated slots after 2.1 is released. This is not quite true, if we still want to support upgrading straight from 2.0. So let's specify better that they can be removed only after upgrading from 2.0 can be deprecated. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Iustin Pop authored
Also, improve logging of type errors, to ease debugging. Signed-off-by:
Iustin Pop <iustin@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
By using ssynchronized in the new way, we can remove the module-global _big_jqueue_lock and revert back to an internal _lock inside the jqueue. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
The ssynchronized decorator takes the lock to act on in input. With this change we allow a string to be passed, and if so we assume the function it protects is a class method, and we act on the member of the class itself named as the string we got. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
We can share the jqueue lock when we do per-job updates. These only conflict with updates/checks on the same job from another thread (eg. CancelJob, ArchiveJob, which keep the lock unshared, since they are less frequent). Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Move some code to a decorated function rather than explicitely acquiring/releasing the lock in AppendFeedback. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
All users of this function were converted to another method, hence we can remove it. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Remove the jqueue _lock member and convert to a _big_jqueue_lock sharedlock. This allows smooth transition from the old single lock to a more granular approach. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Every time we call MarkUnfinishedOps we do it in a try/finally block that updates the job file. With this patch we move the try/finally inside. CancelJobUnlocked is removed, because it just becomes a wrapper over MarkUnfinishedOps with two constant values. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
This makes it compatible with the python builtin, and we can even use the builtin when running under the right version of python. The all and any functions are renamed to _all and _any, so that they can be tested, and (non)existing unittests are updated (translation: there are no unit tests, so none are updated). This patch also moves the code deciding which partial to use next to the definition of the _partial function, rather than after TryToRoman. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
If the OS is not using API v20, the parameter verification should be entirely skipped. The second change is a simple typo. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Jun 25, 2010
-
-
Iustin Pop authored
I was using wrong python installation path (thanks Guido!), so I was not actually testing the new backend.py module. Two immediate things bugs are fixed, and after these burnin passes again… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Jun 24, 2010
-
-
Apollon Oikonomopoulos authored
DTS_MAY_ADOPT include disk templates that may use disk adoption and will be used in all respective checks. Signed-off-by:
Apollon Oikonomopoulos <apollon@noc.grnet.gr> Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Turns out with the current implementation of the type system a variable can both be required and not required. Interesting (but perhaps worth a further look). Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jun 23, 2010
-
-
Iustin Pop authored
For the type system, we want a slightly relaxed rule for constant naming, so we update the pylint rule. But the old _TPInt and _TNEString were not clear enough, so we expand them. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Currently, we have one structual validation for opcode attributes: the _OP_REQP, which checks that a given attribute is not 'None', and the rest of the checks are done at runtime. This means our type system has two types: None versus Not-None. We have been hit many times by small, trivial bugs in this area, and only a huge amount of unittest and/or hand-written checks would ensure that we cover all possibilities. This patch attempts to redress the needs for manual checks by introducing a micro-type system for the validation of the opcode attributes. What we lose, from the start, are the custom error messages (e.g. "Invalid reboot mode, choose one of …", or "The disk index must be a positive integer"). What we gain is the ability to express easily things as: - this parameter must be None or an int - this parameter must be a non-empty list - this parameter must be either none or a list of dictionaries with keys from the list of valid hypervisors and the values dictionaries with keys strings and values either None or strings; furthermore, the list must be non-empty These examples show that we have a composable (as opposed to just a few static types) system, and that we can nest it a few times (just for sanity; we could nest it up to stack depth). We also gain lots of ))))))), which is not that nice :) The current patch moves the existing _OP_REQP to the new framework, but if accepted, a lot more validations should move to it. In the end, we definitely should declare a type for all the opcode parameters (eventually moving _OP_REQP directly to opcodes.py and validating in the load/init case, and build __slots__ from it). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
For a few LUs, a few tests in, or even the whole CheckPrereq, can be moved to CheckArguments, as they don't touch state and only do a 'type' validation. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
Currently, the base class LogicalUnit's CheckPrereq will raise NotImplementedError, which means that the child LUs have to implement it. However, many LUs don't actually have a need for this function (hence the many "pass" statements as the only body). By changing the base class behaviour, we can simplify many LUs. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
All code has been switched to the new-style LU… time for cleanup. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch removes the last use of the old-style OpEvacuateNode. It also fixes the dry-run mode for this RAPI resource - the dry-run parameter was not used at all before. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
The export mode is checked in two places with the exact same code… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
When LogicalUnit.CheckArguments was introduced, not all code dealing with static argument checking was moved to it; many of these checks were left in ExpandNames. With time, most of them migrated, and this patch does the final cleanups. The patch is straightforward, with the exception of LURebootInstance, where an old style ParameterError exception is converted to the new OpPrereqError with ECODE_INVAL. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-