This branch implements the ability to deploy the Juju GUI charm so that it is actually connected to the real Juju environment. This is done by starting the juju API agent pointing it to the Zookeeper address of the environment. That part is a translation into Python of what Kapil already did in the bash charm.
Other changes:
Changed README: now python-charmhelpers needs to be installed to run functional tests. python-shelltoolbox is installed as a dependency of python-charmhelpers.
Added a juju-api-port config option. The staging and real API agents use by default different ports. I decided to add an option so that the user can select the port where the websocket server will be listening. In a future branch we should let users customize the Juju GUI port too.
Added a staging boolean flag to the config options: by default is False (real env); users can set it to True to start the staging server.
Also added a staging-environment config option: if Juju staging is started, here the users can select what kind of environment to show up in the GUI.
Fixed start up configuration scripts: now upstart correctly keeps track of the process ids, and the services can be correctly stopped.
Added an upstart configuration template for the real API agent.
Added more functional tests, and implemented a workaround for bug 872264. I run the test suite in ec2 ~10 times without failures, setting the jitsu timeout to 40 minutes.
Note that rsync raises an error during the test process: rsync: link_stat "/var/lib/juju/units/*/charm.log" failed: No such file or directory. This is not an error of the tests, but a test runner failure while trying to retrieve the logs from a destroyed unit.