Statistics
| Branch: | Tag: | Revision:

root / lib / confd @ 7142485a

# Date Author Comment
3ccb3a64 02/21/2012 05:23 pm Michael Hanselmann

Replace single- with double-quotes

In at least two cases "%s" is replaced with str(), too.

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

b459a848 08/30/2011 11:24 am Andrea Spadaccini

DeprecationWarning fixes for pylint

In version 0.21, pylint unified all the disable-* (and enable-*)
directives to disable (resp. enable). This leads to a lot of
DeprecationWarning being emitted even if one uses the recommended
version of pylint (0.21.1, as stated in devnotes.rst)....

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

f299ca21 08/19/2011 05:51 pm Michael Hanselmann

Unify some file headers

Remove unnecessary commas, add empty lines where necessary to make them
consistent.

I'm working on a script to check this, but it's not yet ready.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

58aa30d7 08/05/2011 04:41 pm Michael Hanselmann

confd.querylib: Remove long-deprecated query mode

This was never used by a stable version.

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

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

d8bcfe21 07/12/2010 03:58 pm Manuel Franceschini

Confd IPv6 support

This patch series basically adds a new parameter 'family' to the constructors
of daemon.AsyncUDPSocket and confd.client.ConfdUDPClient. This enables the
users of these two classes to support IPv6.

In ganeti-confd.ConfdAsyncUDPClient a method to check the address families of...

a744b676 07/09/2010 04:37 pm Manuel Franceschini

Introduce lib/netutils.py

This patch moves network utility functions to a dedicated module.

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Iustin Pop <>

cea881e5 04/21/2010 08:48 pm Michael Hanselmann

Add separate module for backported language functionality

utils.py, where they were before, is already huge.

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

cc6484c4 04/09/2010 10:57 am Iustin Pop

ConfdClient.SendRequest: allow max coverage

This patch changes the coverage parameter to allow specification of max
coverage (via -1), versus auto-computation (default, 0) and manual
specification.

Unittests are updated for this case too.

Signed-off-by: Iustin Pop <>...

aa2efc52 04/08/2010 06:50 pm Iustin Pop

Add a new confd callback (StoreResultCallback)

This new callback simply stores (without calling any lower-level
callback) the last result; coupled with the filtering callback, this
ensures that it has the 'best' response after all have been received.

The result can then be retrieved via the GetResponse method....

bfbbc223 04/08/2010 06:50 pm Iustin Pop

ConfdClient: add synchronous wait for replies mode

Currently, there is no way for a user of the confd client library to
know how many replies there should be, whether all have been received,
etc. This is bad since we can't reliably detect the consistency of the...

71e114da 04/08/2010 06:50 pm Iustin Pop

ConfdClient: unify some internal variables

Currently the requests are tracked in _request and in _expire_requests.
This is conventient, but it restricts the ability to extend the request
tracking, e.g. via packet stats and/or extension of expiration time....

39292d3a 04/07/2010 04:57 pm Iustin Pop

Fix consistency checks in ConfdFilterCallback

Commit 49b3fda added consistency checks, but these are wrongly triggered
for old responses - we need to make sure to check that we have the same
serial.

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

49b3fdac 04/06/2010 12:51 pm Iustin Pop

Extend ConfdFilterCallback with consistency checks

Note that users of the callback will have to manually check the
attribute.

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

5b349fd1 04/06/2010 12:27 pm Iustin Pop

Abstract the confd client creation

Most creation of confd clients will do the same steps: read MC file,
parse it, read HMAC key, etc. We abstract this functionality so that
we don't duplicate the code.

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

d63997b3 03/18/2010 01:39 pm Guido Trotter

Replace @keyword with @param in confd client

@keyword was used inappropriately.

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

8496d93c 03/18/2010 01:39 pm Guido Trotter

ConfdClient: add synchronous features

By sending requests with async=False, and receiving replies with
ReceiveReply we can more easily use confd from a synchronous client.

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

04cdf663 03/18/2010 01:39 pm Guido Trotter

ConfdCountingCallback

This new confd callback counts received replies for the registered
queries.

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

6b7d5878 03/15/2010 06:40 pm Michael Hanselmann

Rightname confd's HMAC key

Currently, the ganeti-confd's HMAC key is called “cluster HMAC key” or
simply “HMAC key” everywhere. With the implementation of inter-cluster
instance moves, another HMAC key will be introduced for signing critical
data. They can not be the same, so this patch clarifies the purpose of the...

db169865 01/14/2010 07:07 pm Guido Trotter

confd client: copy the peers in UpdatePeerList

