jammorning all04:05
MarkMaglanajam: wazaaaaaaap05:13
MarkMaglanawe're in the middle of the WTF part of the week! hang in there!05:14
MarkMaglanaWell, technically the WThF part of the week but every keystroke counts.05:14
Chipacamoin moin08:14
Chipacajam: any chance of a review of charmcraft#23 so we can put out a fix?08:19
mupPR charmcraft#23: build: set JUJU_DISPATCH_PATH so we get the right hook <Created by chipaca> <https://github.com/canonical/charmcraft/pull/23>08:19
jamChipaca, to make sure I understand the bash magic, "JUJU_DISPATH_PATH=${{JUJU_DISPATCH_PATH:-$0}}" sets the env var to argv[0] if it isn't set, and then double {{ is because it is in a python format template, right?08:20
jamChipaca, Approve as long as I understand that correctly08:21
Chipacajam: yep, that's all correct08:21
* Chipaca resurrecting a borked juju08:35
Chipacajam: charmcraft#25 could use a rubber stamp08:41
mupPR charmcraft#25: bump version for 0.1.1 <Created by chipaca> <https://github.com/canonical/charmcraft/pull/25>08:41
Chipacai'll land that with just that +1 and release it into the wild08:42
Chipaca0.1.1 bites me again08:48
Chipacajam: same for charmcraft#26 :-(08:53
mupPR charmcraft#26: bump version for 0.1.2 <Created by chipaca> <https://github.com/canonical/charmcraft/pull/26>08:53
jamChipaca, I refuse. too much stamping... :)08:53
=== ChanServ changed the topic of #smooth-operator to: general discussion of the operator framework || github.com/canonical/operator || ops 0.6.1 || charmcraft 0.1.2
mupPR operator#322 opened: log: set up sys.excepthook to log exceptions <Created by chipaca> <https://github.com/canonical/operator/pull/322>10:28
jamChipaca, do you have a preference for new dates at the start/end of the doc? I actually prefer the newest to be the beginning of the doc, but I know you found it confusing w Tom10:51
Chipacajam: I prefer if we choose one and stick to it. I don't mind which :)10:51
Chipacainserting it from the top works for me (it's what we do in the standup doc for ex)10:52
Chipacajam: i'm not sure why i got confused yesterday10:52
Chipacai've got my suspicions though :)10:52
jamChipaca, one thing that I find helps a lot is to put a Page Break between sections, as it makes it less 'run on'10:53
FacuMuy buenos días a todos!10:56
jammorning Facu10:57
jamChipaca, so i've run into something interesting with YAML.10:57
jamnamely "yaml.dump({'a': (1,2)})" writes the document as "a: !!python/tuple [1,2]"10:58
jamwhich round-trips if you then call 'yaml.load'10:58
jambut *not* if you call yaml.safe_load10:58
jamand, in fact, it fails with:10:58
jamyaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple'10:58
jam  in "<byte string>", line 5, column 6:10:58
jam    six: !!python/tuple [a, b]10:58
Chipacanow i wonder what 'safe' brings to the party in this context10:59
FacuChipaca, not running any code?11:00
Chipaca'The function yaml.safe_load limits this ability to simple Python objects like integers or lists.'11:02
Chipaca… but not tuples?11:02
Chipacajam: so apparently the recommendation is to subclass the safe loader and add constructors for the non-standard bits we want11:17
jamChipaca, yeah, that is what I was looking at doing11:17
jamI think anything that is "!!python/" it doesn't allow by default, which is why I'll add it.11:18
jamI'm just a bit surprised that tuple isn't considered safe but "set" was11:18
Chipacajam: apparently !!set is a standard yaml thing11:18
Chipacawhich i didn't know :)11:18
Chipacai mean, that's what https://pyyaml.org/wiki/PyYAMLDocumentation says11:18
Chipacaafaict the only thing there we need is tuple, and arguably complex11:19
Chipacaah i guess none also11:19
Chipacabut that probable goes to null11:19
* Chipaca tries11:19
jamNone => null by default, yeah.11:21
jamChipaca, where do you see the bit about inheriting? The thing I see is "your types can add a property yaml_loader to SafeLoader"11:25
jamwhich I don't think I can do to tuple()11:25
jamoddly, they mention using safe_dump() to ensure you don't dump classes, etc. But 'safe_dump' still puts !!python/tuple which safe_load doesn't support11:26
jamah, it actually doesn't. nm11:26
jamChipaca, https://stackoverflow.com/questions/9169025/how-can-i-add-a-python-tuple-to-a-yaml-file-using-pyyaml11:29
Chipacajam: or https://stackoverflow.com/questions/33048540/pyyaml-safe-load-how-to-ignore-local-tags :)11:29
Chipacasorry was afk directing lunch prep here11:30
Chipacayaml.CSafeLoader.yaml_constructors['tag:yaml.org,2002:python/tuple'] = yaml.Loader.yaml_constructors['tag:yaml.org,2002:python/tuple']11:40
Chipacaprobably not the right thing :-D11:41
Chipacabut otoh can't see why not11:43
Chipacaalso note set(yaml.Dumper.yaml_representers) - set(yaml.SafeDumper.yaml_representers)11:46
Chipacabut, yaml.SafeDumper.yaml_representers[tuple] is represent_list11:47
FacuChipaca, jam, where are we yaml-dumping tuples?11:50
ChipacaFacu: looking at replacing base64+pickle with something more human-friendly11:50
ChipacaFacu: for the fix to #31711:51
mupIssue #317: use charm state for Juju 2.8 <Created by jetpackdanger> <https://github.com/canonical/operator/issues/317>11:51
FacuChipaca, WAT, you can not read pickle? :p11:51
ChipacaFacu: obvs i can, but we have human users also11:52
FacuChipaca, humans! always complicating stuff11:52
jamChipaca, Facu also if we're happy with pickle we could just 'load()' but I'd like to be safer than raw pickle11:54
Chipacajam: it's fine, the brine keeps things safe11:54
* Facu hides11:54
* Chipaca writes a CHIPACAL spec11:55
* Chipaca stops11:55
FacuChipaca, jam, what is a good message for the signature deprecation?11:56
ChipacaFacu: "LOL look at you, passing in 'key'! That's *so* last release!"11:57
* Chipaca suspects that would actually work11:57
Facu"CharmBase signature's second argument is deprecated, will be removed in 0.3.0, just use 'framework'"11:57
jamFacu, "key argument has been deprecated and will no longer be supplied in future versions"11:57
Chipacanot 0.311:58
FacuI like the "future versions" and not be explicit, in case we want to delay the removal later11:58
Facujam, "key...", not "the key..."?11:58
Chipacaok, 'after 0.7'11:58
Facu"the 'key' argument has been deprecated and will be removed after 0.7 version"?11:59
jamFacu, I like your "second argument"11:59
Chipacamight be a minute late, somebody's at the door12:00
Facu"the 'key' second argument has been deprecated and will be removed after 0.7 version"?12:00
ChipacaFacu: "the second argument, 'key', has been deprecated and will be removed after the 0.7 release"12:03
jamChipaca, today's xkcd is pretty good: https://xkcd.com/2315/12:48
jamheat-death of the universe guarantee's my database's eventual consistency12:49
* Facu brb12:50
* Chipaca pokes at the network again12:52
mupPR operator#323 opened: 317 state get <Created by jameinel> <https://github.com/canonical/operator/pull/323>13:15
=== facundo__ is now known as facubatista
* facubatista -> errands14:40
* facubatista is back15:42
Chipacatalking with people15:53
Chipacawhy do we even15:53
Chipacajam, facubatista, both of you have +1'ed one, but not both, of the CoC PRs :-)16:00
jamChipaca, we like to keep you guessing16:00
Chipacajam: ooh, ooh, is it bigger than a breadbox?16:01
Chipacais this breadbox container-sized?16:02
Chipacaor is it a breadbox as in the thing used for playing around with electronics16:02
facubatistaChipaca, will get to it in ~20'16:04
mupIssue operator#308 closed: have a code of conduct <Created by chipaca> <Closed by facundobatista> <https://github.com/canonical/operator/issues/308>16:29
mupPR operator#321 closed: have a Code of Conduct <Created by chipaca> <Merged by facundobatista> <https://github.com/canonical/operator/pull/321>16:29
Chipacafacubatista: suddenly feeling the urge to make 'python3 -m ops src/charm.py MyCharm' work, for some reason16:31
facubatistaChipaca, what for? ops is a lib, not an utility16:32
facubatistamaking it "half utility" will bring a lot of little rough corners16:32
Chipacafacubatista: because if all 'if __name__ == "__main__"' bits of charms look the same, why have them?16:32
Chipacafacubatista: I'm not going to be acting on this urge FWIW :) at least not this time16:33
facubatistaChipaca, oh, which reminds me! I wanted to talk about CharmBase init, let's talk on Monday about that16:33
Chipacafacubatista: is that the same as charmcraft init16:33
* Chipaca hids16:33
* Chipaca hides, also16:34
facubatistano, no16:34
* facubatista laves suspense grow16:34
* Chipaca makes 'charmcraft innit' be an alias16:34
* Chipaca EODs17:01
Chipacawell, mostly17:02
davigar15I'm getting that error in a relation17:45
davigar15Any ideas?17:45
davigar15That's the function is falling in: https://pastebin.canonical.com/p/Q6RCDf4pcK/17:47
davigar15In the relation-set hook, I suppose17:47
davigar15app_data = self._relation.data[self.model.app]17:48
davigar15app_data['port'] = str(port)17:48
davigar15But I think that's correct ^17:48
facubatistadavigar15, let me see17:50
facubatistauh, juju is crashing17:51
facubatistadavigar15, please print (with repr()) the values for port, rest_port and host17:51
davigar15application-zk3: 20:00:19 INFO unit.zk3/0.juju-log zookeeper:7: IPv4Address('')18:00
davigar15There you go. IPv4Address18:00
davigar15maybe str(host) right?18:01
Facuah, you're doing a str() of it18:01
davigar15nope, not in the host18:01
Facudavigar15, that IPv4Address is "host"?18:01
davigar15only in the ports18:01
Facuright, that will not travel through the relation18:02
davigar15Juju was telling me that values must be strings, not integers18:02
Facujam, Chipaca, I wonder if we should detect this ^ *before reaching Juju*18:02
davigar15so I put str in ports18:02
davigar15If I put a number it tells you exactly what's the problem18:02
Facujam, please when you're back check if you find why juju is crashing on davigar15, thanks!18:36
jamdavigar15, I don't know the immediate reason why, can you give the Juju version you're running?18:47
jamnil-pointer panic is definitely a Juju bug18:47
jamthere may be other things that could go wrong, but we should never panic18:47
jamdavigar15, please add details to: https://bugs.launchpad.net/juju/+bug/188212718:49
Facujam, I told him to run the commands by hand (after the proper `juju debug-hooks`) but it looks he can't because of k8s18:56
Facujam, thanks for the help!18:57
davigar152.7.6 juju version19:05
davigar15I’ll give the details tomorrow19:05
davigar15Jam: you were fast!! I see you already updated the bug19:14
Facujam, do we have a simple example on how to start with the Harness?20:30
FacuChipaca, ^20:30
ChipacaFacu: in the README?21:10

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