def allocate_fixed_ip(self, context, instance_id, network, **kwargs):

        LOG.debug('Allocate fixed IP on network %s', network['uuid'],
                  instance_uuid=instance_id)

        # NOTE(mriedem): allocate the vif before associating the
        # instance to reduce a race window where a previous instance
        # was associated with the fixed IP and has released it, because
        # release_fixed_ip will disassociate if allocated is False.
        vif = objects.VirtualInterface.get_by_instance_and_network(
            context, instance_id, network['id'])
        if vif is None:
            LOG.debug('vif for network %(network)s and instance '
                      '%(instance_id)s is used up, '
                      'trying to create new vif',
                      {'network': network['id'],
                       'instance_id': instance_id})
            vif = self._add_virtual_interface(context,
                instance_id, network['id'])

        if kwargs.get('vpn', None):
            address = network['vpn_private_address']
            fip = objects.FixedIP.associate(context, str(address),
                                            instance_id, network['id'],
                                            reserved=True,
                                            vif_id=vif.id)
        else:
            address = kwargs.get('address', None)
            if address:
                fip = objects.FixedIP.associate(context, str(address),
                                                instance_id,
                                                network['id'],
                                                vif_id=vif.id)
            else:
                fip = objects.FixedIP.associate_pool(
                        context, network['id'], instance_id,
                        vif_id=vif.id)
        address = fip.address

        if not kwargs.get('vpn', None):
            self._do_trigger_security_group_members_refresh_for_instance(
                                                                   instance_id)

        # NOTE(vish) This db query could be removed if we pass az and name
        #            (or the whole instance object).
        instance = objects.Instance.get_by_uuid(context, instance_id)

        name = instance.display_name
        if self._validate_instance_zone_for_dns_domain(context, instance):
            self.instance_dns_manager.create_entry(name, address,
                                                   "A",
                                                   self.instance_dns_domain)
            self.instance_dns_manager.create_entry(instance_id, address,
                                                   "A",
                                                   self.instance_dns_domain)

        self._setup_network_on_host(context, network)
        LOG.debug('Allocated fixed IP %s on network %s', address,
                  network['uuid'], instance=instance)
        return address
Get the named render method using C{nevow.page.renderer}.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/network/manager.py/VlanManager.allocate_fixed_ip--crossover with--dataset/ETHPy150Open twisted/nevow/nevow/page.py/Element.renderer