If we try to relay a method call to a remote region and that region does not have central administration configured (no authentication record for the region) we fail like this (from production.log): [----] I, [2016-10-27T16:11:07.637208 #25980:2abcf0c76d5c] INFO -- : Started POST "/vm_infra/pre_prov_continue?button=submit" for 127.0.0.1 at 2016-10-27 16:11:07 -0400 [----] I, [2016-10-27T16:11:07.659415 #25980:2abcf0c76d5c] INFO -- : Processing by VmInfraController#pre_prov_continue as JS [----] I, [2016-10-27T16:11:07.659483 #25980:2abcf0c76d5c] INFO -- : Parameters: {"button"=>"submit"} [----] F, [2016-10-27T16:11:07.719617 #25980:2abcf0c76d5c] FATAL -- : Error caught: [NoMethodError] undefined method `[]' for false:FalseClass /home/ncarboni/.gem/ruby/2.3.1/gems/ezcrypto-0.7/lib/ezcrypto.rb:293:in `block in load' /home/ncarboni/.gem/ruby/2.3.1/gems/ezcrypto-0.7/lib/ezcrypto.rb:294:in `load' /home/ncarboni/Source/manageiq/app/models/miq_region.rb:302:in `api_system_auth_token' /home/ncarboni/Source/manageiq/app/models/miq_region.rb:314:in `api_system_auth_token_for_region' /home/ncarboni/Source/manageiq/app/models/mixins/inter_region_api_method_relay.rb:67:in `api_client_connection_for_region' /home/ncarboni/Source/manageiq/app/models/mixins/inter_region_api_method_relay.rb:74:in `exec_api_call' /home/ncarboni/Source/manageiq/app/models/mixins/inter_region_api_method_relay.rb:52:in `block (2 levels) in api_relay_class_method' /home/ncarboni/Source/manageiq/app/models/miq_request_workflow.rb:96:in `make_request' /home/ncarboni/Source/manageiq/app/models/miq_provision_virt_workflow.rb:64:in `make_request' We should raise a good error and handle it properly if this happens. To reproduce this: - Configure replication - Attempt to provision a VM from a template and to a provider belonging to a remote region. This should raise a good error to the screen that says that "this action is not supported without central administration authentication configured", but right now there is no feedback on the screen and you stay on the last screen of the provision workflow.
https://github.com/ManageIQ/manageiq/pull/12264
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/505dcd2995d5a73cba7b409b04f87936ec9835c6 commit 505dcd2995d5a73cba7b409b04f87936ec9835c6 Author: Nick Carboni <ncarboni> AuthorDate: Thu Oct 27 17:59:42 2016 -0400 Commit: Nick Carboni <ncarboni> CommitDate: Thu Oct 27 17:59:42 2016 -0400 Raise an error if a region is not configured for central admin Now when someone tries to do something with an object that belongs to a remote region and hasn't configured the authentication key yet for that region they will get a clear error message. https://bugzilla.redhat.com/show_bug.cgi?id=1389536 app/models/mixins/inter_region_api_method_relay.rb | 17 +++++--- .../mixins/inter_region_api_method_relay_spec.rb | 50 ++++++++++++++-------- 2 files changed, 44 insertions(+), 23 deletions(-)
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/d08652db76d7d634b79e96d92a8b2e40eba2f91e commit d08652db76d7d634b79e96d92a8b2e40eba2f91e Author: Nick Carboni <ncarboni> AuthorDate: Thu Oct 27 18:01:55 2016 -0400 Commit: Nick Carboni <ncarboni> CommitDate: Thu Oct 27 18:01:55 2016 -0400 Show the new error message when provisioning a VM from a remote template https://bugzilla.redhat.com/show_bug.cgi?id=1389536 app/controllers/application_controller/miq_request_methods.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)