~charmers/charms/trusty/plumgrid-edge/trunk

« back to all changes in this revision

Viewing changes to hooks/pg_edge_context.py

  • Committer: Hassaan Pasha
  • Date: 2015-08-10 16:44:15 UTC
  • Revision ID: hassaanp@plumgrid.com-20150810164415-4wxt4v2futpkng19
Updated unit tests for HA

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
    '''
17
17
    Inspects relation with PLUMgrid director.
18
18
    '''
19
 
    director_ips=[]
 
19
    director_ips = []
20
20
    for rid in relation_ids('plumgrid'):
21
21
        for unit in related_units(rid):
22
22
            rdata = relation_get(rid=rid, unit=unit)
23
23
            director_ips.append(str(rdata['private-address']))
24
24
    return director_ips
25
25
 
 
26
 
26
27
class PGEdgeContext(context.NeutronContext):
27
28
 
28
29
    @property
61
62
        single_ip = True
62
63
        for ip in pg_dir_settings:
63
64
            if single_ip:
64
 
                pg_dir_ips=str(ip)
 
65
                pg_dir_ips = str(ip)
65
66
                single_ip = False
66
67
            else:
67
 
                pg_dir_ips= pg_dir_ips + ',' + str(ip)
 
68
                pg_dir_ips = pg_dir_ips + ',' + str(ip)
68
69
        pg_ctxt['local_ip'] = pg_dir_ips
69
70
        pg_ctxt['pg_hostname'] = "pg-edge"
70
71
        from pg_edge_utils import check_interface_type