Consistently handle remote repository creation failures

Failure to create remote repository was handled inconsistently in the
three existing AdminApi implementations. This issue was present in the
code even before the refactoring done in
Ie760bf3e143b1d143b6e81ac6cfa816ef1f8d016. For example, creation of
remote repository over SSH [1] didn't return a status back to the
caller, while the Gerrit+SSH implementation [2] did return a boolean
flag which was afterwards ignored by the caller [3].

Not handling remote repository creation failures had an ugly effect:
we log the "Missing repository created; ..." [4], even if the repository
creation failed.

Let all three implementations of the AdminApi return a flag indicating
the success/failure and make sure to handle it properly.

Further, remove some redundant and potentially confusing parts of the
log messages as they assume that failure to create missing repository
can only be caused by using wrong protocol.

[1] https://gerrit.googlesource.com/plugins/replication/+/d557ccc642c59a55750f560ce0d98870e1550d65/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java#290
[2] https://gerrit.googlesource.com/plugins/replication/+/d557ccc642c59a55750f560ce0d98870e1550d65/src/main/java/com/googlesource/gerrit/plugins/replication/GerritSshApi.java#43
[3] https://gerrit.googlesource.com/plugins/replication/+/d557ccc642c59a55750f560ce0d98870e1550d65/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java#259
[4] https://gerrit.googlesource.com/plugins/replication/+/092792edacf9c29732a560a30967b92664cd65f9/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java#400

Change-Id: I6566f867138ab73c81ff7a67630772c3734e501b
(cherry picked from commit b95d921d6db891dc724f619d957ab35e634f7e44)
6 files changed
tree: 2ab0d3f2a9bf264e892c1b8295724aed26ae1285
  1. .settings/
  2. src/
  3. .gitignore
  4. .mailmap
  5. BUILD
  6. LICENSE