- Jun 30, 2010
-
-
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
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Guido Trotter <ultrotter@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>
-
Guido Trotter authored
Why it's needed here but not a few lines above is a mistery that only pylint understands. Also fix an indentation error in another disable, for the same function. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
René Nussbaumer authored
Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jun 29, 2010
-
-
Guido Trotter authored
Each luxi connection now creates an asyncore MasterClientHandler (which is an AsyncTerminatedMessageStream subclass, sending each message to a client worker). This makes it harder to DOS the master daemon by just creating luxi connections, as each of them will use memory and file descriptors, but not a dedicated thread. Each connection will only handle one message at a time. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
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>
-
Michael Hanselmann authored
This should catch cases where we update the configuration version, but forget to adjust cfgupgrade accordingly. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
This is needed in a new test script for cfgupgrade where it's better to only use the minimum parts necessary for testing cfgupgrade. Including full configuration data to ensure verification doesn't fail would make maintenance difficult. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
In the condition for checking the configuration directory, one “or” should have been an “and”. This bug was in cfgupgrade since commit 95e4a814 (June 2008). Found thanks to a test script. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Since configuration changes are now usually done in the configuration writer class, cfgupgrade's only task is to change the config version. This means we can easily support upgrading from Ganeti 2.0 and 2.1 to 2.2. This patch also brings a couple of small cleanups. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Michael Hanselmann authored
Three constants were no longer user after commit 11c31f5c, which removed support for upgrading from Ganeti 1.2. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@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
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>
-