~xianghui/charms/trusty/nova-compute/support-ipv6

« back to all changes in this revision

Viewing changes to hooks/nova_compute_context.py

  • Committer: Liam Young
  • Date: 2014-07-29 07:17:23 UTC
  • mfrom: (68.2.9 nova-compute)
  • Revision ID: liam.young@canonical.com-20140729071723-0guiei1ce7pte5zb
[jamespage,r=gnuoy] Add support for os-data-network

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from charmhelpers.contrib.openstack.utils import get_host_ip, os_release
19
19
from charmhelpers.contrib.network.ovs import add_bridge
20
 
 
 
20
from charmhelpers.contrib.network.ip import get_address_in_network
21
21
 
22
22
# This is just a label and it must be consistent across
23
23
# nova-compute nodes to support live migration.
344
344
 
345
345
        self._ensure_bridge()
346
346
 
347
 
        ovs_ctxt['local_ip'] = get_host_ip(unit_get('private-address'))
 
347
        ovs_ctxt['local_ip'] = \
 
348
            get_address_in_network(config('os-data-network'),
 
349
                                   get_host_ip(unit_get('private-address')))
348
350
        return ovs_ctxt
349
351
 
350
352
    def __call__(self):