[2.x, API] Unable to update iprange user by name via API

Bug #1665476 reported by Mike Pontillo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Alberto Donato
2.3
Fix Released
Medium
Alberto Donato

Bug Description

The IP range form erroneously expects a user ID, which is not easily available.

$ maas admin iprange update 7 user=user
{"user": ["Select a valid choice. That choice is not one of the available choices."]}

$ sudo -u postgres psql maasdb -c "select id from auth_user where username='user'"
 id
----
  4
(1 row)

$ maas admin iprange update 7 user=4
Success.
Machine-readable output follows:
{
    "resource_uri": "/MAAS/api/2.0/ipranges/7/",
    "id": 7,
    "user": {
        "resource_uri": "/MAAS/api/2.0/users/user/",
        "username": "user",
        "is_superuser": false,
        "email": "<email address hidden>"
    },
    "start_ip": "192.168.0.201",
    "end_ip": "192.168.0.249",
    "subnet": {
        "rdns_mode": 2,
        "id": 8,
        "active_discovery": false,
        "vlan": {
            "fabric": "fabric-0",
            "id": 5001,
            "relay_vlan": null,
            "resource_uri": "/MAAS/api/2.0/vlans/5001/",
            "mtu": 1500,
            "secondary_rack": null,
            "name": "untagged",
            "fabric_id": 0,
            "vid": 0,
            "primary_rack": null,
            "space": "undefined",
            "external_dhcp": "192.168.122.1",
            "dhcp_on": false
        },
        "resource_uri": "/MAAS/api/2.0/subnets/8/",
        "allow_proxy": true,
        "name": "192.168.0.0/24",
        "cidr": "192.168.0.0/24",
        "space": "undefined",
        "gateway_ip": null,
        "dns_servers": [],
        "managed": true
    },
    "comment": "",
    "type": "reserved"
}

Tags: api

Related branches

summary: - Unable to update iprange user by name via API
+ [2.x] Unable to update iprange user by name via API
Changed in maas:
milestone: none → 2.2.0
importance: Undecided → High
status: New → Triaged
Changed in maas:
importance: High → Medium
Changed in maas:
milestone: 2.2.0 → 2.2.x
tags: added: api
summary: - [2.x] Unable to update iprange user by name via API
+ [2.x, API] Unable to update iprange user by name via API
Changed in maas:
milestone: 2.2.x → 2.3.x
status: Triaged → Confirmed
Alberto Donato (ack)
Changed in maas:
assignee: nobody → Alberto Donato (ack)
milestone: 2.3.x → 2.3.0
status: Confirmed → In Progress
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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