Since the peer list is shuffled by the client, we don't keep a reference
to the list which was passed in, but copy it internally.

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

30e4e741 01/04/2010 11:20 am Iustin Pop

Fix unused imports or add silences where needed

In some cases pylint doesn't parse the import correctly, so we add
silences; but there are also many cases of unused imports, which we
simply remove.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

2d54e29c 01/04/2010 11:17 am Iustin Pop

Further pylint disables, mostly for Unused args

Many of our functions have to follow a given API, and thus we have to
keep a given signature, but pylint doesn't understand this. Therefore,
we silence this warning.

The patch does a few other cleanups.

Signed-off-by: Iustin Pop <>...

e11ddf13 01/04/2010 11:16 am Iustin Pop

pylint cleanups: dangerous initializers

Plus a silence for a wrong "uninitialized var".

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

7260cfbe 01/04/2010 11:15 am Iustin Pop

Add targeted pylint disables

This patch should have only:

- pylint disables
- docstring changes
- whitespace changes

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

1122eb25 01/04/2010 11:10 am Iustin Pop

Remove many 'Unused variable' warnings

Note there are some cases left which need extra cleanup.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

07b8a2b5 01/04/2010 10:42 am Iustin Pop

Fix use of the logging functions

The logging functions expand the arguments themselves, thus it's safer
to let them do it rather than manual string formatting.

Also re-wraps one comment.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

43dc8496 12/02/2009 04:01 pm Guido Trotter

ClusterMasterQuery: add primary ip field

By allowing also the primary ip field to be fetched directly, we avoid
one more confd lookup, or dns request, to find out which address the
master node lives at.

Signed-off-by: Guido Trotter <>

250554a9 12/02/2009 03:08 pm Guido Trotter

confd ClusterMasterQuery: allow fields request

Change the ClusterMasterQuery to allow a query, and if present accept a
list of fields to be returned. Currently only name and ip are accepted.

This feature will be used by NLD to route the cluster ip over the nbma....

6c881c52 11/06/2009 03:48 pm Iustin Pop

Fix pylint 'E' (error) codes

This patch adds some silences and tweaks the code slightly so that
“pylint --rcfile pylintrc -e ganeti” doesn't give any errors.

The biggest change is in jqueue.py, the move of _RequireOpenQueue out of
the JobQueue class. Since that is actually a function and not a method...

23057d29 11/02/2009 02:05 pm Michael Hanselmann

Epydoc fixes

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

19351457 10/26/2009 04:48 pm Guido Trotter

InstanceIpToNodePrimaryIpQuery: use a query dict

In 95b487b we changed InstanceIpToNodePrimaryIpQuery to be able to query
multiple instances at once. We also need to be able to query ips
belonging to a specific nic link, so what we do is:

1) Move the "query" argument to a dict, containing different fields...

cd195419 10/26/2009 04:48 pm Guido Trotter

SimpleConfigReader: ips are partitioned by link

We were already half-doing it, but this completes the process.

