[11:13] ¡Muy buenos días a todos! [11:54] 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 ? [12:01] 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:02] After deploying I still only have those created by charmbuild [12:21] 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:23] The charm log mentions that it is running the legacy install hook if that's relevant [12:26] Advantages of smooth-operator over reactive charms? Thanks [13:01] 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:02] That being the case, when I am in a debug-hooks session for update-status for example, what should I run ? [13:17] Looks like upgrading juju did the trick [13:28] Issue operator#362 opened: Block charm if Juju version is too low [15:02] gnuoy, hello! [15:03] 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:04] facubatista, ack. ooi in a debug-hooks session what do I run ? [15:04] If I'm trying to debug a charm issue [15:05] 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:06] facubatista, ah! ok thanks [15:06] gnuoy, sorry, JUJU_DISPATCH_PATH, not *HOOK [15:07] 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] 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:08] gnuoy, you can see all that here: https://discourse.juju.is/t/live-debugging-at-python-level/2914 [15:08] * facubatista brb [15:08] that looks great facubatista, thanks [15:18] Issue operator#362 closed: Block charm if Juju version is too low [20:34] 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] https://paste.ubuntu.com/p/gqnJXgvGyK/ [20:35] 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:37] 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] but "begin" is an attribute of harness and that executes fine [20:49] there is a nefarious print statement in there. ignore that^^ [21:15] jesseleo, sorry, I'm eod, but will take a look at this on Monday [21:18] no worries, enjoy your weekend [21:18] facubatista