Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating multiple IPs at once doesn't properly handle the response #395

Closed
jschewebbn opened this issue Jul 13, 2021 · 0 comments · Fixed by #418
Closed

Creating multiple IPs at once doesn't properly handle the response #395

jschewebbn opened this issue Jul 13, 2021 · 0 comments · Fixed by #418
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@jschewebbn
Copy link

    num_ips = len(new_prefix.available_ips.list())
    ips = new_prefix.available_ips.create([{'status': 'reserved', 'tenant': tenant.id} for i in range(num_ips)])

Results in

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jschewe/py-envs/bi-scripts/lib/python3.8/site-packages/pynetbox/core/endpoint.py", line 475, in create
    return self.custom_return(
  File "/home/jschewe/py-envs/bi-scripts/lib/python3.8/site-packages/pynetbox/core/response.py", line 236, in __init__
    self._parse_values(values)
  File "/home/jschewe/py-envs/bi-scripts/lib/python3.8/site-packages/pynetbox/core/response.py", line 313, in _parse_values
    for k, v in values.items():

I'm using release 6.1.2 of pynetbox.

It seems that the returned object in this case is a list instead of a dict.

@zachmoody zachmoody added the type: bug A confirmed report of unexpected behavior in the application label Jul 16, 2021
zachmoody added a commit that referenced this issue Dec 4, 2021
Handle list results in DetailEndpoint.create() (fixes #395)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants