summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2016-06-17 19:08:37 +0100
committerVLetrmx <richardipsum@fastmail.co.uk>2016-06-17 18:44:24 +0000
commit14b816b40f44ca19d51d9fe478fdcae8cc53d73a (patch)
treefac357bc9ab7edabb542fa81fbf0bc27b7b50e00
parenta458d0d61d1f2b8a4b3f0f5180e9bb7c1cc4a730 (diff)
downloadlorry-controller-14b816b40f44ca19d51d9fe478fdcae8cc53d73a.tar.gz
Add docstring for suitable_path()
Change-Id: I3a95880618218da00991f8ac58dee54d06a0da41
-rw-r--r--lorrycontroller/gitlab.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lorrycontroller/gitlab.py b/lorrycontroller/gitlab.py
index b22bb30..55b8e4f 100644
--- a/lorrycontroller/gitlab.py
+++ b/lorrycontroller/gitlab.py
@@ -94,6 +94,18 @@ class Gitlab(object):
return match.groups()[0]
def suitable_path(self, project):
+ '''Return a path for a downstream Lorry Controller instance to consume.
+
+ Should the path that was lorried have contained more than one level of
+ namespacing (more than one '/' within the repository path), then for
+ GitLab to handle this, we replace any '/'s (remaining in the project
+ name after extracting the group name) with underscores (_). To preserve
+ the original path, we set the 'original_path' within the project
+ description.
+ This method will attempt to return 'original_path' if it was set,
+ otherwise it will return the 'path_with_namespace', being of the format
+ 'group_name/project_name', rather than 'group_name/project/name'.
+ '''
return (self.try_get_original_path(project.description) or
project.path_with_namespace)