Skip to content

Commit

Permalink
Fix for #716: %d replaced by %s
Browse files Browse the repository at this point in the history
  • Loading branch information
xarx00 committed Mar 5, 2019
1 parent 1792442 commit 675f879
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gitlab/v4/objects.py
Expand Up @@ -909,7 +909,7 @@ def transfer_project(self, to_project_id, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabTransferProjectError: If the project could not be transfered
"""
path = '/groups/%d/projects/%d' % (self.id, to_project_id)
path = '/groups/%s/projects/%s' % (self.id, to_project_id)
self.manager.gitlab.http_post(path, **kwargs)

@cli.register_custom_action('Group', ('scope', 'search'))
Expand All @@ -930,7 +930,7 @@ def search(self, scope, search, **kwargs):
GitlabList: A list of dicts describing the resources found.
"""
data = {'scope': scope, 'search': search}
path = '/groups/%d/search' % self.get_id()
path = '/groups/%s/search' % self.get_id()
return self.manager.gitlab.http_list(path, query_data=data, **kwargs)

@cli.register_custom_action('Group', ('cn', 'group_access', 'provider'))
Expand All @@ -949,7 +949,7 @@ def add_ldap_group_link(self, cn, group_access, provider, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabCreateError: If the server cannot perform the request
"""
path = '/groups/%d/ldap_group_links' % self.get_id()
path = '/groups/%s/ldap_group_links' % self.get_id()
data = {'cn': cn, 'group_access': group_access, 'provider': provider}
self.manager.gitlab.http_post(path, post_data=data, **kwargs)

Expand All @@ -967,7 +967,7 @@ def delete_ldap_group_link(self, cn, provider=None, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabDeleteError: If the server cannot perform the request
"""
path = '/groups/%d/ldap_group_links' % self.get_id()
path = '/groups/%s/ldap_group_links' % self.get_id()
if provider is not None:
path += '/%s' % provider
path += '/%s' % cn
Expand All @@ -985,7 +985,7 @@ def ldap_sync(self, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabCreateError: If the server cannot perform the request
"""
path = '/groups/%d/ldap_sync' % self.get_id()
path = '/groups/%s/ldap_sync' % self.get_id()
self.manager.gitlab.http_post(path, **kwargs)


Expand Down Expand Up @@ -3216,7 +3216,7 @@ def download(self, streamed=False, action=None, chunk_size=1024, **kwargs):
Returns:
str: The blob content if streamed is False, None otherwise
"""
path = '/projects/%d/export/download' % self.project_id
path = '/projects/%s/export/download' % self.project_id
result = self.manager.gitlab.http_get(path, streamed=streamed,
raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
Expand Down Expand Up @@ -3717,7 +3717,7 @@ def snapshot(self, wiki=False, streamed=False, action=None,
Returns:
str: The uncompressed tar archive of the repository
"""
path = '/projects/%d/snapshot' % self.get_id()
path = '/projects/%s/snapshot' % self.get_id()
result = self.manager.gitlab.http_get(path, streamed=streamed,
raw=True, **kwargs)
return utils.response_content(result, streamed, action, chunk_size)
Expand All @@ -3740,7 +3740,7 @@ def search(self, scope, search, **kwargs):
GitlabList: A list of dicts describing the resources found.
"""
data = {'scope': scope, 'search': search}
path = '/projects/%d/search' % self.get_id()
path = '/projects/%s/search' % self.get_id()
return self.manager.gitlab.http_list(path, query_data=data, **kwargs)

@cli.register_custom_action('Project')
Expand All @@ -3755,7 +3755,7 @@ def mirror_pull(self, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabCreateError: If the server failed to perform the request
"""
path = '/projects/%d/mirror/pull' % self.get_id()
path = '/projects/%s/mirror/pull' % self.get_id()
self.manager.gitlab.http_post(path, **kwargs)

@cli.register_custom_action('Project', ('to_namespace', ))
Expand All @@ -3772,7 +3772,7 @@ def transfer_project(self, to_namespace, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabTransferProjectError: If the project could not be transfered
"""
path = '/projects/%d/transfer' % (self.id,)
path = '/projects/%s/transfer' % (self.id,)
self.manager.gitlab.http_put(path,
post_data={"namespace": to_namespace},
**kwargs)
Expand Down

0 comments on commit 675f879

Please sign in to comment.