- Aug 22, 2012
-
-
Dimitris Aragiorgis authored
Add new library module lib/network.py. Introduce new class: AddressPool. AddressPool implements all operations needed for managing IPs inside the IP pool. Given a Network config object (nobj), the class: * initializes the corresponding IP pool object via network.AddressPool.InitializeNetwork(nobj) * obtains the corresponding IP pool object via network.AddressPool(nobj) * manipulates IPs inside the pool Signed-off-by:
Dimitris Aragiorgis <dimara@grnet.gr>
-
- May 09, 2012
-
-
Iustin Pop authored
Commit e687ec01 (present in 2.5 since the 2.5 beta 3) did consistency fixes across the code-base. Unfortunately this was done without enough checks on the actual meaning of one of the fixes, which means error re-raising in lib/errors.py is broken. The problem is that: raise cls, args is different than: raise cls(args) And our unit-tests didn't catch this (this patch updates the tests). This breakage is usually trivial, like wrong error messages: $ gnt-instance remove no-such-instance Failure: prerequisites not met for this operation: ("Instance 'no-such-instance' not known", 'unknown_entity') versus: $ gnt-instance remove no-such-instance Failure: prerequisites not met for this operation: error type: unknown_entity, error details: Instance 'no-such-instance' not known or: $ gnt-instance add … no-such-instance Failure: prerequisites not met for this operation: ('The given name (no-such-instance) does not resolve: Name or service not known', 'resolver_error') versus: $ gnt-instance add … no-such-instance Failure: prerequisites not met for this operation: error type: resolver_error, error details: The given name (no-such-instance) does not resolve: Name or service not known But in some cases where we rely on a certain data representation (e.g. HooksAbort), this actually breaks because we try to iterate over the wrong type: File "/usr/lib/python2.6/dist-packages/ganeti/cli.py", line 1907, in FormatError for node, script, out in err.args[0]: ValueError: need more than 1 value to unpack Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Apr 26, 2012
-
-
Michael Hanselmann authored
This exception is raised to abort before actually sending a LUXI call (there is no LUXI server involved in the test). The testing utilities catch the exception to report a success (i.e. the code didn't throw an exception before due to invalid types, etc.). To allow the exception to be thrown all the way to the test utilities, the HTTP server library must ignore it. Also some overly generic exception handling is removed from the RAPI request handler. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 08, 2011
-
-
Michael Hanselmann authored
If the PID file is already locked by another process, try to read the content and report it as part of the error message. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Oct 18, 2011
-
-
Guido Trotter authored
This reverts commit b6267745. This commit will be readded on master. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Sep 20, 2011
-
-
Andrea Spadaccini authored
Added support for TLS-protected SPICE connections: client/gnt_cluster.py, cli.py: * added three new parameters to renew-crypto (--new-spice-certificate, --spice-certificate, --spice-ca-certificate) and their validation. utils/x509.py: * changed GenerateSelfSignedSslCert so that now also returns the generated key and certificate; * added missing return value in the docstring of GenerateSelfSignedX509Cert. lib/bootstrap.py: * changed the signatures of the relevant functions and implemented certificates generation/writing. tools/cfupgrade: * changed GenerateClusterCrypto invocation to reflect the new signature; * added SPICE certificate names. lib/errors.py: * added the X509CertError class. lib/hypervisor/hv_kvm.py: * silenced pylint warning R0915 Signed-off-by:
Andrea Spadaccini <spadaccio@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 25, 2011
-
-
Michael Hanselmann authored
Identified using the “pep8” utility. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 26, 2011
-
-
Michael Hanselmann authored
This adds the infrastructure necessary to check opcode results using ht-based functions. Checks are added for two opcodes. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Apr 18, 2011
-
-
Michael Hanselmann authored
With this parser, command line utilities will be able to provide filters through query2 in a simplistic language. Example filters: name == "node3.example.com" master or (name == "node4.example.com") be/memory == 128 and name =~ /^web/i "inst1.example.com" in sinst_list status != "up" not master Parts of the syntax came from Python, others from Perl. Documentation will be added in follow-up patches. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Feb 15, 2011
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jan 31, 2011
-
-
Stephen Shirley authored
Signed-off-by:
Stephen Shirley <diamond@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Oct 28, 2010
-
-
Michael Hanselmann authored
This allows LUXI errors to be encoded and serialized. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Oct 13, 2010
-
-
Iustin Pop authored
Currently, masterd startup with old software versions is very confusing for users: we present two tracebacks, with a message in the middle about "version mismatch". This can lead to users believing that all that needs to be done is to fix the config file. This patch attempts to improve this by handling this case in masterd itself (not in the child), and showing a more friendly message for this case. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 18, 2010
-
-
Manuel Franceschini authored
This patch unifies the netutils functions dealing with IP addresses to three classes: - IPAddress: Common IP address functionality - IPv4Address: IPv4 specific functionality - IPv6address: IPv6-specific functionality Furthermore it adds methods to check whether an address is a loopback address, replacing the .startswith("127") for IPv4 and adding IPv6 support. It also provides the basis for future IPv6 address handling. Methods to convert IP strings to their corresponding interger values will allow to canonicalize IPv6 addresses. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 17, 2010
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 16, 2010
-
-
Balazs Lecz authored
Also adds a generic ParseError exception. Signed-off-by:
Balazs Lecz <leczb@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jul 07, 2010
-
-
Luca Bigliardi authored
Node daemon prints a lot of warnings if --no-mlock option is not specified and ctypes module is not present. With the following patch the warning is printed only at noded startup. Signed-off-by:
Luca Bigliardi <shammash@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jun 23, 2010
-
-
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>
-
- May 21, 2010
-
-
Guido Trotter authored
This exception is caught, but never thrown. It became useless when we moved confd from on/off to enabled/disabled, but always running on all nodes. Removing its definition and the code catching it can do no harm. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Dec 18, 2009
-
-
René Nussbaumer authored
MaybeRaise in lib/errors.py had a typo in the doc string Signed-off-by:
René Nussbaumer <rn@google.com> Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Nov 06, 2009
-
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Nov 04, 2009
-
-
Iustin Pop authored
Currently a few of the LU's CheckPrereq use utils.HostInfo which raises a resolver error in case of failure. This is an exception from the standard that CheckPrereq should raise an OpPrereqError if the error is in the 'pre' phase (so that it can be retried). This patch adds a new error code (resolver_error) and a wrapper over utils.HostInfo that just converts the ResolverError into OpPrereqError(…, errors.ECODE_RESOLVER). It then uses this wrapper in cmdlib, bootstrap and some scripts. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Nov 02, 2009
-
-
Iustin Pop authored
This patch introduces a two-argument style for OpPrereqError. Only the direct raise calls in cmdlib.py are converted, other users will follow. cli.py is modified to handle both two-argument style and the current format. RAPI doesn't need modification as the way we encode errors is already using a list for the error arguments, so RAPI users only need to start checking the list length and the second argument. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
This is only used in two places, in an error path that is no longer valid since Ganeti 2.0. We remove the try..except since we should not get it anymore (and if we do, then we should catch it in all config.Update cases) and we remove the exception class completely. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Sep 25, 2009
-
-
Iustin Pop authored
Currently the luxi error handling is hardcoded as special encoding on the masterd-side and special decoding on the client side. This patch moves it to errors.py such that other parts of the code can reuse the same encoding. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com> (cherry picked from commit 6956e9cd)
-
- Sep 16, 2009
-
-
Guido Trotter authored
Initial confd client library implementation. This initial version uses asyncore, and supports answers via a callback. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
This way it can be used by the client as well Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
Currently we read maximum 4K packets, and don't check packets when sending them. With this patch we move to a well defined maximum size of 60K. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 28, 2009
-
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 27, 2009
-
-
Iustin Pop authored
Currently the luxi error handling is hardcoded as special encoding on the masterd-side and special decoding on the client side. This patch moves it to errors.py such that other parts of the code can reuse the same encoding. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 10, 2009
-
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 29, 2009
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 14, 2009
-
-
Guido Trotter authored
This patch includes HMAC authenticated json messages to the serializer. The new interface works on any json-encodable data type, and can sign it with a private key and an optional salt. The same private key must be used upon message loading to verify the message. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jun 15, 2009
-
-
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
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>
-
- Feb 10, 2009
-
-
Guido Trotter authored
We want all the hv/be parameters to have a known type, rather than a random mix of empty string, boolean values, and None, so we declare the type of each variable and we enforce/convert it. - Add some new constants for enforceable value types - Add new constants dicts HVS_PARAMETER_TYPES and BES_PARAMETER_TYPES holding not only the valid parameters but also their types - Drop the old HVS_PARAMETERS and BES_PARAMETERS constants and calculate the values from the type dict - Convert all the default parameters to a valid type value - Create a new ForceDictType utils function, to check/enforce a dict's element value types, with relevant unit tests - Drop a few custom functions to check/convert the BE param types in utils and cli, in favor of ForceDictType - Double-check the parameter types using ForceDictType in both scripts and LogicalUnits, when possible. As a bonus: - Remove some old commented-out code in gnt-instance - Remove some already fixed FIXME - Fix a bug which prevented VALUE_DEFAULT to be applied to BE parameters in SetInstanceParams because the value was checked for validity before that transformation was made - Fix a bug which prevented initing a cluster and passing hvparams to work at all - ForceDictType allows an allowed_values for exceptions, which makes us able to do the checking even when some values must not be converted/typechecked (for example the 'default' string in SetInstanceParameters) Reviewed-by: iustinp
-
- Dec 17, 2008
-
-
Michael Hanselmann authored
A job queue with too many jobs can increase memory usage and/or make the master daemon slow. The current limit is just an arbitrary number. A "soft" limit for automatic job archival is prepared. Reviewed-by: iustinp
-
- Dec 11, 2008
-
-
Iustin Pop authored
This patch should fix all outstanding epydoc parsing errors; as such, we switch epydoc into verbose mode so that any new errors will be visible. Reviewed-by: imsnah
-
- Oct 15, 2008
-
-
Iustin Pop authored
We add a (per-node) queue drain flag that blocks new job submission. There is not yet an interface to add/remove the flag (will come in next patches). Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds a generic method to identify the ganeti error given its class name, and implements this across the luxi protocol. Reviewed-by: imsnah
-