maas-cli doesn't show zone as one of the parameters that could be updated in a node

Bug #1285272 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Julian Edwards

Bug Description

root@autopkgtest:~# maas maas node update -h
usage: /usr/lib/python2.7/dist-packages/maascli/__main__.py maas node update
       [-h] [-d] [-k] system_id [data [data ...]]

Update a specific Node.

positional arguments:
  system_id
  data
:param hostname: The new hostname for this node.
:type hostname: unicode
:param architecture: The new architecture for this node (see
    vocabulary `ARCHITECTURE`).
:type architecture: unicode
:param power_type: The new power type for this node (see
    vocabulary `POWER_TYPE`). Note that if you set power_type to
    use the default value, power_parameters will be set to the empty
    string. Available to admin users.
:type power_type: unicode
:param power_parameters_{param1}: The new value for the 'param1'
    power parameter. Note that this is dynamic as the available
    parameters depend on the selected value of the Node's power_type.
    For instance, if the power_type is 'ether_wake', the only valid
    parameter is 'power_address' so one would want to pass 'myaddress'
    as the value of the 'power_parameters_power_address' parameter.
    Available to admin users.
:type power_parameters_{param1}: unicode
:param power_parameters_skip_check: Whether or not the new power
    parameters for this node should be checked against the expected
    power parameters for the node's power type ('true' or 'false').
    The default is 'false'.
:type power_parameters_skip_validation: unicode

root@autopkgtest:~# maas maas node update node-0ffc4d1c-9f01-11e3-9bf8-525400123456 zone='test-zone'
{
    "status": 0,
    "macaddress_set": [
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-0ffc4d1c-9f01-11e3-9bf8-525400123456/macs/00%3Ae0%3A81%3Add%3Ad1%3A0b/",
            "mac_address": "00:e0:81:dd:d1:0b"
        },
        {
            "resource_uri": "/MAAS/api/1.0/nodes/node-0ffc4d1c-9f01-11e3-9bf8-525400123456/macs/00%3Ae0%3A81%3Add%3Ad1%3A0c/",
            "mac_address": "00:e0:81:dd:d1:0c"
        }
    ],
    "hostname": "qqq9p.maas",
    "power_type": "ipmi",
    "routers": null,
    "netboot": true,
    "cpu_count": 0,
    "storage": 0,
    "system_id": "node-0ffc4d1c-9f01-11e3-9bf8-525400123456",
    "architecture": "amd64/generic",
    "memory": 0,
    "owner": null,
    "tag_names": [],
    "ip_addresses": [
        "192.168.21.14"
    ],
    "resource_uri": "/MAAS/api/1.0/nodes/node-0ffc4d1c-9f01-11e3-9bf8-525400123456/"
}

Although the command returns successfully and looking in the web ui the node is in the 'test-zone', the returned JSON doesn't show the zone the node belongs to.

Tags: cli trivial

Related branches

Revision history for this message
Julian Edwards (julian-edwards) wrote :

There are two bugs here:

1. the docstring for NodeHandler.update() does not have zone listed as a param
2. DISPLAYED_NODE_FIELDS is out of date

tags: added: trivial
Changed in maas:
status: New → Triaged
importance: Undecided → High
milestone: none → 14.04
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Thanks for triaging this bug Julian. Another issue with the maas CLI zones is that you get no output deleting a non existent zone. Perhaps the cli should inform that you can't delete something that doesn't exist similar to the message when you try to delete the default zone.

$ maas maas zone delete non-existent-zone

Not sure if that's worth another bug, I don't think so, hence I'm including this info here.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

It would say it's a separate bug. The code should be returning a 404.

Changed in maas:
assignee: nobody → Julian Edwards (julian-edwards)
status: Triaged → In Progress
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Filed bug 1286121 for the cli not reporting an error when you try to delete a non existent zone.

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.