Statistics
| Branch: | Tag: | Revision:

root / lib / errors.py @ 0973f9ed

History | View | Annotate | Download (11.2 kB)

# Date Author Comment
9b221ea4 04/22/2013 10:20 am Michele Tartara

Allow proper cleanup of partially created disks

During the creation of an instance, if the creation of disks fails, some
partially created disks might remain lying around. There is an already
implemented cleanup procedure, but it requires the disks to be listed in the...

b8028dcf 12/19/2012 06:29 pm Michael Hanselmann

Replace frozenset with compat.UniqueFrozenset

This is not a trivial s/frozenset/compat.UniqueFrozenset/, but rather
only replaces “frozenset” where appropriate. Most of the places are
“static” information that doesn't change after the module has been
loaded....

e2dd6ece 12/10/2012 06:03 pm Michael Hanselmann

Change value for ECODE_TEMP_NORES

Unfortunately there was a bug in commit 518a45e whereby ECODE_TEMP_NORES
had the same value as ECODE_NORES, leading to failures in a Haskell
test. Of course this would also have affected other users of the constant.

Signed-off-by: Michael Hanselmann <>...

518a45e5 12/07/2012 02:47 pm Michael Hanselmann

Add error code for temporary lack of resources

When an instance creation uses opportunistic locks, the iallocator might
not be able to find an allocation solution if not enough node locks (or
a suboptimal subset thereof) were acquired. As per the design document...

402ff455 12/04/2012 05:24 pm Michael Hanselmann

errors: Show error descriptions in API documentation

