Actions
Bug #32500
closedprivate_ip expected as String, not Boolean when creating a host via the API
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Description
I am creating Azure VMs using the API (well, Ansible, but that doesn't matter).
I submit the following Interfaces config:
interfaces_attributes: - type: "interface" compute_attributes: network: default public_ip: Dynamic private_ip: false
Which yields the following error:
MsRestAzure::AzureOperationError: PrivateIPAddressMissing: Private IP address is required when privateIPAllocationMethod is Static in IP configuration /subscriptions/UUID/resourceGroups/foreman/providers/Microsoft.Network/networkInterfaces/whoa-nic0/ipConfigurations/whoa-nic0.
This is because the code at https://github.com/theforeman/foreman_azure_rm/blob/48c22cb6f4e3845d2faf61be26d3f0eea58b6b70/app/models/concerns/foreman_azure_rm/vm_extensions/managed_vm.rb#L126 reads:
private_ip = (attrs[:private_ip] == 'false') ? false : true
Which makes private_ip only False if the API parameter was a string with the value "false".
Updated by The Foreman Bot almost 4 years ago
- Pull request https://github.com/theforeman/foreman_azure_rm/pull/116 added
Updated by Evgeni Golov almost 4 years ago
- Status changed from New to Closed
Applied in changeset foreman_azure_rm|bd2b9a8259dbd3352928c94abfa86cbfa58af359.
Updated by Chris Roberts almost 4 years ago
- Target version set to 2.2.3
- Triaged changed from No to Yes
Actions