-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
app: branchingseverity: highCompletely breaks certain functions, or substantially degrades performance application-wideCompletely breaks certain functions, or substantially degrades performance application-widestatus: acceptedtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Milestone
Description
Plugin Version
v0.7.2
NetBox Version
v4.4.7
Python Version
3.12
Steps to Reproduce
- Start with NetBox v4.3.7 and netbox-branching v0.6.2
- Create a branch
- Upgrade to NetBox v4.4.7 and netbox-branching v0.7.2
- Create a site in the branch (bug is not specific to the type of change being made)
- Attempt to merge the branch
Expected Behavior
The branch should merge successfully.
Observed Behavior
The merge job fails with the following error message:
Error: ModuleNotFoundError("No module named 'thumbnail'")
After some investigation, I've discovered the root cause lies inside the migrators() method on the Branch model:
netbox-branching/netbox_branching/models/branches.py
Lines 314 to 320 in 9ce04cc
| migrators = defaultdict(list) | |
| for migration in self.applied_migrations: | |
| app_label, name = migration.split('.') | |
| module = importlib.import_module(f'{app_label}.migrations.{name}') | |
| for object_type, migrator in getattr(module, 'objectchange_migrators', {}).items(): | |
| migrators[object_type].append(migrator) | |
| return migrators |
Line 317 attempts to resolve the app to which a migration belongs. This fails on the thumbnail.0001_initial migration, because sorl-thumbnail installs as sorl.thumbnail but its migration is prefixed only with thumbnail.
As this method merely looks for object-specific migrators, it's probably safe to simply ignore any import failures.
aoforb
Metadata
Metadata
Assignees
Labels
app: branchingseverity: highCompletely breaks certain functions, or substantially degrades performance application-wideCompletely breaks certain functions, or substantially degrades performance application-widestatus: acceptedtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application