amulet doesn't provide a clean way to refresh unit info

Bug #1436886 reported by JuanJo Ciarlante
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Amulet
New
Undecided
Unassigned

Bug Description

If you reconfigure a service with e.g. a port change,
amulet doesn't reload/refresh unit_data, keeping its sentry
entries stale.

Example excerpts (charm code unchanged between both):

* FAIL:
self.deployment.configure('myservice', {'port': '12345'})

self.unit = self.deployment.sentry['myservice/0']
ports = self.unit.info['open-ports']
## below FAILs, as ports hold default values as already deployed
self.assertEqual(ports, ['12345/tcp'])

* OK (workaround'd):
self.deployment.configure('myservice', {'port': '12345'})

## Refresh units_data by re-creating sentry object
from amulet.sentry import Talisman
self.deployment.sentry.wait()
self.deployment.sentry = Talisman(self.deployment.services)

self.unit = self.deployment.sentry['myservice/0']
ports = self.unit.info['open-ports']
## Ok now:
self.assertEqual(ports, ['12345/tcp'])

Suggest making wait() to re-create sentry object (as
e.g. add-unit() does), or exposing a new method to do so,
e.g. deployment.refresh().

JuanJo Ciarlante (jjo)
description: updated
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.