Added .is_leader method to Unit class.
authorPete Vander Giessen <petevg@gmail.com>
Mon, 21 Nov 2016 21:49:40 +0000 (16:49 -0500)
committerPete Vander Giessen <petevg@gmail.com>
Mon, 21 Nov 2016 21:56:48 +0000 (16:56 -0500)
commit46068aa5a109559d884022e77ab0a4b864d9b4ad
treeb95771c7222ab8622a395d6fbd2c7cdd92662530
parentedc3fa5061258968907f7cb9454fd43576f956bd
Added .is_leader method to Unit class.

As leadership is not exposed via deltas in the current version of the
juju websocket api, we have to spin up a ClientFacade and dig through
FullStatus for the information we need.

A ticket for adding leadership info to the deltas lives here:
https://bugs.launchpad.net/juju/+bug/1643691
examples/leadership.py [new file with mode: 0644]
juju/unit.py