Actions
Bug #32855
closedAPI available_networks by cluster no longer working
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Compute resources - VMware
Target version:
-
Description
API-request for available_networks by compute_resource-cluster fails
GET /api/compute_resources/:id/available_clusters/:cluster_id/available_networks
Result with cluster-name fails with no-Route error:
2021-06-23T08:38:32 [I|app|005a11d1] Started GET "/api/compute_resources/1/available_clusters/192.168.80.2/available_networks/" for 192.168.121.1 at 2021-06-23 08:38:32 +0000 2021-06-23T08:38:32 [F|app|005a11d1] 005a11d1 | ActionController::RoutingError (No route matches [GET] "/api/compute_resources/1/available_clusters/192.168.80.2/available_networks"): 005a11d1 | 005a11d1 | lib/foreman/middleware/logging_context_request.rb:11:in `call' 005a11d1 | /home/vagrant/katello/lib/katello/prevent_json_parsing.rb:12:in `call' 2021-06-23T08:38:36 [I|app|005a11d1] Rendered .vendor/ruby/2.7.0/gems/actionpack-6.0.3.7/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (Duration: 3236.8ms | Allocations: 536195)
Result with cluster-id:
2021-06-23T08:30:19 [I|app|528a1e29] Started GET "/api/compute_resources/1/available_clusters/domain-s7/available_networks/" for 192.168.121.1 at 2021-06-23 08:30:19 +0000 2021-06-23T08:30:19 [I|app|528a1e29] Processing by Api::V2::ComputeResourcesController#available_networks as JSON 2021-06-23T08:30:19 [I|app|528a1e29] Parameters: {"apiv"=>"v2", "id"=>"1", "cluster_id"=>"domain-s7"} 2021-06-23T08:30:19 [D|app|528a1e29] Reading from compute resource cache: networks-domain-s7 2021-06-23T08:30:20 [W|app|528a1e29] Action failed 2021-06-23T08:30:20 [I|app|528a1e29] Backtrace for 'Action failed' error (NoMethodError): undefined method `network' for nil:NilClass 528a1e29 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/fog-vsphere-3.5.0/lib/fog/vsphere/requests/compute/list_networks.rb:21:in `list_networks' 528a1e29 | /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/fog-vsphere-3.5.0/lib/fog/vsphere/models/compute/networks.rb:10:in `all' 528a1e29 | /home/vagrant/foreman/app/models/compute_resources/foreman/model/vmware.rb:152:in `block in networks' 528a1e29 | /home/vagrant/foreman/app/services/compute_resource_cache.rb:68:in `instance_eval' 528a1e29 | /home/vagrant/foreman/app/services/compute_resource_cache.rb:68:in `get_uncached_value' 528a1e29 | /home/vagrant/foreman/app/services/compute_resource_cache.rb:22:in `cache' 528a1e29 | /home/vagrant/foreman/app/models/compute_resources/foreman/model/vmware.rb:151:in `networks' 528a1e29 | /home/vagrant/foreman/app/models/compute_resources/foreman/model/vmware.rb:173:in `available_networks' 528a1e29 | /home/vagrant/foreman/app/controllers/api/v2/compute_resources_controller.rb:143:in `available_networks'
Actions