python-gitlab3
python-gitlab3 copied to clipboard
Can only connect to one server at a time
I was trying to use the library to migrate some information from an older server to a new server, so I did
old = GitLab(old_url, old_token)
new = GitLab(new_url, new_token)
for u in old.users():
print u.name
This showed me users from the new server instead of the old server.
This appears to be a bug in how class attributes are defined statically in the class rather than an instance. setattr seems affect the base url across classes would be my guess. It would be better if _GitLabAPI was instantiated rather than depending on the definition itself.