~openstack-charmers-archive/charms/precise/glance/old-1501

« back to all changes in this revision

Viewing changes to hooks/glance_relations.py

  • Committer: james.page at ubuntu
  • Date: 2015-01-13 15:18:33 UTC
  • mfrom: (78.4.5 glance)
  • Revision ID: james.page@ubuntu.com-20150113151833-4zzvsf7knjkvqirn
[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:
379
379
            res_ks_vip = 'ocf:heartbeat:IPaddr2'
380
380
            vip_params = 'ip'
381
381
 
382
 
        iface = get_iface_for_address(vip)
 
382
        iface = (get_iface_for_address(vip) or
 
383
                 config('vip_iface'))
 
384
        netmask = (get_netmask_for_address(vip) or
 
385
                   config('vip_cidr'))
 
386
 
383
387
        if iface is not None:
384
388
            vip_key = 'res_glance_{}_vip'.format(iface)
385
389
            resources[vip_key] = res_ks_vip
388
392
                ' nic="{iface}"'.format(ip=vip_params,
389
393
                                        vip=vip,
390
394
                                        iface=iface,
391
 
                                        netmask=get_netmask_for_address(vip))
 
395
                                        netmask=netmask)
392
396
            )
393
397
            vip_group.append(vip_key)
394
398