[2.0] Cannot create an IP reservation with a hostname

Bug #1590021 reported by LaMont Jones on 2016-06-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
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
  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
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= hostname=test.maas mac=00:11:22:33:44:55

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

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