Activity log for bug #1436886

Date Who What changed Old value New value Message
2015-03-26 15:11:35 JuanJo Ciarlante bug added bug
2015-03-26 15:14:52 JuanJo Ciarlante 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: * FAIL: self.deployment.configure('myservice', {'port': '12345'}) self.unit = self.deployment.sentry['myservice/0'] # using cls.deployment from setUp() classmethod ports = self.unit.info['open-ports'] self.assertEqual(ports, ['12345/tcp']) ## <- FAILs, ports still from config.yaml default * 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'] self.assertEqual(ports, ['12345/tcp']) ## Ok 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(). 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().