History | View | Annotate | Download (21.4 kB)
Introduce new IPAddress classes
This patch unifies the netutils functions dealing with IP addresses tothree 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...
Confd IPv6 support
This patch series basically adds a new parameter 'family' to the constructorsof daemon.AsyncUDPSocket and confd.client.ConfdUDPClient. This enables theusers of these two classes to support IPv6.
In ganeti-confd.ConfdAsyncUDPClient a method to check the address families of...
Introduce lib/netutils.py
This patch moves network utility functions to a dedicated module.
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add separate module for backported language functionality
utils.py, where they were before, is already huge.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
ConfdClient.SendRequest: allow max coverage
This patch changes the coverage parameter to allow specification of maxcoverage (via -1), versus auto-computation (default, 0) and manualspecification.
Unittests are updated for this case too.
Signed-off-by: Iustin Pop <iustin@google.com>...
Add a new confd callback (StoreResultCallback)
This new callback simply stores (without calling any lower-levelcallback) the last result; coupled with the filtering callback, thisensures that it has the 'best' response after all have been received.
The result can then be retrieved via the GetResponse method....
ConfdClient: add synchronous wait for replies mode
Currently, there is no way for a user of the confd client library toknow 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...
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 requesttracking, e.g. via packet stats and/or extension of expiration time....
Fix consistency checks in ConfdFilterCallback
Commit 49b3fda added consistency checks, but these are wrongly triggeredfor old responses - we need to make sure to check that we have the sameserial.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Extend ConfdFilterCallback with consistency checks
Note that users of the callback will have to manually check theattribute.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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 thatwe don't duplicate the code.
Replace @keyword with @param in confd client
@keyword was used inappropriately.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
ConfdClient: add synchronous features
By sending requests with async=False, and receiving replies withReceiveReply we can more easily use confd from a synchronous client.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
ConfdCountingCallback
This new confd callback counts received replies for the registeredqueries.
confd client: copy the peers in UpdatePeerList
Since the peer list is shuffled by the client, we don't keep a referenceto the list which was passed in, but copy it internally.
Fix unused imports or add silences where needed
In some cases pylint doesn't parse the import correctly, so we addsilences; but there are also many cases of unused imports, which wesimply remove.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
pylint cleanups: dangerous initializers
Plus a silence for a wrong "uninitialized var".
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 ofthe JobQueue class. Since that is actually a function and not a method...
Code and docstring style fixes
Found using pylint and epydoc.
confd/client: make it possible to update peer list
Until now the peers have to be the same all the time. Adding a newfunction to update the list, and call it from the constructor to avoidduplicating code.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
confd/client: pass self to upcalls
It may be handy for upcalls to know which client called them, and callit back. So we create a new "client" field in the upcall target,containing the current client instance
ConfdFilterCallback: fix a bug in expire
The HandleExpire function takes the whole "up" structure, and not justthe salt.
Implement ConfdFilterCallback
This callback can be stacked with another one, and will filter duplicateor old results, making handling of results easier.
Confd client: add module level documentation
Populate the docstring with documentation on the client library's usage.
Unpack the confd reply as an object, from the dict
Confd client: make SendRequest args optional
By default "None" will be used as an args value
Confd client: Change callback model
We move to one callback in total, rather than one per call, and call itboth for server replies and request expiring.
Confd client: make confd port configurable
The port can be now chosen at library init time, with a default ofcalling GetDaemonPort.
Confd client library: enable optional logging
If a logger is passed in, we log some debugging messages that might helpsomeone who's debugging a confd client to understand what's going on.
Confd client library
Initial confd client library implementation. This initial version usesasyncore, and supports answers via a callback.