juju/juju — pull request #214 by mjs (2014-07-02 04:21:57+00:00)
Title: WIP: POC for a restricted client API during upgrades

This is a little rough (with no tests) and is not intended for merging as-is. This demonstrates how the API available to clients can be restricted during upgrades.

With this change in place, most API calls made by clients will fail with an "upgrade in progress" error. A select few API calls used by commands for monitoring will still function. For example:

```
# During upgrade...
$ juju status
environment: local
machines:
"0":
agent-state: started
agent-version: 1.19.5.3
dns-name: localhost
instance-id: localhost
series: trusty
state-server-member-status: has-vote
services: {}
$ juju deploy local:precise/dummy-source
ERROR upgrade in progress - method Client.EnvironmentGet is not available

# Time passes ... upgrade completes.
$ juju deploy local:precise/dummy-source
Added charm "local:precise/dummy-source-0" to the environment.
```