Merge lp:~hazmat/pyjuju/managed-zk-client into lp:pyjuju
Proposed by
Kapil Thangavelu
Status: | Merged |
---|---|
Merged at revision: | 526 |
Proposed branch: | lp:~hazmat/pyjuju/managed-zk-client |
Merge into: | lp:pyjuju |
Diff against target: |
274 lines (+18/-26) 10 files modified
juju/agents/base.py (+2/-1) juju/charm/tests/test_publisher.py (+1/-3) juju/lib/testing.py (+2/-1) juju/providers/dummy.py (+3/-2) juju/providers/local/__init__.py (+1/-0) juju/state/tests/common.py (+1/-3) juju/state/tests/test_base.py (+3/-5) juju/state/tests/test_initialize.py (+1/-3) juju/state/tests/test_relation.py (+1/-2) juju/state/tests/test_utils.py (+3/-6) |
To merge this branch: | bzr merge lp:~hazmat/pyjuju/managed-zk-client |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+101132@code.launchpad.net |
Description of the change
managed zk connections for transient and session failures.
This branch switches agents to use managed session clients
which automatically retry in the face of transient disconnections, and
automatically restablish session on expiration (with watch
and ephemeral node handling).
To post a comment you must log in.
Reviewers: mp+101132_ code.launchpad. net,
Message:
Please take a look.
Description:
managed zk connections for transient and session failures.
This branch switches agents to use managed session clients
which automatically retry in the face of transient disconnections, and
automatically restablish session on expiration (with watch
and ephemeral node handling).
https:/ /code.launchpad .net/~hazmat/ juju/managed- zk-client/ +merge/ 101132
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/5989050/
Affected files: tests/test_ publisher. py dummy.py local/_ _init__ .py tests/common. py tests/test_ base.py tests/test_ initialize. py tests/test_ relation. py tests/test_ utils.py
A [revision details]
M juju/agents/base.py
M juju/charm/
M juju/lib/testing.py
M juju/providers/
M juju/providers/
M juju/state/
M juju/state/
M juju/state/
M juju/state/
M juju/state/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision:
<email address hidden>
Index: juju/agents/base.py base.py' server
=== modified file 'juju/agents/
--- juju/agents/base.py 2011-11-30 09:22:38 +0000
+++ juju/agents/base.py 2012-04-04 04:04:30 +0000
@@ -13,6 +13,7 @@
from twisted.python.log import PythonLoggingOb
from txzookeeper import ZookeeperClient
+from txzookeeper.managed import ManagedClient
from juju.control. options import setup_twistd_ options existing_ session( ) ().connect( ).connect(
self.config[ "zookeeper_ servers" ])
save_ client_ id(
self.config[ "session_ file"], self.client. client_ id)
from juju.errors import NoConnection, JujuError
@@ -202,7 +203,7 @@
def connect(self):
"""Return an authenticated connection to the juju zookeeper."""
yield self._kill_
- self.client = yield ZookeeperClient
+ self.client = yield ManagedClient(
Index: juju/lib/testing.py testing. py' trial.unittest import TestCase as TrialTestCase
=== modified file 'juju/lib/
--- juju/lib/testing.py 2012-03-29 22:34:58 +0000
+++ juju/lib/testing.py 2012-04-06 14:42:06 +0000
@@ -10,6 +10,7 @@
from twisted.
from txzookeeper import ZookeeperClient
+from txzookeeper.managed import ManagedClient
from juju.lib.mocker import MockerTestCase zookeeper_ address
returnValue( True)
from juju.tests.common import get_test_
@@ -154,7 +155,7 @@
def get_zookeeper_ client( self):
get_test_ zookeeper_ address( ), session_ timeout= 1000)
- client = ZookeeperClient(
+ client = ManagedClient(
return client
Index: juju/providers/ dummy.py /dummy. py' dummy.py 2012-03-29 01:37:57 +0000 dummy.py 2012-04-06 16:35:31 +0000
=== modified file 'juju/providers
--- juju/providers/
+++ juju/providers/
@@ -4,7 +4,8 @@
from twisted. internet. defer import inlineCallbacks, returnValue, succeed,
fail
-from txzookeeper import ZookeeperClient
+#from txzookeeper import ZookeeperClient
+from txzookeeper....