Comments with a colon after the hash sign (“#:”) show up in the
epydoc output.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

1de1cf25 11/20/2012 07:50 pm Apollon Oikonomopoulos

Introduce new module for IP pool management

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...
86a24969 10/25/2012 08:57 pm Dato Simó

Errors.hs: improve field names for ConfigVersionMismatch

Change {exp,act}Code to {exp,act}Ver, which gives a better idea that
the integer fields represent version numbers.

Also:

- errors.py: update OpPrereqError's docstring to note that an error
code is always expected as the second argument (it was previously...
300e5450 10/12/2012 01:37 pm Michael Hanselmann

errors: Document arguments to QueryFilterParseError

Also fix one small mistake in the docstring for QuitGanetiException.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

012f9bc3 10/09/2012 11:16 am Iustin Pop

Remove unused/deprecated error classes

It seems a few of the error classes are no longer used:

- LVMError, deprecated in 8c5533a5 (before ganeti 1.2.2!)
- ConfdRequestError, deprecated in b0dcdc10
- SshKeyError, introduced in the initial open source commit but never used (⁈)...

fbdac0d9 10/05/2012 07:22 pm Michael Hanselmann

bdev: Add functions to verify file storage paths

- LoadAllowedFileStoragePaths: Loads a list of allowed file storage
paths from a file
- CheckFileStoragePath: Checks a path against the list of allowed paths

The unit test for “utils.IsBelowDir” is updated with cases which weren't...

776b6291 09/12/2012 04:14 pm René Nussbaumer

Rework the required_nodes field

This was used to verify the result of instance allocation. However, this
is not logic which belongs to the cmdlib rather than to the iallocator
request itself. So abstract it by its own function. And update the
ValidateResult accordingly....

7fe73c6f 07/20/2012 03:14 pm Iustin Pop

Make error classes more consistent

This removes "pass" from a few definitions, making all errors
consistent.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

615b7a0f 05/11/2012 05:01 pm Iustin Pop

Merge branch 'devel-2.5'

  • devel-2.5:
    Update NEWS and bump version for 2.5.1 release
    Fix gnt-group --help display
    Fix hardcoded Xen kernel path
    Fix grow-disk handling of invalid units
    Accept both PUT and POST in noded
    Preserve bridge MTU in KVM ifup script...
5fa90892 05/11/2012 04:40 pm Iustin Pop

Merge commit 'v2.5.1' into devel-2.5

  • commit 'v2.5.1':
    Update NEWS and bump version for 2.5.1 release
    Fix gnt-group --help display
    Fix hardcoded Xen kernel path
    Fix grow-disk handling of invalid units
    Accept both PUT and POST in noded
    Preserve bridge MTU in KVM ifup script...
98dfcaff 05/09/2012 12:17 pm Iustin Pop

Fix exception re-raising in Python Luxi clients

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...

352e1a26 04/26/2012 10:33 pm Michael Hanselmann

errors: Add exception for RAPI testing utilities

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...

aa66c183 12/22/2011 07:16 pm Michael Hanselmann

Merge branch 'devel-2.5'

  • devel-2.5:
    jqueue: Factorize checking job processor's result
    jqueue unittest: Rename simple fake-job class
    jqueue: Fix epylint errors introduced in 37d76f1e4
    jqueue: Fix deadlock between job queue and dependency manager...
b6522276 12/08/2011 06:21 pm Michael Hanselmann

utils.io.WritePidFile: Improve error reporting

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 <>
Reviewed-by: Iustin Pop <>

0aee8ee9 10/18/2011 05:21 pm Guido Trotter

Revert "Implementation of TLS-protected SPICE connections"

This reverts commit b6267745ede04b3c943bc02e004bdb9347e0f564.
This commit will be readded on master.

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

b6267745 09/20/2011 05:04 pm Andrea Spadaccini

Implementation of TLS-protected SPICE connections

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....
e687ec01 08/25/2011 01:53 pm Michael Hanselmann

PEP8 style fixes

Identified using the “pep8” utility.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

1ce03fb1 07/26/2011 02:19 pm Michael Hanselmann

Add ht-based result checks to opcodes

This adds the infrastructure necessary to check opcode results using
ht-based functions. Checks are added for two opcodes.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

7578ab0a 04/18/2011 06:55 pm Michael Hanselmann

qlang: Add parser for query filter language

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...
cbfa4f0f 02/22/2011 05:57 pm Michael Hanselmann

Merge branch 'devel-2.4'

  • devel-2.4: (60 commits)
    Update news and bump version for 2.4.0 rc2
    Fix pylint warnings
    TestRapiInstanceRename use instance name
    Change the list formatting to a 'special' chars
    Add support for merging node groups
    Add option to rename groups on conflict...
df156277 02/15/2011 03:20 pm Michael Hanselmann

errors: Add list of possible failure types

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

7e975535 01/31/2011 05:38 pm Stephen Shirley

Minor grammar fix in QuitGanetiException docstring

Signed-off-by: Stephen Shirley <>
Reviewed-by: Michael Hanselmann <>

7a8bda3f 10/28/2010 07:56 pm Michael Hanselmann

luxi.ProtocolError: Derive from errors.LuxiError

This allows LUXI errors to be encoded and serialized.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

4b63dc7a 10/13/2010 02:42 pm Iustin Pop

"Fix" handling of old software versions on startup

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...

0f979a34 08/18/2010 07:59 pm Guido Trotter

Merge branch 'devel-2.2'

  • devel-2.2:
    RAPI client: Support modifying instances
    RAPI: Allow modifying instance
    Small fixes for instance creation via RAPI documentation
    gnt-debug: Extend job queue tests
    jqueue: Mark opcodes following failed ones as failed, too...
8b312c1d 08/18/2010 11:26 am Manuel Franceschini

Introduce new IPAddress classes

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...

84f790e6 08/17/2010 04:34 pm Michael Hanselmann

errors: Function to check whether value is encoded error

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

31155d60 07/16/2010 12:47 pm Balazs Lecz

Add ParseCpuMask() utility function

Also adds a generic ParseError exception.

Signed-off-by: Balazs Lecz <>
Reviewed-by: Michael Hanselmann <>

7e5913a7 07/07/2010 05:50 pm Luca Bigliardi

Merge branch 'devel-2.1'

Signed-off-by: Luca Bigliardi <>
Reviewed-by: Iustin Pop <>

4c32a8bd 07/07/2010 05:45 pm Luca Bigliardi

Mlockall: decrease warnings if ctypes module is not present

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 <>...

3d6c5566 06/23/2010 01:32 pm Guido Trotter

jqueue._LoadJobFromDisk: remove safety archival

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...

e22af31d 05/21/2010 01:45 pm Guido Trotter

Remove errors.ConfdFatalError

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 <>...

d984846d 12/28/2009 02:05 pm Iustin Pop

Merge branch 'devel-2.0' into devel-2.1

  • devel-2.0:
    Fix indentation in hv_kvm
    Implement BuildHooksEnv for NoHooksLU
    Clarifiy some more wide pylint disables
    Fix two bugs in seldom-used codepaths
    Update pylintrc
    Add targetted pylint disables
    Partial cherry-pick of 6c881c5 from the 2.1 branch...
1e57442a 12/18/2009 03:01 pm René Nussbaumer

Fix a typo in the doc string

MaybeRaise in lib/errors.py had a typo in the doc string

Signed-off-by: René Nussbaumer <>
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

2c8a5690 11/06/2009 04:08 pm Guido Trotter

Add errors.ReservationError

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

104f4ca1 11/04/2009 01:54 pm Iustin Pop

Introduce a wrapper for hostname resolving

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)....

5c983ee5 11/02/2009 04:14 pm Iustin Pop

Introduce two-argument style for OpPrereqError

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...

159d4ec6 11/02/2009 04:06 pm Iustin Pop

Remove the OpRetryError exception

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....

a6607331 09/25/2009 06:56 pm Iustin Pop

Move the luxi error handling into errors.py

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....

e4ccf6cd 09/16/2009 03:55 pm Guido Trotter

Confd client library

Initial confd client library implementation. This initial version uses
asyncore, and supports answers via a callback.

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

c8eded0b 09/16/2009 03:55 pm Guido Trotter

AsyncUDPSocket: Move to a well defined UDP size

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 <>
Reviewed-by: Michael Hanselmann <>

9748ab35 09/16/2009 03:55 pm Guido Trotter

Move fourcc packing/unpacking to main confd module

This way it can be used by the client as well

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

589dee9a 08/28/2009 02:07 pm Guido Trotter

Add errors.InotifyError

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

6956e9cd 08/27/2009 06:21 pm Iustin Pop

Move the luxi error handling into errors.py

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....

b125e3b3 08/10/2009 03:56 pm Guido Trotter

Basic exceptions used by confd

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

ac2d0fe4 07/29/2009 03:11 pm Michael Hanselmann

Add first implementation of generic storage unit framework

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

f4a2f532 07/14/2009 01:35 pm Guido Trotter

HMAC authenticated json messages

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....

8e70b181 06/15/2009 08:08 pm Iustin Pop

Remove old invalid-os related functionality

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 <>
Reviewed-by: Guido Trotter <>

0623d351 06/15/2009 08:08 pm Iustin Pop

Conver node_leave_cluster rpc to new style result

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,...

a5728081 02/10/2009 05:06 pm Guido Trotter

Instance parameters: force typing

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...

f87b405e 12/17/2008 03:18 pm Michael Hanselmann

Add job queue size limit

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

c41eea6e 12/11/2008 07:13 pm Iustin Pop

Fix epydoc format warnings

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

686d7433 10/15/2008 01:52 pm Iustin Pop

Implement the job queue drain flag

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

6797ec29 10/15/2008 01:51 pm Iustin Pop

Implement transport of ganeti errors across luxi

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

d11bda8d 10/15/2008 01:51 pm Iustin Pop

Change the JobQueueError parent class

Currently this is not derived from GenericError, but there's no reason
for it to be so.

Reviewed-by: imsnah

f1da30e6 07/11/2008 07:17 pm Michael Hanselmann

Add experimental persistency to job queue

It's not perfect and it's not finished, but it's a start.

- Serial number is read only once, but written on each update
- Jobs are kept only on disk (caching will be implemented)

Reviewed-by: iustinp

9f9c8ee2 06/27/2008 05:27 pm Guido Trotter

Simplify QuitGanetiException instantiation

Rather than packing all the arguments in a tuple, let's pass them
plainly. The superclass won't complain.

Reviewed-by: iustinp

e50bdd68 06/26/2008 05:42 pm Guido Trotter

Add errors.QuitGanetiException

This exception does not signal an error but serves the purpose of making
the ganeti daemon shut down after handling a request. Currently it will
be used by ganeti-noded but in the future ganeti-masterd might make use
of it as well. Its usage is documented in the docstring....

b0059682 06/26/2008 05:41 pm Guido Trotter

Add missing empty line in SshKeyError's docstring

Reviewed-by: iustinp

7bca53e4 06/18/2008 03:32 pm Michael Hanselmann

ganeti-watcher: Replace custom exceptions with ganeti.error.*

Reviewed-by: iustinp

685ee993 04/28/2008 04:01 pm Iustin Pop

Convert cli.SubmitOpCode to use the master

This patch converts the cli.py SubmitOpCode method to use the unix
protocol and thus execute the opcodes via the master.

The patch allows a partial burnin to work with the master. Currently the
query opcodes, since they are executed via the SubmitOpCode, are...

2f31098c 10/10/2007 01:00 pm Iustin Pop

Remove the shebang from modules

Since modules are not directly executables, remove the shebang from
them. This helps with lintian warnings.

Also make the autogenerated _autoconf.py contain two comment lines at
the beginning, like the other modules.

Reviewed-by: ultrotter

305a7297 10/04/2007 02:51 pm Guido Trotter

Ship (and display) path for InvalidOS errors too.

- Document the expected change to errors.InvalidOS
- Always pass the additional argument
- Modify DiagnoseOS output to show the path

Reviewed-by: iustinp, imsnah

89e1fc26 09/21/2007 04:37 pm Iustin Pop

Remove requirement that host names are FQDN

We currently require that hostnames are FQDN not short names
(node1.example.com instead of node1). We can allow short names as long
as:
- we always resolve the names as returned by socket.gethostname()
- we rely on having a working resolver...

5c947f38 08/08/2007 12:37 pm Iustin Pop

Implement tag support for cluster, nodes and instances.

This is only the backend part, from the command line the tags can't be
read/modified yet.

Reviewed-by: imsnah

098c0958 07/26/2007 02:40 pm Michael Hanselmann

Comment formatting updates.

Reviewed-by: iustinp

a8083063 07/16/2007 04:39 pm Iustin Pop

Initial commit.