Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHELMISC-7213: Dropbox uploader create folder but does not create share folder #568

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/resultuploaders/dropbox/dropbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def connect
def create_project_folder
handle_exceptions(__method__) do
@path = "/#{@repo}/CI/#{@tag}-#{@timestamp}"
@dropbox.create_folder(@path)
@dropbox.create_folder(@path) unless folder_exists?(@path)
@dropbox.share_folder(@path)
@url = "#{@dropbox.create_shared_link_with_settings(@path).url}&lst="
@logger.info("Dropbox project folder created: #{@url}")
Expand Down Expand Up @@ -153,6 +153,12 @@ def delete_file(r_name)
end
end

def folder_exists?(folder_path)
@dropbox.get_metadata(folder_path).is_a?(DropboxApi::Metadata::Folder)
rescue DropboxApi::Errors::NotFoundError
false
end

def close; end
end
end
Loading