Bug 713010
| Summary: | Changing provider type in New Provider Account page causes error | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Retired] CloudForms Cloud Engine | Reporter: | Matt Wagner <matt.wagner> | ||||||||
| Component: | aeolus-conductor | Assignee: | Chris Lalancette <clalance> | ||||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | wes hayutin <whayutin> | ||||||||
| Severity: | unspecified | Docs Contact: | |||||||||
| Priority: | unspecified | ||||||||||
| Version: | 0.3.1 | CC: | akarol, athomas, clalance, dajohnso, deltacloud-maint, dgao, jzigmund, morazi, ssachdev | ||||||||
| Target Milestone: | rc | ||||||||||
| Target Release: | --- | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | Type: | --- | |||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | |||||||||||
| Bug Blocks: | 717673 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Matt Wagner
2011-06-13 21:53:22 UTC
Created attachment 504555 [details]
Screenshot after changing provider type in dropdown
Created attachment 504590 [details]
on_clicking_add
On selecting any provider the page displays an ADD button.
Clicking on Add button displays the following error .
undefined method `[]' for nil:NilClass
Screenshot attached.
FYI, there's also an overlapping Redmine task for this bug: https://www.aeolusproject.org/redmine/issues/1761 *** Bug 713005 has been marked as a duplicate of this bug. *** So I've been looking at this with my almost non-existent javascript knowledge. Here's what I see happening:
When you click on the drop-down in the provider accounts page, there is a piece of javascript that gets invoked to reload the page with appropriate UI elements. This piece of javascript looks like this:
$(document).ready(function(){
var selected_provider;
$("#provider_account_provider_id").change(function()
{
selected_provider = $("option:selected").attr('value');
$.get("https://lemur.usersys.redhat.com/conductor/provider_accounts/set_selected_provider", {'provider_account[provider_id]':selected_provider},
function(result) {
$("#provider_type").html(result);
}
);
});
});
However, notice that it is an anonymous function, and further notice that it is loaded on .ready(). From what I've read, that means it gets loaded in during page load time.
The next part is what I'm not really sure about. I think what happens is that during a click on the drop-down, a "change" event gets sent, which invokes this piece of javascript. But the problem is that option:selected isn't specific enough; it doesn't mention which form that we should be choosing this option from. I believe what happens is that it actually takes the selected element of the *first* form on the page, which happens to be admin-select drop-down. It then uses the value of that (which is /conductor/user) as the account_id, and things go down from there.
While the details of the preceding paragraph might not be 100% correct, the output in the rails process does bear out the results:
Processing ProviderAccountsController#set_selected_provider (for 10.16.19.47 at 2011-06-14 12:15:31) [GET]
Parameters: {"action"=>"set_selected_provider", "controller"=>"provider_accounts", "provider_account"=>{"provider_id"=>"/conductor/users"}}
That provider_account[provider_id] is totally bogus. I'm not quite sure how to fix this yet.
Chris Lalancette
Got it. The javascript just needs a tweak to pull from the right select statement. I'll be posting a patch presently. Chris Lalancette Bugfix in git repo, commit hash 299144cc793a9dd821755360a3965faa06245ccc Created attachment 505108 [details]
ss
This is fixed in
[root@ibm-x3650-03 ~]# rpm -qa | grep aeolus
aeolus-conductor-devel-0.3.0-0.el6.20110616154040gited9b37c.noarch
aeolus-configure-2.0.1-0.el6.20110602110128git5cb9257.noarch
aeolus-conductor-0.3.0-0.el6.20110616154040gited9b37c.noarch
aeolus-conductor-daemons-0.3.0-0.el6.20110616154040gited9b37c.noarch
aeolus-conductor-doc-0.3.0-0.el6.20110616154040gited9b37c.noarch
aeolus-all-0.3.0-0.el6.20110616154040gited9b37c.noarch
[root@ibm-x3650-03 ~]#
able to create provider accounts for both us-east and us-west
changing the combo box does cause an error
removing ce-p2-beta second attempt to remove ce-p2-beta release pending... release pending... closing out old bugs perm close |