Sha256: 2c8a065b734a82a26f22ba52c2d187f408f93b74dbc88f3d43dafe4779d8fe3d

Contents?: true

Size: 822 Bytes

Versions: 67

Compression:

Stored size: 822 Bytes

Contents

namespace :katello do
  namespace :upgrades do
    namespace '4.3' do
      desc "change urls with username and password in the url to use basic auth parameters in pulp3"
      task :fix_url_auth => ["environment"] do
        User.current = User.anonymous_admin

        Katello::Repository.all.each do |repo|
          upstream_url = repo.root.url
          uri = URI(repo.root.url)
          if uri.userinfo
            user, password = uri.userinfo.split(':')
            upstream_url.slice!(uri.userinfo + "@")
            repo_params = {
              upstream_username: user,
              upstream_password: password,
              url: upstream_url
            }
            ForemanTasks.sync_task(Actions::Katello::Repository::Update, repo.root, repo_params)
          end
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
katello-4.14.3 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.14.2 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.14.1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.14.0 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.14.0.rc3 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.14.0.rc2 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.14.0.rc1.1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.14.0.rc1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.13.1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.13.0 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.12.1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.13.0.rc1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.12.0 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.12.0.rc3 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.12.0.rc2 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.12.0.rc1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.11.1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.11.0 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.11.0.rc2 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
katello-4.11.0.rc1 lib/katello/tasks/upgrades/4.3/fix_url_auth.rake