Skip to content

Iterating over devices works only once #450

Description

@sol1james

If I iterate over all devices as shown in the example code in the documentation it works only once. Ie if I write code like this:

>>> devices = nb.dcim.devices.all()
>>> for device in devices:
...     print(device.name)
>>> for device in devices:
...     print(device.name)

The print statement in the second for loop doesn't get executed. If I do another call to all() then I get another iterator but this introduces a noticable pause. You used to be able to do this without any pauses.

Is this working as designed?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: documentationA change or addition to the documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions