Tags not assigned from netbox shell #2959

Closed
opened 2025-12-29 18:24:03 +01:00 by adam · 1 comment
Owner

Originally created by @subzer0iq on GitHub (Oct 17, 2019).

I can not assign tag to any ip address from netbox shell. From web this works perfect.

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.6

Steps to Reproduce

$ ./manage.py nbshell
### NetBox interactive shell (test-office-1)
### Python 3.6.8 | Django 2.2.6 | NetBox 2.6.6
### lsmodels() will show available models. Use help(<model>) for more info.
>>> for t in IPAddress.tags.all():
...     print(t)
...
testtag
>>> for ip in IPAddress.objects.filter(address='192.168.43.48/24'):
...     print(ip)
...
>>> ip = IPAddress(address = '192.168.43.48/24', family=4, status=1, description='test', tags = IPAddress.tags.filter(name='testtag').all().first())
>>> ip
<IPAddress: 192.168.43.48/24>
>>> ip.tags
<Tag: testtag>
>>> ip.save()
>>> for ip in IPAddress.objects.filter(address='192.168.43.48/24'):
...     print(ip.tags)
...
ipam.IPAddress.None
>>> for ip in IPAddress.objects.filter(address='192.168.43.48/24'):
...     print(ip.tags.all().first())
...
None
>>>

Expected Behavior

Tag must be assigned to ip address.

Observed Behavior

Tag not assigned to ip address.

Originally created by @subzer0iq on GitHub (Oct 17, 2019). <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> I can not assign tag to any ip address from netbox shell. From web this works perfect. ### Environment * Python version: **3.6.8** * NetBox version: **2.6.6** <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce ``` $ ./manage.py nbshell ### NetBox interactive shell (test-office-1) ### Python 3.6.8 | Django 2.2.6 | NetBox 2.6.6 ### lsmodels() will show available models. Use help(<model>) for more info. >>> for t in IPAddress.tags.all(): ... print(t) ... testtag >>> for ip in IPAddress.objects.filter(address='192.168.43.48/24'): ... print(ip) ... >>> ip = IPAddress(address = '192.168.43.48/24', family=4, status=1, description='test', tags = IPAddress.tags.filter(name='testtag').all().first()) >>> ip <IPAddress: 192.168.43.48/24> >>> ip.tags <Tag: testtag> >>> ip.save() >>> for ip in IPAddress.objects.filter(address='192.168.43.48/24'): ... print(ip.tags) ... ipam.IPAddress.None >>> for ip in IPAddress.objects.filter(address='192.168.43.48/24'): ... print(ip.tags.all().first()) ... None >>> ``` <!-- What did you expect to happen? --> ### Expected Behavior Tag must be assigned to ip address. <!-- What happened instead? --> ### Observed Behavior Tag not assigned to ip address.
adam closed this issue 2025-12-29 18:24:03 +01:00
Author
Owner

@DanSheps commented on GitHub (Oct 17, 2019):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list instead.

@DanSheps commented on GitHub (Oct 17, 2019): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided [here](https://github.com/digitalocean/netbox/issues/new/choose). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2959