1) We don't maintain a list of ips or an ip->instance map
2) We add a new link,ip->instance map (link->ips list we had)
3) We add the link parameter to GetInstanceByIp (making it...

6855f043 10/26/2009 12:17 pm Guido Trotter

Import errors in confd init

It's used by some functions defined there.

Signed-off-by: Guido Trotter <>
Reviewed-by: Olivier Tharan <>

95b487bb 10/22/2009 04:40 pm Flavio Silvestrow

confd: query the pnode of multiple instances at once

Signed-off-by: Flavio Silvestrow <>
Signed-off-by: Guido Trotter <>
Reviewed-by: Guido Trotter <>

69b99987 10/12/2009 01:48 pm Michael Hanselmann

Code and docstring style fixes

Found using pylint and epydoc.

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

23824641 09/30/2009 05:49 pm Luca Bigliardi

Extend confd instances ips query

The query now accepts a link parameter.

Signed-off-by: Luca Bigliardi <>
Reviewed-by: Guido Trotter <>

a5229439 09/29/2009 01:06 pm Guido Trotter

confd/client: make it possible to update peer list

Until now the peers have to be the same all the time. Adding a new
function to update the list, and call it from the constructor to avoid
duplicating code.

Signed-off-by: Guido Trotter <>...

5f6f260a 09/28/2009 06:58 pm Guido Trotter

confd/client: pass self to upcalls

It may be handy for upcalls to know which client called them, and call
it back. So we create a new "client" field in the upcall target,
containing the current client instance

Signed-off-by: Guido Trotter <>...

a9613def 09/28/2009 12:37 pm Guido Trotter

ConfdFilterCallback: fix a bug in expire

The HandleExpire function takes the whole "up" structure, and not just
the salt.

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

392ca296 09/25/2009 05:37 pm Guido Trotter

Implement ConfdFilterCallback

This callback can be stacked with another one, and will filter duplicate
or old results, making handling of results easier.

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

cf7b0cc4 09/25/2009 05:37 pm Guido Trotter

Confd client: add module level documentation

Populate the docstring with documentation on the client library's usage.

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

c103d7ae 09/24/2009 01:04 pm Guido Trotter

Unpack the confd reply as an object, from the dict

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

90469357 09/23/2009 06:07 pm Guido Trotter

Confd client: make SendRequest args optional

By default "None" will be used as an args value

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

96e03b0b 09/23/2009 06:07 pm Guido Trotter

Confd client: Change callback model

We move to one callback in total, rather than one per call, and call it
both for server replies and request expiring.

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

7d20c647 09/23/2009 06:07 pm Guido Trotter

Confd client: make confd port configurable

The port can be now chosen at library init time, with a default of
calling GetDaemonPort.

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

a3db74e4 09/23/2009 06:07 pm Guido Trotter

Confd client library: enable optional logging

If a logger is passed in, we log some debugging messages that might help
someone who's debugging a confd client to understand what's going on.

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

d01ae714 09/22/2009 05:35 pm Luca Bigliardi

Confd: add instances IPs query

Extend confd to answer queries about instances IPs.

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

efbb4fd2 09/16/2009 04:55 pm Luca Bigliardi

Confd: add primary IPs queries

Extend confd to answer queries about nodes primary IPs and master candidates
primary IPs.

Signed-off-by: Luca Bigliardi <>
Reviewed-by: Michael Hanselmann <>

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

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

4d4a651d 09/11/2009 05:33 pm Michael Hanselmann

Wrap lines over 80 characters

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

d73ef63f 09/03/2009 06:45 pm Michael Hanselmann

A few style fixes

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

48166551 08/31/2009 06:43 pm Guido Trotter

confd: add cluster master query

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

0bc8432b 08/31/2009 06:43 pm Guido Trotter

confd/querylib: fix docstrings

They were cut&paste from the first example queries, rather than
documenting the current ones.

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

05f1ebf3 08/28/2009 05:44 pm Guido Trotter

Move SimpleConfigReader creation to ConfdProcessor

This will be useful to make ConfdProcessor aware of a config failure,
without quitting confd.

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

e369f21d 08/28/2009 05:44 pm Guido Trotter

ConfdProcessor: add disabled state

This is a state the processor will get in, if it fails to load the
config.

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

53bd7366 08/12/2009 01:02 pm Guido Trotter

InstanceIpToNodePrimaryIpQuery

This implements CONFD_REQ_NODE_PIP_BY_INSTANCE_IP, and maps instance ips
to primary node ips.

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

7189e790 08/12/2009 01:02 pm Guido Trotter

querylib: abstract a couple of common errors

Rather than composing them every time, we'll keep "ready-made" tuples
for unknown entries and internal errors (which is, yet, unused)

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

6daf26a0 08/12/2009 12:54 pm Guido Trotter

Add NodeRoleQuery

This implements CONFD_REQ_NODE_ROLE_BYNAME.

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

4d5db19c 08/12/2009 12:54 pm Guido Trotter

Remove unused imports from confd files

confd.server and daemons/ganeti-confd import a few modules they don't
actually use. Clean them up.

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

12ce965f 08/12/2009 12:54 pm Guido Trotter

ConfdProcessor fix init docstring

The message is an error deriving from some code moving/refactoring
happening before the initial submission

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

e16e4824 08/12/2009 12:54 pm Guido Trotter

Implement confd queries

We'll start with a simple ping query, which returns ok if it gets no
query argument, and an error if it gets any. Also non-implemented query
are handled by the base ConfdQuery class, so we don't have to
special-case them in ConfdProcessor anymore....

d21eda27 08/12/2009 12:54 pm Guido Trotter

ConfdProcessor: move verification to init

During a query execution we currently verify whether we have that query
supported in our dispatch table. Since it's an error not to have it
anyway, we move this verification to the class creation, erroring out...

71f27d19 08/10/2009 04:46 pm Guido Trotter

confd.server.ConfdProcessor

A ConfdProcessor is the job processor for a confd query.
It's responsible for all the processing, from unpacking it, verifying
it, to calculating the result.

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

12426ae1 08/10/2009 03:57 pm Guido Trotter

Add empty ganeti.confd module

It will be used for the confd server code, and for a basic client
library.

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