fix CHEF-4933
rewrite in the style of remote_directory
fix bug
modify tests for the changes of ifconfig.rb