/srv/irclogs.ubuntu.com/2020/08/31/#smooth-operator.txt

stubbthomas: The pgsql interface is no longer in my playpen and 1.0.0 can be found at https://github.com/canonical/ops-lib-pgsql .09:54
bthomasthanks stub : the problem I was facing was I had not setup my global git config to work with launchpad. Chipaca noticed that and helped me fix the issue. Will have a look at ops-lib-pgsql.09:56
stubThe updated version means you don't need that ;)09:56
stubFunctionally it is the same09:57
stub(so far)09:57
mupIssue operator#395 opened: juju-info not supported <Created by stub42> <https://github.com/canonical/operator/issues/395>10:39
facubatista¡Muy buenos días a todos!11:12
facubatistajam, I have a juju question, to see if something is possible... let's say I have two units, one with Apache and other with my charm, the human operator relates both, so I get a 'relation-changed' event12:25
facubatistawhen handling that event, I do `event.relation.data[self.unit]['ports'] = '80'`, so I'm configuring Apache to work on the port 80, for example12:25
facubatistabut let's say that in the future my charm's config changes, and I want to tell Apache to listen in a different port... can I do that? how? because at that moment I don't have "the event from the Apache unit" to write into...12:26
jamfacubatista: but you have 'config-changed' as the event13:33
jamand you can do13:33
jamself.model.get_relation('apache').data[self.unit]['ports'] = '80'13:33
jamor better:13:33
jamfor relation in self.model.relations['apache']:13:33
jam  relation.data[self.unit]['ports'] = '80'13:34
jamAnd that will trigger relation-changed on Apache13:34
jamthe loop and/or relation = self.model.get_relation(); if relation is not None:13:34
jamwould let you do the check to see if you actually are related to apache when you get config-changed13:34
facubatistajam, ah, getting the relations through `self.model.relation` is what we were not finding how to do with davigar15_ , thanks!!!13:52
jamnp13:52
=== Dmitrii-Sh1 is now known as Dmitrii-Sh

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!