maas api "device release-sticky-ip-address" could use a better error message

Bug #1441018 reported by Dimiter Naydenov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Mike Pontillo

Bug Description

Same scenario as in bug 1441013. I've tried "device release-sticky-ip-address" with a valid, empty, and invalid "address=" argument and in the last two cases the error I got is:

(u'%s: could not deallocate sticky IP address: %s', u'juju-machine-0-lxc-0-newhost', u'192.168.50.8')

(or u'' as last element when I passed address= or "address=192.168.50.8 address=" - the latter working is slightly surprising)

I've expected a more user-friendly error message (e.g. "Could not deallocated sticky IP address 192.168.50.8 from device juju-machine-0-lxc-0-newhost" or "address argument is optional, but cannot be empty" in the latter case).

Here's a paste with the described steps and results: http://paste.ubuntu.com/10759261/

Related branches

Raphaël Badin (rvb)
Changed in maas:
importance: Undecided → Critical
milestone: none → 1.8.0
status: New → Triaged
assignee: nobody → Raphaël Badin (rvb)
Raphaël Badin (rvb)
Changed in maas:
importance: Critical → High
assignee: Raphaël Badin (rvb) → nobody
Changed in maas:
assignee: nobody → Mike Pontillo (mpontillo)
Changed in maas:
status: Triaged → Fix Committed
Revision history for this message
Dimiter Naydenov (dimitern) wrote :

Confirmed as fixed in 1.8.0~beta6+bzr3904-0ubuntu1~trusty1

I've retried the following:

$ maas maas-user device release-sticky-ip-address node-f8a2ecd4-fe1d-11e4-aba0-525400355a63 address=
{u'address': u'Cannot be empty if supplied.'}

$ maas maas-user device release-sticky-ip-address node-f8a2ecd4-fe1d-11e4-aba0-525400355a63 address=aa
{"address": ["Enter a valid IPv4 or IPv6 address."]}

$ maas maas-user device release-sticky-ip-address node-f8a2ecd4-fe1d-11e4-aba0-525400355a63 address=192.168.50.100
bar: could not deallocate sticky IP address: 192.168.50.100

(NOTE: slightly awkward prefix - the device's hostname)

$ maas maas-user device release-sticky-ip-address node-f8a2ecd4-fe1d-11e4-aba0-525400355a63 address=192.168.50.180
Success.
Machine-readable output follows:
{
    "macaddress_set": [
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-f8a2ecd4-fe1d-11e4-aba0-525400355a63/macs/00%3A11%3A22%3A33%3A44%3A55/",
            "mac_address": "00:11:22:33:44:55"
        }
    ],
    "zone": {
        "resource_uri": "/MAAS/api/1.0/zones/default/",
        "name": "default",
        "description": ""
    },
    "parent": "node-fc3bdec0-c163-11e3-84a7-525400355a63",
    "ip_addresses": [
        "192.168.50.180"
    ],
    "hostname": "bar.maas",
    "tag_names": [],
    "owner": "maas-user",
    "system_id": "node-f8a2ecd4-fe1d-11e4-aba0-525400355a63",
    "resource_uri": "/MAAS/api/1.0/devices/node-f8a2ecd4-fe1d-11e4-aba0-525400355a63/"
}

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.