~evarlast/charms/trusty/elasticsearch/add-logs-relation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3
import amulet
import helpers

d = amulet.Deployment(series='trusty')

d.add('elasticsearch', units=3)

helpers.setup_deployment(d)

health = helpers.get_cluster_health(d, wait_for_nodes=3)

if health['number_of_nodes'] != 3:
    amulet.raise_status(amulet.FAIL, msg=msg)
    msg = ("Expected at least 3 nodes in cluster with 3 units deployed, "
           "got {}".format(health['number_of_nodes']))

print("Successfully deployed cluster of 3 units.")