[2.0] Cannot create an IP reservation with a hostname

Bug #1590021 reported by LaMont Jones on 2016-06-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
LaMont Jones

Bug Description

There is a typo in maasserver/api/ip_addresses.py:_claim_ip where get_or_create is called incorrectly.

  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 261, in dispatch
    return function(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/ip_addresses.py", line 179, in reserve
    hostname=hostname)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 500, in call_within_transaction
    return func_within_txn(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/api/ip_addresses.py", line 121, in _claim_ip
    dnsrr.ip_addresses.add(sip)
AttributeError: 'tuple' object has no attribute 'ip_addresses'

Right above that should be: dnsrr, _ = DNSResource..., not dnsrr =

Related branches

LaMont Jones (lamont) wrote :

This shows up if the API user attempts to reserve an IP and attach it to a name in one step:
    maas session ipaddresses reserve ip_address=10.0.2.98 hostname=test.maas mac=00:11:22:33:44:55

The workaround:
    maas session ipaddresses reserve ip_address=10.0.2.98 mac=00:11:22:33:44:55
    maas session dnsresources create fqdn=test.maas ip_addresses=10.0.2.98

Changed in maas:
assignee: nobody → LaMont Jones (lamont)
Changed in maas:
importance: Undecided → Critical
importance: Critical → High
status: New → In Progress
milestone: none → 2.0.0
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers