The line in comment #4 changed, here is a permalink: https://github.com/ManageIQ/manageiq/blob/7c4f5bc401deff2f1b42215b1929b940593e0d3a/app/models/miq_provision_virt_workflow.rb#L1102 The logic in the create_provision_request (ultimately the class method from_ws_ver_1_x in miq_provision_virt_workflow.rb) was modified as part of the tenant work to validate the the requested user_name value existed in the database so the request could be assigned to the proper user/group/tenant. The issue reported is because the user_name being passed in is a partial name compared to what is stored in the database. (guidoc is being passed and the userid is guidoc) The failure can be resolved by passing in the full userid value for the user which I believe is being truncated in some of the automate logic which comes from the external CloudForms POC repo. The line would look something like this: merged_options_hash[:user_name] = /^[^@]*/.match(@user.userid).to_s and should be changed to: merged_options_hash[:user_name] = @user.userid Therefore the user_name being passed will be properly matched. Additional, the code can be updated to handle this situation along with using the same lookup as the workflow initialization by calling User.lookup_by_identity(<user_name>) instead of User.find_by_userid!(<user_name>)
There is another ticket similar to this https://bugzilla.redhat.com/show_bug.cgi?id=1298292 In that case the customer was using the CloudformsPOC Automate domain from Kevin Morey https://github.com/ramrexx/CloudFormsPOC/wiki
https://github.com/ManageIQ/manageiq/pull/7699
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/cecc2689d762b0c34679779b724b0d44960be01c commit cecc2689d762b0c34679779b724b0d44960be01c Author: Drew Bomhof <dbomhof> AuthorDate: Mon Apr 4 16:50:45 2016 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Wed Apr 27 12:04:25 2016 -0400 Use lookup_by_identity to validate a user param https://bugzilla.redhat.com/show_bug.cgi?id=1322876 app/models/automation_request.rb | 6 ++---- app/models/miq_provision_virt_workflow.rb | 6 ++---- app/models/miq_request_workflow.rb | 13 +++++++++++++ spec/models/miq_provision_virt_workflow_spec.rb | 22 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 8 deletions(-)
Verified in 5.6.0.5-beta2.4. I used our user in our LDAP which logs in as username@domain, then I manually crafted params for create_provision_request (in console) where in the place of user id I have placed only the username. When I kicked the request off, it correctly pulled the user from the LDAP and the request was initiated.
https://github.com/ManageIQ/manageiq/pull/8473
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=29a5845fd05314ee04282c588a9b2c51a920d709 commit 29a5845fd05314ee04282c588a9b2c51a920d709 Author: Drew Bomhof <dbomhof> AuthorDate: Mon Apr 4 16:50:45 2016 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Mon May 2 16:56:25 2016 -0400 Use lookup_by_identity to validate a user param https://bugzilla.redhat.com/show_bug.cgi?id=1322876 app/models/automation_request.rb | 6 ++---- app/models/miq_provision_virt_workflow.rb | 6 ++---- app/models/miq_request_workflow.rb | 13 +++++++++++++ spec/models/miq_provision_virt_workflow_spec.rb | 22 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 8 deletions(-)
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=caee9ee6a2646e3c7751189b6094f3fb7ebbb789 commit caee9ee6a2646e3c7751189b6094f3fb7ebbb789 Merge: 31bc75c 29a5845 Author: Greg McCullough <gmccullo> AuthorDate: Tue May 24 11:16:10 2016 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Tue May 24 11:16:10 2016 -0400 Merge branch 'possibly_update_user_5.5.z' into '5.5.z' Use lookup_by_identity to validate a user param https://bugzilla.redhat.com/show_bug.cgi?id=1322876 PR: https://github.com/ManageIQ/manageiq/pull/7699 Cherry Pick was clean See merge request !924 app/models/automation_request.rb | 6 ++---- app/models/miq_provision_virt_workflow.rb | 6 ++---- app/models/miq_request_workflow.rb | 13 +++++++++++++ spec/models/miq_provision_virt_workflow_spec.rb | 22 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 8 deletions(-)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1348