Comment 5 for bug 1704769

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

The interface code (currently at https://github.com/tytus-kurek/charm-interface-endpoint/blob/master/provides.py) probably ought to use the data_changed() helper to stop it attempting to set the same data over and over again (an unfortunate consequence of charms.reactive and how handlers are always run when true, regardless of the hook).

e.g.

    from charms.reactive.helpers import data_changed

    def expose_endpoint(self, endpoint):
        relation_info = {
            'endpoint': endpoint,
        }
        if data_changed('expose_endpoint', relation_info):
            self.set_local(**relation_info)
            self.set_remote(**relation_info)

It's also not clear why the local data is being set?