Project

General

Profile

Actions

Bug #32500

closed

private_ip expected as String, not Boolean when creating a host via the API

Added by Evgeni Golov about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Foreman integration
Target version:
Difficulty:
easy
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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".

Actions #1

Updated by The Foreman Bot about 3 years ago

  • Pull request https://github.com/theforeman/foreman_azure_rm/pull/116 added
Actions #2

Updated by Evgeni Golov about 3 years ago

  • Category set to Foreman integration
Actions #3

Updated by Evgeni Golov about 3 years ago

  • Bugzilla link set to 1956774
Actions #4

Updated by Evgeni Golov about 3 years ago

  • Description updated (diff)
Actions #5

Updated by The Foreman Bot about 3 years ago

  • Fixed in Releases 2.2.3 added
Actions #6

Updated by The Foreman Bot about 3 years ago

  • Fixed in Releases deleted (2.2.3)
Actions #7

Updated by The Foreman Bot about 3 years ago

  • Fixed in Releases 2.2.3 added
Actions #8

Updated by Evgeni Golov about 3 years ago

  • Status changed from New to Closed
Actions #9

Updated by Chris Roberts about 3 years ago

  • Target version set to 2.2.3
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF