Skip to content

Fix for #716: %d replaced by %s #729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions gitlab/v4/objects.py
Original file line number Diff line number Diff line change
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