backport reboot tool to 1.21
Merge pull request #1075 from mjs/1382751-prevent-non-subordinate-container-scoped-relations

1382751 prevent non subordinate container scoped relations

This fixes LP #1382751.

Container scoped relations are now only allowed if there's exactly one subordinate service involved. This prevents conditions that should never have been allowed. The Uniter errors and exits when it encounters relations without a subordinate service on one side.

InferEndpoints now ignores container relations unless there's exactly one subordinate service involved.
Remove the new backups CLI.

While the rest of the backups implementation is complete, a key
component (restore) has not landed in time for 1.21.  The existing
restore plugin *should* work with the new backups code, but that has
not been tested at all.  Regardless, it doesn't make a lot of sense
to mix the old and new backups in that way.

Consequently we are effectively disabling the new backups capability
in 1.21.  Completely excising the new backups implementation would
introduce too much risk.  Removing just the CLI portion is sufficient
to effectively eliminate exposing the new backups implementation to
users.  The new API facade is still in place and the various packages
are still there in the code, but that is not likely to be an issue.

This code will remain in the master branch (for 1.22 and forward).
Only *unregistering* the backups CLI is necessary.
Merge pull request #1082 from ericsnowcurrently/1.21-excise-backups

Remove the new backups CLI.

While the rest of the backups implementation is complete, a key
component (restore) has not landed in time for 1.21.  The existing
restore plugin *should* work with the new backups code, but that has
not been tested at all.  Regardless, it doesn't make a lot of sense
to mix the old and new backups in that way.

Consequently we are effectively disabling the new backups capability
in 1.21.  Completely excising the new backups implementation would
introduce too much risk.  Removing just the CLI portion is sufficient
to effectively eliminate exposing the new backups implementation to
users.  The new API facade is still in place and the various packages
are still there in the code, but that is not likely to be an issue.

This code will remain in the master branch (for 1.22 and forward).
merge PR 1048
fixes to make stuff compile
fix merge error
Merge pull request #1083 from natefinch/merge-1048

Merge 1048

This merges PR #1048, which is a prerequisite for merging PR #1075 which is needed for 1.21.  The merge for 1075 will come after this one.
Merge pull request #1077 from wallyworld/backport-subordinate-relation-fix

Merge pull request #1075 from mjs/1382751-prevent-non-subordinate-contai...

...ner-scoped-relations

1382751 prevent non subordinate container scoped relations

This fixes LP #1382751.

Container scoped relations are now only allowed if there's exactly one subordinate service involved. This prevents conditions that should never have been allowed. The Uniter errors and exits when it encounters relations without a subordinate service on one side.

InferEndpoints now ignores container relations unless there's exactly one subordinate service involved.
Increment juju to 1.21-beta2
Merge pull request #1089 from sinzui/inc-1.21-beta2

Increment juju to 1.21-beta2

Increment 1.21 branch so that new revs can be tested.
Merge pull request #1090 from wallyworld/unit-public-address-ec2

Unit public address ec2

Fixes: https://bugs.launchpad.net/bugs/1308374

The EC2 provider waits for the instance to advertise its DNS name, and when it does, it inserts this as a public address against the machine.
The unit's get public address method looks at the slice of machine addresses recorded and picks the first public one. If the DNS name is available before the first public IP address is recorded, this will be printed as the public address. So you sometimes get an IP address, sometimes a DNS name.

People want to get just IP addresses for unit's public/private addresses. So the EC2 provider recording of DNS name has been removed. This means that the juju status dns-name value will show an ip address, but that's what happens for HP Cloud and some other providers anyway, and we also want to get rid of dns-name.

Also a drive by fix for a go vet issue.
Merge pull request #1091 from wallyworld/unit-public-address-ec2-1.21

Merge pull request #1090 from wallyworld/unit-public-address-ec2

Unit public address ec2

Fixes: https://bugs.launchpad.net/bugs/1308374

The EC2 provider waits for the instance to advertise its DNS name, and when it does, it inserts this as a public address against the machine.
The unit's get public address method looks at the slice of machine addresses recorded and picks the first public one. If the DNS name is available before the first public IP address is recorded, this will be printed as the public address. So you sometimes get an IP address, sometimes a DNS name.

People want to get just IP addresses for unit's public/private addresses. So the EC2 provider recording of DNS name has been removed. This means that the juju status dns-name value will show an ip address, but that's what happens for HP Cloud and some other providers anyway, and we also want to get rid of dns-name.

Also a drive by fix for a go vet issue.
Merge pull request #1095 from voidspace/maas-1381619

Ignore conflict error when releasing maas nodes

When releasing a node that is not in a releasable status, i.e. typically is already released, maas returns an error 409. Instead of dying and refusing to destroy environment we now ignore that error.

Error 409 is only used for a limited set of statuses, so this seems like safe behaviour. See: https://bugs.launchpad.net/maas/+bug/1381619/comments/15

Fixes bug 1381619.
Merge pull request #1093 from dimitern/lp-1359714-juju-machine-id-for-charms

Fixed lp:1359714: JUJU_MACHINE_ID added to hook context

JUJU_MACHINE_ID is now available to charm hooks. It contains
the unit's assigned machine ID.
Merge pull request #1121 from wallyworld/backport-lp-1359714

Merge pull request #1093 from dimitern/lp-1359714-juju-machine-id-for-charms

Fixed lp:1359714: JUJU_MACHINE_ID added to hook context

JUJU_MACHINE_ID is now available to charm hooks. It contains
the unit's assigned machine ID.
Merge pull request #1078 from dimitern/lp-1307677

Fixed #1307677: Local provider network-bridge default respects container type

If "network-bridge" is not specified in environments.yaml for
a local environment, but "container" is explicitly given, this
PR changes the local provider to choose the correct default
network bridge name ("lxcbr0" or "virbr0").

Live tested.
Merge pull request #1094 from dimitern/lp-1382709-openstack-instance-shutoff-not-respected

Fixed lp:1382709: openstack provider now returns SHUTOFF and SUSPENDED instances as well

This fixes http://pad.lv/1382709. When an OpenStack instance
managed by Juju is manually stopped or suspended, its state
changes to SHUTOFF or SUSPENDED, respectively. Because the
openstack provider does not return details for instances
with states other than ACTIVE, BUILD, or BUILD(spawning),
the instance updater worker will fail to retrieve the status
of a manually stopped or suspended instance (there is a warning
in the log instead, which is misleading, as it says "unknown
instance id").

With this patch, instance updater will properly refresh the status
of such instances, after the LongPoll interval (15m) since the last
check has passed. Environ.Instances() for openstack will return
also instances with SHUTOFF or SUSPENDED state.

A quick drive-by fix was done for an annoying log spam at DEBUG
level about floating IP assigned to an instance.
Merge pull request #1122 from wallyworld/backport-lp-1307677

Merge pull request #1078 from dimitern/lp-1307677

Fixed #1307677: Local provider network-bridge default respects container type

If "network-bridge" is not specified in environments.yaml for
a local environment, but "container" is explicitly given, this
PR changes the local provider to choose the correct default
network bridge name ("lxcbr0" or "virbr0").

Live tested.