hookenv.unit_get should offer facility to detect changed values

Bug #1444062 reported by Chris Glass
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers

Bug Description

In a similar way that the Config object allows to check for changes in values by serializing them first, the unit_get() function should ideally provide such facility as well.

The case for this is changing public IP addresses, as described in https://lists.ubuntu.com/archives/juju/2014-December/004652.html

If the public IP address changes, the config-changed hook will be fired, but re-setting the IP address if it hasn't changed can have unwanted side-effects, and in order to avoid them, it would be nice to be able to have code like:

if unit_get().changed("public_ip"):
    do_something() # Forwarding the public IP to a client relation would be an obvious example.

Tags: landscape
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.