Merge lp:~cjwatson/launchpad/codeimport-git-worker-fixes into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18241
Proposed branch: lp:~cjwatson/launchpad/codeimport-git-worker-fixes
Merge into: lp:launchpad
Prerequisite: lp:~cjwatson/launchpad/codeimport-git-webservice
Diff against target: 39 lines (+6/-3)
1 file modified
lib/lp/codehosting/codeimport/worker.py (+6/-3)
To merge this branch: bzr merge lp:~cjwatson/launchpad/codeimport-git-worker-fixes
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+308540@code.launchpad.net

Commit message

Miscellaneous tweaks to the Git-to-Git import worker, mainly logging.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/codehosting/codeimport/worker.py'
2--- lib/lp/codehosting/codeimport/worker.py 2016-10-12 15:30:09 +0000
3+++ lib/lp/codehosting/codeimport/worker.py 2016-10-14 16:53:56 +0000
4@@ -1002,7 +1002,6 @@
5
6 def _doImport(self):
7 self._logger.info("Starting job.")
8- self._logger.info(config.codehosting.git_browse_root)
9 try:
10 self._opener_policy.checkOneURL(self.source_details.url)
11 except BadUrl as e:
12@@ -1014,6 +1013,8 @@
13 if split.hostname:
14 target_netloc = ":%s@%s" % (
15 self.source_details.macaroon.serialize(), split.hostname)
16+ if split.port:
17+ target_netloc += ":%s" % split.port
18 else:
19 target_netloc = ""
20 target_url = urlunsplit([
21@@ -1027,7 +1028,7 @@
22 except subprocess.CalledProcessError as e:
23 self._logger.info(
24 "Unable to get existing repository from hosting service: "
25- "%s" % e)
26+ "git clone exited %s" % e.returncode)
27 return CodeImportWorkerExitCode.FAILURE
28 self._logger.info("Fetching remote repository.")
29 try:
30@@ -1049,6 +1050,8 @@
31 try:
32 self._runGit("push", "--mirror", target_url, cwd="repository")
33 except subprocess.CalledProcessError as e:
34- self._logger.info("Unable to push to hosting service: %s" % e)
35+ self._logger.info(
36+ "Unable to push to hosting service: git push exited %s" %
37+ e.returncode)
38 return CodeImportWorkerExitCode.FAILURE
39 return CodeImportWorkerExitCode.SUCCESS