doctormo / python-gitlab3

Python wrapper for the entire GitLab API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transferring a project is forbidden with GitLab 7.6.2

samrocketman opened this issue · comments

In a nutshell... (this is on a virtualbox image so none of the secrets matter)

import gitlab3 as gitlab
token_secret='xmjRs_poU_RdQUGMBeqN'
gitlab_url='http://192.168.10.111'
gitlab_namespace='Mirrors'
gitlab_user='gitmirror'
git=gitlab.GitLab(gitlab_url=gitlab_url,token=token_secret,ssl_verify=True)
#a group was created with an ID of 3 and project that has an ID of 2
git.group(3).transfer_project(2)

From that action I get the following exception stack trace.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gitlab3/__init__.py", line 248, in fn
    return req_fn(_self, url, addl_keys=arg_keys, data=kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gitlab3/__init__.py", line 418, in _post
    return self._request(requests.post, api_url, addl_keys, data)
  File "/usr/local/lib/python2.7/dist-packages/gitlab3/__init__.py", line 435, in _request
    self._check_status_code(r.status_code, url, data)
  File "/usr/local/lib/python2.7/dist-packages/gitlab3/__init__.py", line 411, in _check_status_code
    raise self._code_to_exc[status_code](msg)
gitlab3.exceptions.ForbiddenRequest: URL: http://192.168.10.111/api/v3/groups/3/projects/2, Data: {}

FYI the gitmirror user is owner of the group in which I'm attempting to make the transfer.

nginx logs

192.168.10.111 - - [10/Jan/2015:22:26:14 -0500] "POST /api/v3/groups/3/projects/2 HTTP/1.1" 403 58 "-" "python-requests/2.2.1 CPython/2.7.6 Linux/3.13.0-43-generic"

producion.log from gitlab

Started POST "/api/v3/groups/3/projects/2" for 127.0.0.1 at 2015-01-10 22:28:04 -0500

The API documentation still appears to be the same.

http://doc.gitlab.com/ce/api/groups.html#transfer-project-to-group

Nevermind. I forgot that the user was required to be an admin user in gitlab. Closing this issue as the GitLab team basically said they won't fix that.