[2.0 beta 2] interface_set returns an interface without 'links' even if empty

Bug #1571851 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Blake Rouse

Bug Description

eth0 returns empty links key,
eth1 has links key
lxcbr0 returns no links key, which is the issue

"interface_set": [
            {
                "parents": [],
                "type": "bridge",
                "enabled": true,
                "id": 7,
                "vlan": {
                    "primary_rack": null,
                    "fabric": "fabric-4",
                    "resource_uri": "/MAAS/api/2.0/vlans/5005/",
                    "secondary_rack": null,
                    "id": 5005,
                    "vid": 0,
                    "external_dhcp": "10.0.3.1",
                    "mtu": 1500,
                    "name": "untagged",
                    "dhcp_on": false
                },
                "tags": [],
                "params": "",
                "name": "lxcbr0",
                "mac_address": "26:e0:1b:f7:cc:63"
            },
            {
                "parents": [],
                "resource_uri": "/MAAS/api/2.0/nodes/4y3h7n/interfaces/4/",
                "discovered": null,
                "vlan": {
                    "primary_rack": null,
                    "fabric": "fabric-1",
                    "resource_uri": "/MAAS/api/2.0/vlans/5002/",
                    "secondary_rack": null,
                    "id": 5002,
                    "vid": 0,
                    "external_dhcp": null,
                    "mtu": 1500,
                    "name": "untagged",
                    "dhcp_on": false
                },
                "tags": [],
                "children": [],
                "type": "physical",
                "links": [
                    {
                        "id": 1,
                        "mode": "static",
                        "subnet": {
                            "resource_uri": "/MAAS/api/2.0/subnets/1/",
                            "space": "space-0",
                            "cidr": "10.245.136.0/21",
                            "name": "10.245.136.0/21",
                            "rdns_mode": 2,
                            "allow_proxy": true,
                            "id": 1,
                            "dns_servers": [],
                            "vlan": {
                                "primary_rack": null,
                                "fabric": "fabric-1",
                                "resource_uri": "/MAAS/api/2.0/vlans/5002/",
                                "secondary_rack": null,
                                "id": 5002,
                                "vid": 0,
                                "external_dhcp": null,
                                "mtu": 1500,
                                "name": "untagged",
                                "dhcp_on": false
                            },
                            "gateway_ip": "10.245.136.1"
                        },
                        "ip_address": "10.245.136.6"
                    }
                ],
                "name": "eth1",
                "enabled": true,
                "id": 4,
                "params": "",
                "effective_mtu": 1500,
                "mac_address": "de:ad:be:ef:6b:b3"
            },
            {
                "parents": [],
                "resource_uri": "/MAAS/api/2.0/nodes/4y3h7n/interfaces/1/",
                "discovered": null,
                "vlan": {
                    "primary_rack": null,
                    "fabric": "fabric-0",
                    "resource_uri": "/MAAS/api/2.0/vlans/5001/",
                    "secondary_rack": null,
                    "id": 5001,
                    "vid": 0,
                    "external_dhcp": null,
                    "mtu": 1500,
                    "name": "untagged",
                    "dhcp_on": false
                },
                "tags": [],
                "children": [],
                "type": "physical",
                "links": [],
                "name": "eth0",
                "enabled": false,
                "id": 1,
                "params": "",
                "effective_mtu": 1500,
                "mac_address": "52:54:00:12:34:56"
            }
        ],

Tags: ci

Related branches

tags: added: ci
no longer affects: maas (Ubuntu)
Changed in maas:
milestone: none → 2.0.0
Revision history for this message
Mike Pontillo (mpontillo) wrote :

I looked at the code and am not sure why this is happening.

in src/maasserver/api/interfaces.py we declare that 'links' is one of the displayed fields. Then we define a @classmethod called `links()` on the InterfaceHandler which calls `interface.get_links()` for the interface in question. This method (on the `Interface` class) always returns a list with zero or more elements. (*unless* an exception is raised) We do not override `get_links()` for any interface type.

Now, I would assume that you would see worse problems if an exception was thrown, such as not getting a result back at all. But I have to ask: are there any tracebacks in the log when this happens?

Changed in maas:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Blake Rouse (blake-rouse)
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.