Bug #32713
closedCloud parameter does not have any validation on it
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.
Updated by Chris Roberts over 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.
Updated by The Foreman Bot over 3 years ago
- Pull request https://github.com/theforeman/foreman_azure_rm/pull/129 added
Updated by Chris Roberts over 3 years ago
- Status changed from New to Ready For Testing
Updated by Chris Roberts over 3 years ago
- Target version changed from 2.2.5 to 2.2.6
Updated by Chris Roberts over 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_azure_rm|f6a1f0497f6f859315b8b97514a624e8bef68254.