Breaking these down would make them more readable than the huge one-liners.
[4]
+# Another interesting issue, process recovery using the on disk state,
+# is complicated by consistency to the the in memory state, which
+# won't be directly recoverable anymore without some state specific
Sweet. Thanks for capturing those ideas.
[5]
+ # If the unit lifecycle isn't running we shouldn't process
+ # any relation resolutions.
+ if not self._running:
+ self._log.debug("stop watch relation resolved changes")
+ self._watching_relation_resolved = False
+ raise StopWatcher()
It's not clear what's the intention here, and test coverage also
looks a bit poor in this area (e.g. replacing everything under the "if" by
"return" still passes tests fine).
What do we want to happen in this case, and what's the rationale
behind it?
[6]
+ if self._client.connected:
+ yield self._process_relation_resolved_changes()
What's the "if connected" test about? It feels like pretty much every
interaction with zk could have such a test. Why is this location
special?
Nice, thanks for the changes. Looking good!
+1, taking these in consideration:
[2]
+ def do_retry_ upgrade_ formula_ hook(self, fire_hooks=True):
The fire_hooks seems to be a left over.
[3]
+ return self._invoke_ lifecycle( .start, fire_hooks= False). addCallback( lifecycle( .configure, fire_hooks=False)) lifecycle( .start, fire_hooks= False). addCallback( lifecycle( .configure) )
+ self._lifecycle
+ lambda x: self._invoke_
+ self._lifecycle
(...)
+ return self._invoke_
+ self._lifecycle
+ lambda x: self._invoke_
+ self._lifecycle
Breaking these down would make them more readable than the huge one-liners.
[4]
+# Another interesting issue, process recovery using the on disk state,
+# is complicated by consistency to the the in memory state, which
+# won't be directly recoverable anymore without some state specific
Sweet. Thanks for capturing those ideas.
[5]
+ # If the unit lifecycle isn't running we shouldn't process debug(" stop watch relation resolved changes") relation_ resolved = False
+ # any relation resolutions.
+ if not self._running:
+ self._log.
+ self._watching_
+ raise StopWatcher()
It's not clear what's the intention here, and test coverage also
looks a bit poor in this area (e.g. replacing everything under the "if" by
"return" still passes tests fine).
What do we want to happen in this case, and what's the rationale
behind it?
[6]
+ if self._client. connected: relation_ resolved_ changes( )
+ yield self._process_
What's the "if connected" test about? It feels like pretty much every
interaction with zk could have such a test. Why is this location
special?