~openstack-charmers-archive/charms/trusty/openstack-dashboard/next

« back to all changes in this revision

Viewing changes to hooks/horizon_hooks.py

  • Committer: james.page at ubuntu
  • Date: 2015-01-13 15:18:29 UTC
  • mfrom: (41.4.4 openstack-dashboard)
  • Revision ID: james.page@ubuntu.com-20150113151829-ef6pi3iwd6mf39a2
[james-page,r=gnuoy] Add fallback configuration options for vip cidr and iface for non-standard deployments

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
            res_vip = 'ocf:heartbeat:IPaddr2'
163
163
            vip_params = 'ip'
164
164
 
165
 
        iface = get_iface_for_address(vip)
 
165
        iface = (get_iface_for_address(vip) or
 
166
                 config('vip_iface'))
 
167
        netmask = (get_netmask_for_address(vip) or
 
168
                   config('vip_cidr'))
 
169
 
166
170
        if iface is not None:
167
171
            vip_key = 'res_horizon_{}_vip'.format(iface)
168
172
            resources[vip_key] = res_vip
171
175
                ' nic="{iface}"'.format(ip=vip_params,
172
176
                                        vip=vip,
173
177
                                        iface=iface,
174
 
                                        netmask=get_netmask_for_address(vip))
 
178
                                        netmask=netmask)
175
179
            )
176
180
            vip_group.append(vip_key)
177
181