facubatista | ¡Muy buenos días a todos! | 11:13 |
---|---|---|
gnuoy | Hi, I'm converting a charm over to use charmcraft to build it and somewhere along the way I've lost a number of hooks files from the hooks dir. Should charmcraft fully populate the hooks dir at build time or are they supposed to be automagically created at deploy time ? | 11:54 |
gnuoy | I seem mention in charmcraft that a handle of hooks are created for old juju version, so I assume the full set are supposed to appear at deploy time ? | 12:01 |
gnuoy | After deploying I still only have those created by charmbuild | 12:02 |
gnuoy | I see https://github.com/canonical/operator/issues/257 talks about the hook files being missing if the install hook fails but from what I can tell the install hook ran fine. | 12:21 |
gnuoy | The charm log mentions that it is running the legacy install hook if that's relevant | 12:23 |
studentz | Advantages of smooth-operator over reactive charms? Thanks | 12:26 |
gnuoy | ok, so my charm is dispatch aware, which appears to mean no symlinks for me https://github.com/canonical/operator/blob/master/ops/main.py#L178 | 13:01 |
gnuoy | That being the case, when I am in a debug-hooks session for update-status for example, what should I run ? | 13:02 |
gnuoy | Looks like upgrading juju did the trick | 13:17 |
mup | Issue operator#362 opened: Block charm if Juju version is too low <Created by gnuoy> <https://github.com/canonical/operator/issues/362> | 13:28 |
facubatista | gnuoy, hello! | 15:02 |
facubatista | gnuoy, if you don't have any special needs, you can just avoid having a hooks directory: charmcraft will create a "dispatch" script (for new jujus) and a hooks directory with a couple of basic hooks (for older jujus), and the operator framework will do the rest | 15:03 |
gnuoy | facubatista, ack. ooi in a debug-hooks session what do I run ? | 15:04 |
gnuoy | If I'm trying to debug a charm issue | 15:04 |
facubatista | gnuoy, you can call the dispatch script setting the JUJU_DISPATCH_HOOK env... but you may want to use debug-code, which lets you debug directly inside the charm code | 15:05 |
gnuoy | facubatista, ah! ok thanks | 15:06 |
facubatista | gnuoy, sorry, JUJU_DISPATCH_PATH, not *HOOK | 15:06 |
facubatista | gnuoy, with debug-code you can tell it to debug a specific hook (and will leave you with a PDB session inside the running charm, at the beginning of your hook execution) | 15:07 |
facubatista | gnuoy, or you may even add breakpoints() inside the code (that will make the code interrupt ONLY if you're in a debug session) | 15:07 |
facubatista | gnuoy, you can see all that here: https://discourse.juju.is/t/live-debugging-at-python-level/2914 | 15:08 |
* facubatista brb | 15:08 | |
gnuoy | that looks great facubatista, thanks | 15:08 |
mup | Issue operator#362 closed: Block charm if Juju version is too low <Created by gnuoy> <Closed by gnuoy> <https://github.com/canonical/operator/issues/362> | 15:18 |
jesseleo | Hey guys I'm trying to test the install of my charm, but I'm having trouble adding the resource in the test harness | 20:34 |
jesseleo | https://paste.ubuntu.com/p/gqnJXgvGyK/ | 20:34 |
jesseleo | I see that add resource function was a recent addition so I'm installing ops repo from master because `add_resource` doesn't show up when you pip install ops | 20:35 |
jesseleo | I'm just not really sure what I'm doing wrong because it says that `add_resource` isn't an attribute of Harness | 20:37 |
jesseleo | but "begin" is an attribute of harness and that executes fine | 20:37 |
jesseleo | there is a nefarious print statement in there. ignore that^^ | 20:49 |
facubatista | jesseleo, sorry, I'm eod, but will take a look at this on Monday | 21:15 |
jesseleo | no worries, enjoy your weekend | 21:18 |
jesseleo | facubatista | 21:18 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!