← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/codeimport-git-worker-fixes into lp:launchpad with lp:~cjwatson/launchpad/codeimport-git-webservice as a prerequisite.

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

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/codeimport-git-worker-fixes/+merge/308540
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/codeimport-git-worker-fixes into lp:launchpad.
=== modified file 'lib/lp/codehosting/codeimport/worker.py'
--- lib/lp/codehosting/codeimport/worker.py	2016-10-12 15:30:09 +0000
+++ lib/lp/codehosting/codeimport/worker.py	2016-10-14 16:53:56 +0000
@@ -1002,7 +1002,6 @@
 
     def _doImport(self):
         self._logger.info("Starting job.")
-        self._logger.info(config.codehosting.git_browse_root)
         try:
             self._opener_policy.checkOneURL(self.source_details.url)
         except BadUrl as e:
@@ -1014,6 +1013,8 @@
         if split.hostname:
             target_netloc = ":%s@%s" % (
                 self.source_details.macaroon.serialize(), split.hostname)
+            if split.port:
+                target_netloc += ":%s" % split.port
         else:
             target_netloc = ""
         target_url = urlunsplit([
@@ -1027,7 +1028,7 @@
         except subprocess.CalledProcessError as e:
             self._logger.info(
                 "Unable to get existing repository from hosting service: "
-                "%s" % e)
+                "git clone exited %s" % e.returncode)
             return CodeImportWorkerExitCode.FAILURE
         self._logger.info("Fetching remote repository.")
         try:
@@ -1049,6 +1050,8 @@
         try:
             self._runGit("push", "--mirror", target_url, cwd="repository")
         except subprocess.CalledProcessError as e:
-            self._logger.info("Unable to push to hosting service: %s" % e)
+            self._logger.info(
+                "Unable to push to hosting service: git push exited %s" %
+                e.returncode)
             return CodeImportWorkerExitCode.FAILURE
         return CodeImportWorkerExitCode.SUCCESS


Follow ups