I’m following the doc at https://github.com/maas/python-libmaas/blob/master/doc/client/nodes.md
I have this
all_machines = conn.machines.list()
new_machines = [ machine for machine in all_machines if machine.status == NodeStatus.DEFAULT ]
But that errors with “NameError: name ‘NodeStatus’ is not defined”
If I quote NodeStatus.DEFAULT it doesn’t match and I get an empty list
Same result just testing in a for loop
>>> for m in all_machines:
... machine = conn.machines.get(system_id=m.system_id)
... print(machine.status)
... if machine.status == 'NodeStatus.DEFAULT':
... print(yes)
...
NodeStatus.DEPLOYED
NodeStatus.DEPLOYED
NodeStatus.DEPLOYED
NodeStatus.DEPLOYED
NodeStatus.DEPLOYED
NodeStatus.DEFAULT