-
Notifications
You must be signed in to change notification settings - Fork 897
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
Allow rails to be loaded in fix auth #17413
Conversation
@kbrock Since making the changes not able to run fix_auth. Recieving this error message:
|
Also of note The require statement throws the following exception:
|
eeb7aad
to
60126b7
Compare
I'll kick again. unsure about the cops (invalid syntax) - that has already been fixed. |
c73ffcd
to
d2090f6
Compare
When objects are serialized into yaml blobs in tables, we need to load our whole environment to handle the deserialization This typically happens with miq_requests.options - add --allow-failures flag - add note where error was found - require standard rails when allow failures - continue despite errors when allow failures - display status, counts, and # errors - change order of fixes - reduce columns brought back - sending error output to STDERR - only bring back request/task records that have v2 encoded passwords - drop tests for v0 encoded passwords
Checked commit kbrock@88faab3 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 tools/fix_auth/auth_model.rb
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @kbrock does this need to go back to gaprindashvili
? (Only asking because you made a PR to fine
)
Also is there a BZ associated with this change?
@@ -69,6 +69,10 @@ def fix_database_yml | |||
FixDatabaseYml.run({:hardcode => options[:password]}.merge(run_options)) | |||
end | |||
|
|||
def load_rails | |||
require File.expand_path("../../../config/application.rb", __FILE__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to run the initializers? Typically, tools in the tools directory require config/environment to load rails, which is the same as above ^ but it also calls Vmdb::Application.initialize!
@kbrock I don't know that it matters but was curious since all the other tools load config/environment (since that's what I always do).
@simaishi Is it possible to backport this? to G? |
@gmcculloug @mkanoor Do you all have a BZ that you would like referenced by this PR? |
@tinaafitz Can you help find a BZ for this? I know we've had BZs related to this but could use some help identifying them. |
@gmcculloug @kbrock Would this BZ suffice: https://bugzilla.redhat.com/show_bug.cgi?id=1643250 |
When objects are serialized into yaml blobs in tables,
we need to load our whole environment to handle the deserialization
This typically happens with
miq_requests.options
Even though we don't support storing non hash/list/string value in the database, it happens. A number of customers have recently run into this issue.
This provides a
--resilient
option to load our environment and allow those hashes to be deserialized.see also
Fine
version #17428