You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: prepare_nfs_settings.rb
    path of file: ./repos/vagrant-libvirt/lib/vagrant-libvirt/action
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'nokogiri'
require 'socket'
require 'timeout'
require 'vagrant-libvirt/util/nfs'

module VagrantPlugins
  module ProviderLibvirt
    module Action
      class PrepareNFSSettings
        include VagrantPlugins::ProviderLibvirt::Util::Nfs

        def initialize(app, _env)
          @app = app
          @logger = Log4r::Logger.new('vagrant::action::vm::nfs')
        end

        def call(env)
          @machine = env[:machine]
          @app.call(env)

          if using_nfs?
            @logger.info('Using NF
    
        def read_machine_ip(machine)
          # check host only ip
          ssh_info = machine.ssh_info
          return ssh_info[:host] if ping(ssh_info[:host], ssh_info[:port])

          # check other ips
          command = "ip=$(which ip); ${ip:-/sbin/ip} addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1"
          result  = ''
          machine.communicate.execute(command) do |type, data|
            result += data if type == :stdout
          end

          ips = result.chomp.split("\n").uniq
          @logger.info("guest IPs: #{ips.join(', ')}")
          ips.each do |ip|
            next if ip == ssh_info[:host]
            return ip if ping(ip)
          end

          nil
        end