[2.0b4] ipranges create raises incorrect error for missing type

Bug #1573660 reported by Blake Rouse on 2016-04-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Medium
Unassigned

Bug Description

I went to reserve an IP range and when I didn't specify the type it gave errors for start_ip and end_ip. It should have only said

"type": ["This field is required."]

ubuntu@region-1:~$ maas admin ipranges create start_ip=192.168.122.1 end_ip=192.168.122.39
{"start_ip": ["No range can be created at requested start IP."], "type": ["This field is required.", "No range can be created at requested start IP."]}

ubuntu@region-1:~$ maas admin ipranges create start_ip=192.168.122.1 end_ip=192.168.122.39 type=reserved
Success.
Machine-readable output follows:
{
    "id": 2,
    "resource_uri": "/MAAS/api/2.0/ipranges/2/",
    "type": "reserved",
    "start_ip": "192.168.122.1",
    "end_ip": "192.168.122.39",
    "comment": "",
    "user": {
        "username": "admin",
        "email": "noreply@maas",
        "is_superuser": true
    },
    "subnet": {
        "resource_uri": "/MAAS/api/2.0/subnets/1/",
        "gateway_ip": "192.168.122.1",
        "allow_proxy": true,
        "dns_servers": [],
        "space": "space-0",
        "cidr": "192.168.122.0/24",
        "id": 1,
        "rdns_mode": 2,
        "name": "192.168.122.0/24",
        "vlan": {
            "resource_uri": "/MAAS/api/2.0/vlans/5001/",
            "dhcp_on": true,
            "secondary_rack": "4y3h7s",
            "mtu": 1500,
            "fabric": "fabric-0",
            "external_dhcp": null,
            "id": 5001,
            "primary_rack": "4y3h7r",
            "name": "untagged",
            "vid": 0
        }
    }
}

Tags: api Edit Tag help

Related branches

summary: - [2.0b4] ipranges create type field should not be required
+ [2.0b4] ipranges create raises incorrect error for missing type
description: updated
Changed in maas:
status: Triaged → Invalid
status: Invalid → Confirmed
Changed in maas:
status: Confirmed → Triaged
Changed in maas:
status: Triaged → 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