mirror of https://github.com/docker/docker-py.git
Adding swarm id_attribute to match docker output
Swarm id is returned in a attribute with the key ID. The swarm model was using the default behaviour and looking for Id. Signed-off-by: Steve Clark <steve@cobe.io>
This commit is contained in:
parent
ba66b09e2b
commit
1d77ef9e53
|
@ -9,6 +9,8 @@ class Swarm(Model):
|
|||
The server's Swarm state. This a singleton that must be reloaded to get
|
||||
the current state of the Swarm.
|
||||
"""
|
||||
id_attribute = 'ID'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Swarm, self).__init__(*args, **kwargs)
|
||||
if self.client:
|
||||
|
|
|
@ -22,6 +22,7 @@ class SwarmTest(unittest.TestCase):
|
|||
assert client.swarm.attrs['Spec']['Raft']['SnapshotInterval'] == 5000
|
||||
client.swarm.update(snapshot_interval=10000)
|
||||
assert client.swarm.attrs['Spec']['Raft']['SnapshotInterval'] == 10000
|
||||
assert client.swarm.id
|
||||
assert client.swarm.leave(force=True)
|
||||
with self.assertRaises(docker.errors.APIError) as cm:
|
||||
client.swarm.reload()
|
||||
|
|
Loading…
Reference in New Issue