scripts/chef/hdfsdir_provider.rb
def dir_exists?(path)
  begin
    @meta_data = @client.stat(path)
    if (@meta_data["type"] == "DIRECTORY")
      return true
    else
      return false
    end
  rescue
    return false
  end 
end
#
# Method to check whether the dir currently exists
#
Method to check whether the dir currently exists
Method to check whether the dir currently exists
def dir_exists?(path)
  begin
    @meta_data = @client.stat(path)
    if (@meta_data["type"] == "DIRECTORY")
      return true
    else
      return false
    end
  rescue
    return false
  end 
end
def dir_exists? ( path ) begin @meta_data = @client . stat ( path ) if ( @meta_data [ "type" ] == "DIRECTORY" ) return true else return false end rescue return false end end
Method to check whether the dir currently exists
Method to check whether the dir currently exists
path