@messaging.expected_exceptions(exception.FloatingIpNotFoundForAddress)
    def associate_floating_ip(self, context, floating_address, fixed_address,
                              affect_auto_assigned=False):
        floating_ip = objects.FloatingIP.get_by_address(context,
                                                        floating_address)
        # handle auto_assigned
        if not affect_auto_assigned and floating_ip.auto_assigned:
            return

        # make sure project owns this floating ip (allocated)
        self._floating_ip_owned_by_project(context, floating_ip)

        # disassociate any already associated
        orig_instance_uuid = None
        if floating_ip.fixed_ip_id:
            # find previously associated instance
            fixed_ip = floating_ip.fixed_ip
            if str(fixed_ip.address) == fixed_address:
                # NOTE(vish): already associated to this address
                return
            orig_instance_uuid = fixed_ip.instance_uuid

            self.disassociate_floating_ip(context, floating_address)

        fixed_ip = objects.FixedIP.get_by_address(context, fixed_address)

        # send to correct host, unless i'm the correct host
        network = objects.Network.get_by_id(context.elevated(),
                                            fixed_ip.network_id)
        if network.multi_host:
            instance = objects.Instance.get_by_uuid(
                context, fixed_ip.instance_uuid)
            host = instance.host
        else:
            host = network.host

        interface = floating_ip.interface
        if host == self.host:
            # i'm the correct host
            self._associate_floating_ip(context, floating_address,
                                        fixed_address, interface,
                                        fixed_ip.instance_uuid)
        else:
            # send to correct host
            self.network_rpcapi._associate_floating_ip(context,
                    floating_address, fixed_address, interface, host,
                    fixed_ip.instance_uuid)

        return orig_instance_uuid
Returns path with dmg mount path prepended.
dataset/ETHPy150Open openstack/nova/nova/network/floating_ips.py/FloatingIP.associate_floating_ip--crossover with--dataset/ETHPy150Open MacSysadmin/pymacadmin/utilities/diskimage_unittesting/macdmgtest.py/DMGUnitTest.PathOnDMG