[2.3, CLI, docstring] 'subnet update' docstrings and error message is misleading

Bug #1771547 reported by Michał Ajduk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Medium
Unassigned

Bug Description

MAAS 2.3.3 subnet update command parameter value expectations are inconsistent.

This method accepts keyword arguments:
:param name: Name of the subnet.
:param description: Description of the subnet.
:param vlan: VLAN this subnet belongs to.
:param space: Space this subnet is in.
:param cidr: The network CIDR for this subnet.
:param gateway_ip: The gateway IP address for this subnet.
:param rdns_mode: How reverse DNS is handled for this subnet.
:param allow_proxy: Configure maas-proxy to allow requests from this subnet.
:param dns_servers: Comma-seperated list of DNS servers for this subnet.

When trying to invoke with vlan parameter:
maas maas subnet update 46 fabric=3 vlan=1502 name=100.70.0.0/20 cidr=100.70.0.0/20 gateway_ip=
{"vlan": ["Select a valid choice. That choice is not one of the available choices."]}

This way it is impossible to reassign subnet vlan from CLI.

Tags: doc 4010
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Michal,

Can you please clarify what you mean by "invoking the vlan parameter"? What are you trying to do?

That said, the error does indeed seem non-informative, but at the same time, it could actually be an issue given that the vlan=1502 may not exist...

Also, in your report you have 'gateway_ip='

Thanks

Changed in maas:
status: New → Invalid
status: Invalid → Incomplete
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Also, please provide the list of vlan's and ID's. Is vlan 1502 the VID or is it the DB 'id' of the vlan?

Revision history for this message
Michał Ajduk (majduk) wrote :

Hi,

You've pointed me to righ direction. I was trying to assign subnet to VLAN VID 1502. Is is a VID, not DB id. And this was the issue.

The description was a bit misleading:
:param vlan: VLAN this subnet belongs to.

1. Read VLANs for fabric 3:
~$ maas maas vlans read 3
Success.
Machine-readable output follows:
[
    {
        "id": 5004,
        "space": "clo",
        "resource_uri": "/MAAS/api/2.0/vlans/5004/",
        "secondary_rack": null,
        "fabric": "torSharedL2",
        "name": "untagged",
        "primary_rack": null,
        "dhcp_on": false,
        "fabric_id": 3,
        "external_dhcp": null,
        "relay_vlan": null,
        "mtu": 9134,
        "vid": 0
    },
    {
        "id": 5057,
        "space": "ovr",
        "resource_uri": "/MAAS/api/2.0/vlans/5057/",
        "secondary_rack": null,
        "fabric": "torSharedL2",
        "name": "OVER_BE",
        "primary_rack": null,
        "dhcp_on": false,
        "fabric_id": 3,
        "external_dhcp": null,
        "relay_vlan": null,
        "mtu": 9134,
        "vid": 1502
    },
    {
        "id": 5058,
        "space": "clo",
        "resource_uri": "/MAAS/api/2.0/vlans/5058/",
        "secondary_rack": null,
        "fabric": "torSharedL2",
        "name": "OPEN_FE",
        "primary_rack": null,
        "dhcp_on": false,
        "fabric_id": 3,
        "external_dhcp": null,
        "relay_vlan": null,
        "mtu": 9134,
        "vid": 1501
    }
]

2. Read subnet before any operation:
~$ maas maas subnet read 46
Success.
Machine-readable output follows:
{
    "gateway_ip": null,
    "name": "100.70.0.0/20",
    "dns_servers": [],
    "rdns_mode": 2,
    "vlan": {
        "mtu": 9134,
        "relay_vlan": null,
        "name": "OVER_BE",
        "space": "ovr",
        "secondary_rack": null,
        "fabric_id": 3,
        "id": 5057,
        "vid": 1502,
        "external_dhcp": null,
        "dhcp_on": false,
        "resource_uri": "/MAAS/api/2.0/vlans/5057/",
        "primary_rack": null,
        "fabric": "torSharedL2"
    },
    "id": 46,
    "cidr": "100.70.0.0/20",
    "allow_proxy": true,
    "resource_uri": "/MAAS/api/2.0/subnets/46/",
    "active_discovery": false,
    "space": "ovr",
    "managed": true
}

3. Then try assigning the subnet to another VLAN (from 1502 to 1501):
a) attempt using VID:
~$ maas maas subnet update 46 vlan=1501
{"vlan": ["Select a valid choice. That choice is not one of the available choices."]}

b) attempt using DB id:
~$ maas maas subnet update 46 vlan=5058
Success.

I think we can close it.

Changed in maas:
status: Incomplete → Invalid
Revision history for this message
Andres Rodriguez (andreserl) wrote : Re: [2.3, CLI] 'subnet update' docstrings and error message is misleading

I'm re-opening this bug report with the goal of improving the docstrings and error messages, as it doesn't clearly identify what it is needed.

summary: - [2.3, CLI] 'subnet update' command parameter value expectations are
- inconsistent
+ [2.3, CLI] 'subnet update' docstrings and error message is misleading
Changed in maas:
status: Invalid → Triaged
milestone: none → 2.4.0rc2
importance: Undecided → Medium
tags: added: doc
summary: - [2.3, CLI] 'subnet update' docstrings and error message is misleading
+ [2.3, CLI, docstring] 'subnet update' docstrings and error message is
+ misleading
Changed in maas:
milestone: 2.4.0rc2 → 2.5.0
Changed in maas:
milestone: 2.5.0 → 2.5.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
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.