High availability support#402
Conversation
|
Can one of the admins verify this patch? |
1 similar comment
|
Can one of the admins verify this patch? |
|
This is work in progress. |
|
Added api_endpoints property to controller |
| self._connection.endpoints = [ | ||
| (e, controller["ca-cert"]) | ||
| for e in controller["api-endpoints"] | ||
| ] |
There was a problem hiding this comment.
@SimonRichardson I would like to set the endpoints within the Connection, but the problem is that if I get the controller from the connection, it enters into a loop.
If you come up with a better solution, let me know :-)
| self.addr = None | ||
| self.ws = None | ||
| self.endpoint = None | ||
| self.endpoints = None |
There was a problem hiding this comment.
I'm wondering if we can get rid of self.endpoint altogether and then say self.endpoints = [endpoint]. That way we reduce the number of if isinstance(endpoint, str) etc.
There was a problem hiding this comment.
I can do this: self.endpoints = [endpoint]
But removing the self.endpoint is more complicated, because that variable is used to by the class to know to which endpoint in particular it is connected to
There was a problem hiding this comment.
mmmmm but if I do [endpoint], and endpoint is a list, then self.endpoints will be [["endpoint1", ...]]
There was a problem hiding this comment.
@davigar15 then we need to update self.endpoint to always be the one it's connected to. That way we're always in sync.
There was a problem hiding this comment.
@SimonRichardson That is updated in line 629, in the _connect function.
Every time libjuju reconnects, it executes the function _connect, and then this is executed:
self.endpoint = result[2]
|
|
|
!!build!! |
|
|
This patch aims to add HA support in libjuju, and fix bug #395.
There are a few things that have to be implemented: