diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2016-06-17 19:08:37 +0100 |
---|---|---|
committer | VLetrmx <richardipsum@fastmail.co.uk> | 2016-06-17 18:44:24 +0000 |
commit | 14b816b40f44ca19d51d9fe478fdcae8cc53d73a (patch) | |
tree | fac357bc9ab7edabb542fa81fbf0bc27b7b50e00 /lorrycontroller | |
parent | a458d0d61d1f2b8a4b3f0f5180e9bb7c1cc4a730 (diff) | |
download | lorry-controller-14b816b40f44ca19d51d9fe478fdcae8cc53d73a.tar.gz |
Add docstring for suitable_path()
Change-Id: I3a95880618218da00991f8ac58dee54d06a0da41
Diffstat (limited to 'lorrycontroller')
-rw-r--r-- | lorrycontroller/gitlab.py | 12 |
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) |