python-gitlab3 icon indicating copy to clipboard operation
python-gitlab3 copied to clipboard

Can only connect to one server at a time

Open slide opened this issue 9 years ago • 1 comments

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.

slide avatar Oct 03 '14 17:10 slide

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.

samrocketman avatar Oct 03 '14 20:10 samrocketman