state: don't issue $set/$unset with empty set

Mongo 2.6 complains if you attempt to perform
a $set or $unset operation with an empty set.
If the set is dynamic, we must be careful to
only issue the operation if non-empty.
Remove the old HTTP-based API server endpoint for backups.
Also remove BackupResponse from state/api/params.
Fixed lp:1353443 - no modprobe in lxc containers
Refactor to use bson.M, utility function
Include export_test in the fun.
Cleaned up manual provider float storage port test

Avoid copying an existing test and just extend the existing one
that tests the same scenario.
Revert PR 449

PR 449 by @voidspace breaks CI, restore is using StatePort
so all restore related tests break.
Reverting until we find a solution so it does not block
CI
Merge pull request #473 from wallyworld/maas-hostname-address

MAAS provider uses hostname as cloud local address

The MAAS provider inserts a cloud local address equal to the dns name into the list of addresses returned by the instance.

Fixes: https://bugs.launchpad.net/juju-core/+bug/1353442
Merge pull request #503 from perrito666/revert_PR_449

Revert PR 449

PR 449 by @voidspace breaks CI, restore is using StatePort
so all restore related tests break.
Reverting until we find a solution so it does not block
CI
this fixes-1355324
Merge pull request #502 from mjs/float-storage-port-test

Cleaned up manual provider float storage port test

Avoid copying an existing test and just extend the existing one that tests the same scenario instead.
provider/manual: don't verify bootstrap-host from inside env

StateServerInstances was attempting to verify the bootstrap
host by SSHing to itself; this fails if it does not have
authorized_keys set up appropriately. We use use-sshstorage
to detect whether we're inside the bootstrap host, and then
elide the verification if so.
provider/manual: test that Bootstrap sets use-sshstorage=false
environs/manual: revert error annotation

Leave the error alone, just log an error message.
Merge pull request #504 from axw/lp1347715-manual-stateserverinstances-noverifyinenv

provider/manual: don't verify bootstrap-host from inside env

StateServerInstances was attempting to verify the bootstrap
host by SSHing to itself; this fails if it does not have
authorized_keys set up appropriately. We use use-sshstorage
to detect whether we're inside the bootstrap host, and then
elide the verification if so.

Fixes https://bugs.launchpad.net/juju-core/+bug/1347715
Only set Safe.{J,WMode} in production

As of Mongo 2.6, attempting to set Safe.J
fails if journaling is disabled in mongod.
Similarly, WMode=majority will cause problems
if a replicaset is not configured. We need
to only set these in production, where those
conditions are guaranteed to be true.
Merge pull request #488 from axw/state-nosetunsetempty

state: don't issue $set/$unset with empty set

Mongo 2.6 complains if you attempt to perform
a $set or $unset operation with an empty set.
If the set is dynamic, we must be careful to
only issue the operation if non-empty.
Merge pull request #487 from axw/mongo-postdial-setsafe

Only set Safe.{J,WMode} in production

As of Mongo 2.6, attempting to set Safe.J
fails if journaling is disabled in mongod.
Similarly, WMode=majority will cause problems
if a replicaset is not configured. We need
to only set these in production, where those
conditions are guaranteed to be true.
Merge pull request #482 from ericsnowcurrently/backups-remove-old-apiserver

Remove the old HTTP-based API server endpoint for backups.

The POST-based API has been rejected.

I'd also like to backport this change to 1.20.  The API endpoint for backups is "experimental" there and it would be good to have the POST-based version removed before 1.20 makes it into trusty.  Backporting the new backups implementation to 1.20 isn't trivial (or small) so simply removing it from 1.20 makes more sense to me.
Merge pull request #491 from dimitern/lp-1353443-dont-modprobe-in-lxc

Fixed lp:1353443 - no modprobe in lxc containers

Since the introduction of the networker, in some cases we
might encounter a Permission denied error when trying to
run "modprobe 8021q" (i.e. load the driver for VLAN support).
This happens only when the worker is running inside an LXC
container. With this fix, this doesn't happen anymore.