-
Notifications
You must be signed in to change notification settings - Fork 119
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
Fix userid in transformation throttler launch #439
Fix userid in transformation throttler launch #439
Conversation
@miq-bot add-label transformation, bug, hammer/yes |
Checked commit fabiendupont@5fd8107 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
it "with default values" do | ||
allow(ae_service).to receive(:vmdb).with(:user).and_return(svc_vmdb_handle) | ||
allow(svc_vmdb_handle).to receive(:find_by).with(:userid => 'admin').and_return(svc_model_user) |
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.
You can do this with less stubbing.
Instead of a let
block just replace these two allow
lines with
user_admin = FactoryGirl.create(:user, :userid => 'admin')
Then update the hash below with the variable name for the user object:
:user_id => user_admin.id,
@fdupont-redhat Please squash that last commit and we'll be ready to merge. |
9459ef1
to
9191e62
Compare
…hrottler_launch Fix userid in transformation throttler launch (cherry picked from commit 5688461) https://bugzilla.redhat.com/show_bug.cgi?id=1594196
Hammer backport details:
|
In the existing implementation, the user_id passed to
create_automation_request
is hard coded to1
. And that's obviously a bad idea. In the real world, the id of the admin user is derived from the region number, as all the ids in the VMDB.A constant information is that the
userid
isadmin
, so it allows to retrieve the correct user object from the VMDB and use its id instead of1
. This PR implements that change.Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1594196