Project

General

Profile

Actions

Bug #32713

closed

Cloud parameter does not have any validation on it

Added by Chris Roberts almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
General Plugin Issues
Target version:
Difficulty:
easy
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

If you send in --cloud="pizza" or anything it will fail with a long traceback since it can't load the regions, if it does manage to load the regions it creates the compute resource and then will fail upon doing anything with it.

Actions #1

Updated by Chris Roberts almost 3 years ago

Ruby Traceback:

10:31:32 rails.1 | 2021-06-03T10:31:32 [I|app|1ea49c3d] Backtrace for 'Action failed' error (NoMethodError): undefined method `resource_manager_endpoint_url' for nil:NilClass
10:31:32 rails.1 | 1ea49c3d | /home/vagrant/foreman_azure_rm/lib/foreman_azure_rm/azure_sdk_adapter.rb:31:in `subscription_client'
10:31:32 rails.1 | 1ea49c3d | /home/vagrant/foreman_azure_rm/lib/foreman_azure_rm/azure_sdk_adapter.rb:86:in `list_regions'
10:31:32 rails.1 | 1ea49c3d | /home/vagrant/foreman_azure_rm/app/models/foreman_azure_rm/azure_rm.rb:84:in `regions'
10:31:32 rails.1 | 1ea49c3d | /home/vagrant/foreman_azure_rm/app/models/foreman_azure_rm/azure_rm.rb:66:in `validate_region'
10:31:32 rails.1 | 1ea49c3d | /home/vagrant/foreman_azure_rm/app/models/foreman_azure_rm/azure_rm.rb:62:in `ensure_attributes_and_values'

Hammer output:

[vagrant@hammer ~]$ hammer compute-resource create --name="food1" --secret-key="xxxxx" --location-id 2 --organization-id 1 --provider AzureRm --app-ident="xxxx" --sub-id="xxxx" --tenant="xxxxx" --region="eastus" --cloud="pizza"
Could not create the compute resource:
Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs.

Actions #2

Updated by The Foreman Bot almost 3 years ago

  • Pull request https://github.com/theforeman/foreman_azure_rm/pull/129 added
Actions #3

Updated by Chris Roberts almost 3 years ago

  • Status changed from New to Ready For Testing
Actions #4

Updated by Chris Roberts almost 3 years ago

  • Target version changed from 2.2.5 to 2.2.6
Actions #5

Updated by The Foreman Bot almost 3 years ago

  • Fixed in Releases 2.2.6 added
Actions #6

Updated by Chris Roberts almost 3 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF