-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Datasource git on local file system fails #16760
Comments
This might be an issue in the dulwich LocalGitClient code, don't seem to be able to fix it from Netbox. EDIT: see below for why it seemed my changes to the Netbox code didn't work. |
Thanks for reporting a problem you've encountered in NetBox. I've managed to reproduce the problem you describe in a fresh NetBox 4.0.6 installation. For the benefit of future workers of this issue, here's what I did to set up the bare local Git repo and otherwise prepare the system.
I'm moving your issue along to |
Thanks for taking the time to add these steps. EDIT: I didn't restart the Netbox worker, only the Netbox process, that's why my changes to the Netbox code didn't work, duh This fixes the issue, but is it acceptable if I rework it into a PR ? --- a/core/data_backends.py
+++ b/core/data_backends.py
@@ -133,6 +133,10 @@
"password": self.params.get('password'),
}
)
+ elif not self.url_scheme:
+ clone_args["depth"] = None
+ del(clone_args["quiet"])
logger.debug(f"Cloning git repo: {self.url}")
try: |
I'd like to submit a PR based on the diff I posted. |
@thefriendlynet thanks, I've assigned this to you. |
Deployment Type
Self-hosted
NetBox Version
v4.0.2
Python Version
3.11
Steps to Reproduce
Expected Behavior
files synced from local file system
Observed Behavior
SyncError("Fetching remote data failed (TypeError): LocalGitClient.__init__() got an unexpected keyword argument 'quiet'")
netbox/netbox/core/data_backends.py
"quiet" and "depth" aren't supported by dulwich for local filesystem git repo's
The text was updated successfully, but these errors were encountered: