]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build.py: Correctly strip .git suffix.
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Tue, 26 Aug 2014 12:26:31 +0000 (14:26 +0200)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Tue, 26 Aug 2014 12:26:31 +0000 (14:26 +0200)
debian_build.py

index 9cca836d3042ef45805f2b6b6d372f197a6ddcc5..5c7eb0894a6d04a286aee7b1cfb1ed1ba5099831 100755 (executable)
@@ -236,9 +236,9 @@ def main():
             else:
                 gitrepo.remotes[name].update({git_type: url})
         #    this would also be helpful, but is not yet included in git lib
-        repo_name = gitrepo.remotes['origin']['fetch'].split('/')[-1].strip('.git')
+        repo_name = re.sub('\.git$', '', gitrepo.remotes['origin']['fetch'].split('/')[-1])
     else:
-        repo_name = gitrepo.remotes.origin.url.split('/')[-1].strip('.git')
+        repo_name = re.sub('\.git$', '', gitrepo.remotes['origin'].url.split('/')[-1])
     logger.info('Remotes: %s' % gitrepo.remotes)
     logger.info('Repository Name: %s' % repo_name)