Project

General

Profile

« Previous | Next » 

Revision 63540c7c

Added by Eric Helms over 8 years ago

Fixes #11030: Add Python support.

View differences:

test/support/repository_support.rb
elsif @repo_type == 'puppet'
@distributors = [Runcible::Models::PuppetDistributor.new('/path', true, true, :id => 'puppet_dist')]
@repo_url = 'http://davidd.fedorapeople.org/repos/random_puppet/'
elsif @repo_type == 'python'
@distributors = [Runcible::Models::PythonDistributor.new]
@repo_url = "https://pypi.python.org"
end
end
......
end
def create_repo(options = {})
importer_config = {:id => @importer_type, :feed => @repo_url}
importer_config.merge!(options[:importer_config]) if options.key?(:importer_config)
repo = @repo_resource.retrieve(RepositorySupport.repo_id)
unless repo.nil?
destroy_repo
end
if options[:importer]
repo = @repo_extension.create_with_importer(RepositorySupport.repo_id, :id => @importer_type, :feed => @repo_url)
repo = @repo_extension.create_with_importer(RepositorySupport.repo_id, importer_config)
elsif options[:importer_and_distributor]
repo = @repo_extension.create_with_importer_and_distributors(RepositorySupport.repo_id,
{:id => @importer_type, :feed => @repo_url}, @distributors)
importer_config, @distributors)
else
repo = @repo_resource.create(RepositorySupport.repo_id)
end
......
rescue RestClient::ResourceNotFound
if options[:importer]
repo = @repo_extension.create_with_importer(RepositorySupport.repo_id, :id => @importer_type, :feed => @repo_url)
repo = @repo_extension.create_with_importer(RepositorySupport.repo_id, importer_config)
elsif options[:importer_and_distributor]
repo = @repo_extension.create_with_importer_and_distributors(RepositorySupport.repo_id,
{:id => @importer_type, :feed => @repo_url}, @distributors)
importer_config, @distributors)
else
repo = @repo_resource.create(RepositorySupport.repo_id)
end

Also available in: Unified diff