Fixed lp:1397376 - Backported to 1.21
Merge pull request #1324 from dimitern/lp-1397376-backport-to-1.21

Fixed lp:1397376 - Backported to 1.21

Backport of #1297 to fix http://pad.lv/1397376 for 1.21.
No changes other than adapting the code for 1.21, except
for upgrading juju/testing version used to the latest, so
JSONEquals and YAMLEquals checkers can be used.

Live tested on EC2, Canonistack, Local, MAAS.

(Review request: http://reviews.vapour.ws/r/643/)
mongo: check all addresses when deciding if machine is master

The recent fix for LP #1397376 meant that on MAAS the replicaset
master address no longer matches the address returned by
SelectPeerAddress - no state server thought it was the master. This
breaks upgrades among other things.

All machine addresses are no compared against the replicaset master
address.

Fixes LP #1403200.
Merge pull request #1328 from mjs/1403200-maas-upgrades-1.21

mongo: check all addresses when deciding if machine is master

The recent fix for LP #1397376 meant that on MAAS the replicaset master address no longer matches the address returned by SelectPeerAddress - no state server thought it was the master. This breaks upgrades among other things.

All machine addresses are no compared against the replicaset master address.

Fixes LP #1403200.

(Review request: http://reviews.vapour.ws/r/647/)
cmd/jujud: fixed patch race in upgrade tests (backport to 1.21)

The patch to the attempt strategy used during upgrades was done just
/after/ the upgrade worker had already been started so there was a
race. The worker was occasionally getting the real attempt strategy
instead of the test one, causing long test runs and unexpected numbers
of retries.

The patch is now made before starting the worker.

Fixes LP #1389389.
Merge pull request #1330 from mjs/1389389-TestUpgradeStepsFailure-intermittent-failure-1.21

cmd/jujud: fixed patch race in upgrade tests (backport to 1.21)

The patch to the attempt strategy used during upgrades was done just /after/ the upgrade worker had already been started so there was a race. The worker was occasionally getting the real attempt strategy instead of the test one, causing long test runs and unexpected numbers of retries.

The patch is now made before starting the worker.

Fixes LP #1389389.

(Review request: http://reviews.vapour.ws/r/649/)