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

fixes #25518 - fix invalid repos in 3.10 upgrade #7858

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

stbenjam
Copy link
Contributor

@stbenjam stbenjam commented Nov 30, 2018

To test this, you'll need to createa repo that has the bogus data that could've been created in older Katellos (prior to 3.9). To do that, go ahead and modify one of your existing repos and force set the username or password, but not both, like this:

$ rake console
> repo = Katello::RootRepository.last # or the repo you created
> repo.upstream_username = 'potato'
> repo.save!(validate: false)
> ^D
$ rake katello:upgrades:3.10:clear_invalid_repo_credentials

And notice the repo has the username unset and pulp is refreshed upon running the rake task.

@theforeman-bot
Copy link

Issues: #25518

@beav
Copy link
Contributor

beav commented Nov 30, 2018

@stbenjam do you have to add anything to get the task to run during the upgrade? I haven't written an upgrade task since theforeman/foreman#5780 was merged so I'm not sure what the new procedure is.

@beav
Copy link
Contributor

beav commented Nov 30, 2018

code looks good, testing now

@sjha4
Copy link
Member

sjha4 commented Nov 30, 2018

To run this during upgrade, you can add it to db/seeds.d/111-upgrade_tasks.rb

@beav
Copy link
Contributor

beav commented Nov 30, 2018

test was successful. I created one of each debian, ostree, file, yum, docker and ran through the steps to corrupt the info. I then ran the rake task and it worked.

After the new task is added to db/seeds.d/111-upgrade_tasks.rb, ack from me!

Copy link
Contributor

@beav beav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐰

@beav beav merged commit 34d3d13 into Katello:master Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants