mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fix git DataSource clone authentication
Anonymous git clones (in GitLab) require the username and password not to be set in order to successfully clone. This patch will define clone args only, if the username passed is not empty.
This commit is contained in:
committed by
Jeremy Stretch
parent
c46536f469
commit
16e2283d19
@ -103,6 +103,7 @@ class GitBackend(DataBackend):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if self.url_scheme in ('http', 'https'):
|
if self.url_scheme in ('http', 'https'):
|
||||||
|
if self.params.get('username'):
|
||||||
clone_args.update(
|
clone_args.update(
|
||||||
{
|
{
|
||||||
"username": self.params.get('username'),
|
"username": self.params.get('username'),
|
||||||
|
Reference in New Issue
Block a user