Comments (2)
This is certainly a bug in the post_save
hook for Device
objects.
See: https://github.com/dropbox/nsot/blob/develop/nsot/models/interface.py#L454-L457
We're accounting for updating Interface.device_hostname
but not updating the Interface.name_slug
. Normally this could be handled by the model validation built into Interface.save()
but the problem is calling the aggregate .update()
method on a query set explicitly *does not call save.
So the fix to this is pretty simple...
def update_device_interfaces(sender, instance, **kwargs):
"""Anytime a device is saved, update device_hostname on its interfaces"""
interfaces = Interface.objects.filter(device=instance)
for interface in interfaces.iterator():
interface.device_hostname = instance.hostname
interface.name_slug = None # initialize so that model validation resets it to new hostname
interface.save()
from nsot.
Confirmed. Thanks.
from nsot.
Related Issues (20)
- Interface.type should accept and display a string representation
- Refactor common model helpers/validators into a single place
- NSoT Changes endpoint should be able to filter the change log with more granularity
- Upgrade to support Python 3.6+ HOT 2
- Quickstart says to create superuser when prompted, but there is no prompt HOT 3
- Timezone calculation error: NSoT should set UTC by default. HOT 1
- Make Circuits 'Interface Optional' HOT 1
- Install error: conflicting types for ‘ASN1_TIME_to_generalizedtime’ HOT 1
- Object list views sometimes return stale results
- Host names restrictions HOT 1
- Demo Login Fails HOT 2
- Attributeerror: module object has no attribute getuid HOT 1
- NSOT_NEW_USERS_AS_SUPERUSER isn't documented.
- next_network for state=assigned
- psycopg2 version behind when using Docker and Postgres
- Nsot completely breaks if the initial site is created with an emoji in the description
- NSoT Installation failure HOT 8
- interface old addresses state is not updated when you assign a new addresses
- Any attempt to migration to Python3? Is this project dead? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsot.