zenoss/zenoss-prodbin — pull request #430 by jafcrocker (2014-09-29 15:02:19+00:00)
Title: Fix various bugs on daemons page

2. The DeployedApp object was cached for the lifetime of the app. This had several negative consequences, listed below. In order to fix this, we now only cache the RunState of the Deployed App. We also query the instance data only the first time it is accessed.
1. The service was never updated. This meant that properties that depend on the server (name, description, etc.) would not update if changed. Also, because the zookeeper version is part of the object, any attempt (except the first) to set the properties on the service would fail, making it impossible to start, stop, or set the autostart property.
2. At https://github.com/zenoss/zenoss-prodbin/compare/feature/ZEN-14578?expand=1#diff-69a707d99c764e21b58c948a1f52b19aL113 the instance was only updated if it was None. This meant that once the instance was set, it was never updated. It also meant that if the service was not running, every reference of DeployedApp.state would hit the serviced server.

1. RunStates was initialized in STOPPED mode. It is now initialized in an indeterminate state, until the state is determined. In order to more accurately reflect the state, we use the ServiceStatus query instead of the ServiceInstance query, since serviceStatus returns more states that just up/down.

4. Replaced client calls to updateService with the less expensive start/stopService calls

3. Fixed two calls to _updateState() a routine which had been renamed to updateInstance