[00:03] and drop the super deprecated modules part 2 https://github.com/canonical/cloud-init/pull/134 [00:03] ok EOD for me [08:32] blackboxsw, Hi I get error running clour-init query all command http://paste.openstack.org/show/787808/ [14:03] I have to work in such a different timezone, any of the maintainers here can help with the migrate-lp-user-to-github script? [14:03] smoser: blackboxsw perhaps are already up : [14:04] *I hate to work, I can't even blame the autocorrect, it's my mind that want's to leave on vacation already :-D [14:26] Ha! No worries smoser blackboxsw, I just figured out the problem I was having. That's my launchpad-github mapping https://github.com/canonical/cloud-init/pull/135 [14:27] Also, I run the script with --dryrun enabled but it ended up doing the whole proccess. Perhaps there's a bug there. :-) [14:41] blackboxsw: I'm seeing a bunch of automated "This bug is believed to be fixed in cloud-init in version 19.2-67" bug mail from you, with the last number changing in (what looks like) each one. Is that intentional? [14:43] Oh, I see the PR now. === hggdh is now known as QuosqueTandem [15:10] Odd_Bloke: i just did https://github.com/canonical/cloud-init/pull/135 [15:10] approved it, but if you can land it.. i'm not sure (i need to figure out) what the landing process is. [15:13] smoser: Odd_Bloke rharper blackboxsw guys, I'm leaving for the shutdown now. Thanks for the good work this year. See ya in the next decade. :-) [15:23] otubo: Thanks, have a good break! :) [15:25] smoser: I can't see o'tubo in our CLA spreadsheet, so I'm checking internally if we have a non-individual signature that covers them. [15:29] Hi, is it ok to ask for help on using cloud-init in here, it's not just reserved for development? [15:32] danmux: Yep, please do! [15:34] ace! specifically multipart user-data and jinja2 [15:35] Should I be using `Content-Type: text/jinja2` in place of `text/cloud-config` ? [15:36] (also can i confirm `cloud-init devel render` does not handle muilti-part files, just the raw template bit) [15:38] in which case how best can I test my multipart `user-data.txt` [15:40] Hmm, good questions. [15:41] I haven't really dealt with multipart user-data much myself. [15:41] smoser: blackboxsw: Perhaps one of you have context to answer (some of) the above without digging into the code too much? [15:54] I've been digging around the code a bit, and it looks to me like it is either or thing but I'm not 100% [15:54] I can't tell if it would go on and honour the `template` directive - for example... [15:54] ```Content-Type: multipart/mixed; boundary="MIMEBOUNDARY"MIME-Version: 1.0--MIMEBOUNDARYContent-Transfer-Encoding: 7bitContent-Type: text/cloud-configMime-Version: 1.0## template: jinja#cloud-configwrite_files: - path: /usr/local/etc/nomad/client.hcl``` [15:55] (oops) [15:58] for info `/usr/bin/cloud-init 19.2-36-g059d049c-0ubuntu2~18.04.1` [16:25] danmux: it's been a while since I've touched that part of the code. will run a test. I think you might have had to pass text/jinja2 as content type. But, will validate and get you a working example [16:26] blackboxsw hang fire a sec - im able to test now [16:26] sweet [16:27] hmm ok it failed [16:28] oh should i be editing the `.i` file ? [16:30] blackboxsw - ok I was running a single module again, but i think the templating is done in `init`? [16:33] ah - im doing something dumb [16:45] danmux, here's what works for me [16:45] ... sorry getting a paste together [16:46] (y) [16:48] danmux: at long last https://pastebin.ubuntu.com/p/GzbR23WjQg/ [16:50] tyvm - you couldn't paste the `mime-msg` as well blackboxsw :pray: [16:50] to retest on your system that had already booted cloud-init. you can run the following to clean you system, force a reboot and re-run cloud-init with : sudo cloud-init clean --logs --reboot [16:51] ahh will do now danmux [16:52] danmux: https://pastebin.ubuntu.com/p/XKwSf7x4bX/ [16:52] great ty for the test advice - otherwise I should just setup a container as per your example. [16:52] the tool in cloud-init ./tools/make-mime.py -a : [16:53] will generate that content for you [16:53] if you have cloud-init source tree [16:53] https://github.com/canonical/cloud-init/blob/master/tools/make-mime.py [16:54] yup - got it - ours is being generated by terraform. But with your info I'm sure i can make some progress! [16:54] good luck :) [16:54] hope it helps [17:23] Woohooo! blackboxsw that nailed it! tyvm - no I can sign off for Christmas (UK timezone) - Merry Christmas to you and to Odd_Bloke for the referral (y) [17:23] Schweet! danmux [17:23] s/no/now [17:23] good to hear === hjensas is now known as hjensas|afk [18:05] ah, the joy of freelancing. no holidays, no vacations, no time off, no nothing [18:06] (i think i'm mostly joking, but i can't really tell) [18:12] https://github.com/canonical/cloud-init/pull/61#pullrequestreview-335429532 merge? [18:18] hah! [18:27] powersj: minor suggestion on your doc branch and I think we can land it https://github.com/canonical/cloud-init/pull/109#pullrequestreview-335437127 [18:27] blackboxsw, fixed [18:27] meena: I'll let Odd_Bloke close out on that review [18:32] approved waiting on CI [18:45] meena: Goneri: It's landed! [18:54] blackboxsw: https://github.com/canonical/cloud-init/pull/136 [19:17] cool, cool, cool [19:17] now, it's time for some refactoring [19:20] Odd_Bloke: on it for 136. and powers I replied to your doc https://github.com/canonical/cloud-init/pull/104/files [19:20] ooh meena, putting the fun back into refactoring :) [19:23] "can't spell refactoring without fun" — blackboxsw [19:24] :) -> lunch -> coffee [19:25] or -> coffee -> lunch .... can't decide [19:28] i find lunch - > coffee to be slightly more conducive to having a proper post lunch sleep and then wake up refreshed [19:29] "refunctoring" means "rewriting in Haskell", right? [19:35] I'm partial to any functional language i can write, haskell i can only read [20:28] powersj: blackboxsw: Let's kick off the holidays (and the decade) the right way: https://github.com/canonical/cloud-init/pull/137 [20:28] woot! [20:30] Odd_Bloke: in the theme of dropping all the dead code: https://github.com/canonical/cloud-init/pull/134 [20:30] your above is +2'd just waiting on CI [20:30] blackboxsw: The PR I've already Approved, you mean? ;) [20:30] hah [20:31] ahh I'll wait for your py.27 to land and I'll close out 134 [20:31] Thanks for the speedy reviews! [20:32] unfractured attention makes for light work :) [20:49] Landed. \o/ [20:59] Odd_Bloke: can you confirm breakage of make config/cloud.cfg [21:00] or powersj [21:00] on focal it doesn't work for me as it tries to interpret $user from config/cloud.cfg.tmpl line 17 [21:00] as a required substitution param [21:01] blackboxsw: Breakage of what exactly? [21:01] return str(selected_params[key]) [21:01] KeyError: 'user' [21:01] make: *** [Makefile:79: config/cloud.cfg] Error 1 [21:02] no emitted 'rendered' cloud-config [21:02] I'm unable to make that target (to generate cloud.cfg from template) [21:04] and if I do provide a bogus user: ME to the templater.render_string(...., tpl_params) then I get a rendered output file that subtitutes ME for $user on line 17 of config/cloud.cfg.tmpl [21:06] it's tools/render-cloudcfg is called by setup.py during package creation. I'm wondering why that hasn't broken our package builds too [21:08] interesting. this works on xenial: ./tools/render-cloudcfg --variant ubuntu config/cloud.cfg.tmpl [21:08] not on focal [21:08] I have never seen these Make targets before. :p [21:08] yeah I hadn't until I started fgreping. so something else in the template engine is getting hung up on the $user in the config template file [21:09] I think it may be focal only [21:09] blackboxsw: What do you want me to run to reproduce? [21:09] checking eoan /bionic I might have a trivial patch [21:09] Odd_Bloke ./tools/render-cloudcfg --variant ubuntu config/cloud.cfg.tmpl [21:09] And what are these used for? (Should we remove them?) [21:09] should emit output to stdout with the rendered template [21:09] It does. [21:09] Odd_Bloke: they are used in setup.py to build the package [21:10] but we probably can drop the makefile target [21:10] blackboxsw, if these were broken, how did you upload to focal? [21:10] OK, so we probably shouldn't remove them. :p [21:11] powersj: I think something in the python environment used though dh_python is succeeding there whereas direct script running through python3 does not. [21:11] ah [21:11] blackboxsw: I can't reproduce a problem on focal. [21:11] ok so something from where I sit [21:11] hrm [21:12] ahh I'm on eoan :/ [21:12] checking eoan and focal containers [21:13] and upgrading my laptop [21:14] ok success on focal [21:18] ok; dirty local dev environment. Fresh eoan no problems. something I've inevitably pip installed that is colliding w/ the renders [21:18] Odd_Bloke: powersj n/m thanks for validation [21:18] :D [21:18] * blackboxsw should work in a clean dev container to avoid thrashing [21:18] someone post an image link or a github thingy pls [21:22] https://imgflip.com/i/3k3kft [21:31] excellent, previews are working. [21:31] now, to get back to refunctoring. [21:37] whoa [21:37] Python2.7 is dead?! [21:38] meena: Goneri: It's landed! <3 [21:39] meena: Yep! \o/ [21:40] Odd_Bloke: can i get some starting help with the refactor? [21:40] long live python 3 [21:40] just to get the class(es) started, i can do the rest myself. [21:41] blackboxsw: ETA for Python 4? :P [21:44] meena: This is wrong point in the decade to ask for help, I'm afraid. ;) [21:45] Odd_Bloke, thank you, now I will refresh the netbsd branch :-) [21:45] Odd_Bloke: in that case, i'll just repeat all of Distros mistake, and you get to fix them next decade. [21:45] meena: I would experiment with moving one of the two "*_on_{freebsd,linux}" functions onto either the Distro or Renderer classes. [21:45] Which one they go on will probably depend on what makes sense in the structure of the code. [21:45] I think we need a distros/linux.py and some inheritance [21:46] and a lot of linux specific content should be move from net/__init__.py to this new distros/linux.py [21:46] Goneri: that's what distros/__init__.py is. [21:46] distros/__init__.py is linux specific, it should be agnostic [21:47] On the Distro would seem more natural to me, as the functions aren't to do with the rendering of network stuff. [21:47] I would suggest that refactoring them onto an existing class would make sense. [21:48] Refactoring to have a Linux Distro and an agnostic, shared super-class is something I would support, but we would need to discuss that as a project. [21:48] a large part of net/__init__.py is actually just some Linux specific code. [21:48] Odd_Bloke, yes maybe, it's indeed already a good step in the right direction. [21:49] As a reminder, the intent of the exercise is to gather data about what refactoring looks like it would make sense. [21:49] So we don't need it to be Done (TM). [21:50] We just need to be able to see roughly what it would look like, and modifying the existing distros.Distro to add functionality and overriding it in freebsd.Distro would do that, I think. [21:50] Good point. [21:50] points. [21:50] IMO, a good metric is the number of is_FreeBSD in the code base [21:50] the less, the better [21:51] Agreed. [21:59] Odd_Bloke: how do we access the distro from cloudinit/net? [22:03] meena: That will be one thing that will need to be worked out. [22:05] Odd_Bloke: >_> [22:05] okay. [22:08] (= [22:12] i wonder if we can do that with decorators… maybe. probably not. [22:49] maybe the easiest way would be to [23:02] hmm… a class? [23:19] * meena gives up for tonight o/~