canonical / python-libmaas

Unofficial python client library for MAAS
https://maas.io
Other
62 stars 70 forks source link

'NoneType' object has no attribute 'fabric_id' during InterfaceType.VLAN creation #244

Closed sergeygalkin closed 6 months ago

sergeygalkin commented 4 years ago

The code

    fabric_10 = client.fabrics.get('1')
    int_bond1 = machine.interfaces.get_by_name('bond1')
    int_bond2 = machine.interfaces.get_by_name('bond2')
    for vlan in fabric_10.vlans:
        if vlan.vid == 452 or vlan.vid == 453 or vlan.vid == 455:
            print("Add vlan {} {} to {}".format(vlan.name, vlan.vid, int_bond1.name))
            machine.interfaces.create(InterfaceType.VLAN, parent=int_bond1, vlan=vlan)

get error maas/client/bones/init.py", line 478, in dispatch raise CallError(request, response, content, self) maas.client.bones.CallError: POST http://192.168.1.5:5240/MAAS/api/2.0/nodes/7bc8h7/interfaces/?op=create_vlan -> HTTP 500 Internal Server Error ('NoneType' object has no attribute 'fabric_id')

sergeygalkin commented 4 years ago

incorrect issue this is not vlan on interface this is vlan in fabric

sergeygalkin commented 4 years ago

so is this like https://maas.io/docs/cli-interface-management#heading--create-a-vlan-interface then this is incorrect issue. if machine.interfaces.create(InterfaceType.VLAN should create interface like https://i.imgur.com/1v1E5Vg.png this is correct issue. Or maybe my bond1 created incorrect and should assign to fabric 10 before vlan creating Please clarify

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 30 days since being marked as stale.