[2.1] dnsresources create fails on valid IP

Bug #1676619 reported by Kevin Metz
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Unassigned
2.1
Fix Released
High
Unassigned

Bug Description

running the following command

maas ubuntu dnsresources create fqdn=my.host.com ip_addresses=172.31.0.11
fails with the error

invalid literal for int() with base 10: '172.31.0.11'

Related branches

Revision history for this message
LaMont Jones (lamont) wrote :

In the current code, forms/dnsresource.py's clean_ip converts a given IP address into a StaticIPAddress.id... if that fails, it happily leaves it as a string, and we die.

I played with a branch over the weekend that starts to address it, by creating the needed StaticIPAddress entries in save() if they do not exist.

Changed in maas:
status: New → Confirmed
Changed in maas:
status: Confirmed → Triaged
importance: Undecided → High
summary: - dnsresources create fails on valid IP
+ [2.1] dnsresources create fails on valid IP
Changed in maas:
milestone: none → 2.2.0
Revision history for this message
Craig Bender (craig-bender) wrote :

ubuntu@OrangeBox20:~$ maas admin dnsresources create fqdn=host.ubuntu-cloud.archive.canonical.com ip_addresses=192.168.8.2
invalid literal for int() with base 10: '192.168.8.2'

ubuntu@OrangeBox20:~$ maas admin dnsresources create fqdn=host.ubuntu-cloud.archive.canonical.com
Success.
Machine-readable output follows:
{
    "fqdn": "host.ubuntu-cloud.archive.canonical.com",
    "resource_uri": "/MAAS/api/2.0/dnsresources/105/",
    "ip_addresses": [],
    "resource_records": [],
    "id": 105,
    "address_ttl": null
}

ubuntu@OrangeBox20:~$ maas admin dnsresources read|jq -r '.[]|select(.id==105)'
{
  "fqdn": "host.ubuntu-cloud.archive.canonical.com",
  "resource_uri": "/MAAS/api/2.0/dnsresources/105/",
  "ip_addresses": [],
  "resource_records": [],
  "id": 105,
  "address_ttl": null
}
ubuntu@OrangeBox20:~$ maas admin dnsresource update 105 ip_addresses=192.168.8.2
invalid literal for int() with base 10: '192.168.8.2'

Changed in maas:
status: Triaged → Fix Committed
milestone: 2.2.0 → 2.2.0rc1
Changed in maas:
status: Fix Committed → Fix Released
Revision history for this message
Billy Olsen (billy-olsen) wrote :

Confirmed that this exists in 2.1.5 and is fixed in the ppa:maas/proposed package 2.1.6 for Xenial.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.