def save
      old_contents = @interface_file.file? ? File.read(@interface_file) : ""

      stop_success = stop
      # Stop twice because when configure both ipv4 and ipv6 as dhcp, ipv6 dhcp client will
      # exit and leave a /var/run/dhclient6-eth0.pid file. Then stop (ifdown eth0) will try
      # to kill this exited process so it returns 1. In the second call, this `.pid' file
      # has been deleted and ifdown returns 0.
      # See: https://bugzilla.redhat.com/show_bug.cgi?id=1472396
      stop_success = stop unless stop_success
      return false unless stop_success

      File.write(@interface_file, @interface_config.delete_blanks.collect { |k, v| "#{k}=#{v}" }.join("\n"))

      unless start
        File.write(@interface_file, old_contents)
        start
        return false
      end

      reload
    end
def save
      old_contents = @interface_file.file? ? File.read(@interface_file) : ""

      stop_success = stop
      # Stop twice because when configure both ipv4 and ipv6 as dhcp, ipv6 dhcp client will
      # exit and leave a /var/run/dhclient6-eth0.pid file. Then stop (ifdown eth0) will try
      # to kill this exited process so it returns 1. In the second call, this `.pid' file
      # has been deleted and ifdown returns 0.
      # See: https://bugzilla.redhat.com/show_bug.cgi?id=1472396
      stop_success = stop unless stop_success
      return false unless stop_success

      File.write(@interface_file, @interface_config.delete_blanks.collect { |k, v| "#{k}=#{v}" }.join("\n"))

      unless start
        File.write(@interface_file, old_contents)
        start
        return false
      end

      reload
    end
Writes the contents of @interface_config to @interface_file as `key`=`value` pairs
 and resets the interface

 @return [Boolean] true if the interface was successfully brought up with the
   new configuration, false otherwise