Skip to content

Commit

Permalink
Merge pull request #108 from ekohl/drop-url-rewrite
Browse files Browse the repository at this point in the history
Remove forge.puppetlabs.com -> forgeapi.p.c rewrite
  • Loading branch information
bastelfreak committed May 24, 2023
2 parents 9dd4e89 + 72e9c4e commit b1bda48
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions lib/librarian/puppet/source/forge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ def from_spec_args(environment, uri, options)
def initialize(environment, uri, options = {})
self.environment = environment

if uri =~ %r{^http(s)?://forge\.puppetlabs\.com}
uri = "https://forgeapi.puppetlabs.com"
warn { "Replacing Puppet Forge API URL to use v3 #{uri}. You should update your Puppetfile" }
end

@uri = URI::parse(uri)
@cache_path = nil
end
Expand Down
8 changes: 0 additions & 8 deletions lib/librarian/puppet/source/forge/repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,8 @@ def cache_version_unpacked!(version)

target = vendored?(name, version) ? vendored_path(name, version).to_s : name

# can't pass the default v3 forge url (http://forgeapi.puppetlabs.com)
# to clients that use the v1 API (https://forge.puppet.com)
# nor the other way around
module_repository = source.uri.to_s

if module_repository =~ %r{^http(s)?://forge\.puppetlabs\.com}
module_repository = "https://forgeapi.puppetlabs.com"
warn { "Replacing Puppet Forge API URL to use v3 #{module_repository} as required by your client version #{Librarian::Puppet.puppet_version}" }
end

command = %W{puppet module install --version #{version} --target-dir}
command.push(*[path.to_s, "--module_repository", module_repository, "--modulepath", path.to_s, "--module_working_dir", path.to_s, "--ignore-dependencies", target])
debug { "Executing puppet module install for #{name} #{version}: #{command.join(" ").gsub(module_repository, source.to_s)}" }
Expand Down

0 comments on commit b1bda48

Please sign in to comment.