/srv/irclogs.ubuntu.com/2019/12/20/#cloud-init.txt

blackboxswand drop the super deprecated modules part 2 https://github.com/canonical/cloud-init/pull/13400:03
blackboxswok EOD for me00:03
mkraiblackboxsw, Hi I get error running clour-init query all command http://paste.openstack.org/show/787808/08:32
otuboI 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
otubosmoser: blackboxsw perhaps are already up :14:03
otubo*I hate to work, I can't even blame the autocorrect, it's my mind that want's to leave on vacation already :-D14:04
otuboHa! 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/13514:26
otuboAlso, I run the script with --dryrun enabled but it ended up doing the whole proccess. Perhaps there's a bug there. :-)14:27
Odd_Blokeblackboxsw: 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:41
Odd_BlokeOh, I see the PR now.14:43
=== hggdh is now known as QuosqueTandem
smoserOdd_Bloke: i just did https://github.com/canonical/cloud-init/pull/13515:10
smoserapproved it, but if you can land it.. i'm not sure (i need to figure out) what the landing process is.15:10
otubosmoser: 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:13
Odd_Blokeotubo: Thanks, have a good break! :)15:23
Odd_Blokesmoser: 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:25
danmuxHi, is it ok to ask for help on using cloud-init in here, it's not just reserved for development?15:29
Odd_Blokedanmux: Yep, please do!15:32
danmuxace! specifically multipart user-data and jinja215:34
danmuxShould I be using `Content-Type: text/jinja2` in place of `text/cloud-config` ?15:35
danmux(also can i confirm `cloud-init devel render` does not handle muilti-part files, just the raw template bit)15:36
danmuxin which case how best can I test my multipart `user-data.txt`15:38
Odd_BlokeHmm, good questions.15:40
Odd_BlokeI haven't really dealt with multipart user-data much myself.15:41
Odd_Blokesmoser: blackboxsw: Perhaps one of you have context to answer (some of) the above without digging into the code too much?15:41
danmuxI'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
danmuxI can't tell if it would go on and honour the `template` directive - for example...15:54
danmux```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:54
danmux(oops)15:55
danmuxfor info `/usr/bin/cloud-init 19.2-36-g059d049c-0ubuntu2~18.04.1`15:58
blackboxswdanmux: 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 example16:25
danmuxblackboxsw hang fire a sec - im able to test now16:26
blackboxswsweet16:26
danmuxhmm ok it failed16:27
danmuxoh should i be editing the `.i` file ?16:28
danmuxblackboxsw - ok I was running a single module again, but i think the templating is done in `init`?16:30
danmuxah - im doing something dumb16:33
blackboxswdanmux, here's what works for me16:45
blackboxsw... sorry getting a paste together16:45
danmux(y)16:46
blackboxswdanmux: at long last https://pastebin.ubuntu.com/p/GzbR23WjQg/16:48
danmuxtyvm - you couldn't paste the `mime-msg` as well blackboxsw :pray:16:50
blackboxswto 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 --reboot16:50
blackboxswahh will do now danmux16:51
blackboxswdanmux: https://pastebin.ubuntu.com/p/XKwSf7x4bX/16:52
danmuxgreat ty for the test advice - otherwise I should just setup a container as per your example.16:52
blackboxswthe tool in cloud-init ./tools/make-mime.py -a <your_yaml>:<mime-type>16:52
blackboxswwill generate that content for you16:53
blackboxswif you have cloud-init source tree16:53
blackboxswhttps://github.com/canonical/cloud-init/blob/master/tools/make-mime.py16:53
danmuxyup - got it - ours is being generated by terraform. But with your info I'm sure i can make some progress!16:54
blackboxswgood luck :)16:54
blackboxswhope it helps16:54
danmuxWoohooo! 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
blackboxswSchweet! danmux17:23
danmuxs/no/now17:23
blackboxswgood to hear17:23
=== hjensas is now known as hjensas|afk
meenaah, the joy of freelancing. no holidays, no vacations, no time off, no nothing18:05
meena(i think i'm mostly joking, but i can't really tell)18:06
meenahttps://github.com/canonical/cloud-init/pull/61#pullrequestreview-335429532 merge?18:12
blackboxswhah!18:18
blackboxswpowersj: minor suggestion on your doc branch and I think we can land it https://github.com/canonical/cloud-init/pull/109#pullrequestreview-33543712718:27
powersjblackboxsw, fixed18:27
blackboxswmeena: I'll let Odd_Bloke close out on that review18:27
blackboxswapproved waiting on CI18:32
Odd_Blokemeena: Goneri: It's landed!18:45
Odd_Blokeblackboxsw: https://github.com/canonical/cloud-init/pull/13618:54
meenacool, cool, cool19:17
meenanow, it's time for some refactoring19:17
blackboxswOdd_Bloke: on it for 136. and powers I replied to your doc https://github.com/canonical/cloud-init/pull/104/files19:20
blackboxswooh meena, putting the fun back into refactoring :)19:20
meena"can't spell refactoring without fun" — blackboxsw19:23
blackboxsw:)   -> lunch -> coffee19:24
blackboxswor -> coffee -> lunch .... can't decide19:25
meenai find lunch - > coffee to be slightly more conducive to having a proper post lunch sleep and then wake up refreshed19:28
Odd_Bloke"refunctoring" means "rewriting in Haskell", right?19:29
meenaI'm partial to any functional language i can write, haskell i can only read19:35
Odd_Blokepowersj: blackboxsw: Let's kick off the holidays (and the decade) the right way: https://github.com/canonical/cloud-init/pull/13720:28
blackboxswwoot!20:28
blackboxswOdd_Bloke: in the theme of dropping all the dead code:  https://github.com/canonical/cloud-init/pull/13420:30
blackboxswyour above is +2'd just waiting on CI20:30
Odd_Blokeblackboxsw: The PR I've already Approved, you mean? ;)20:30
blackboxswhah20:30
blackboxswahh I'll wait for your py.27 to land and I'll close out 13420:31
Odd_BlokeThanks for the speedy reviews!20:31
blackboxswunfractured attention makes for light work :)20:32
Odd_BlokeLanded. \o/20:49
blackboxswOdd_Bloke: can you confirm breakage of make config/cloud.cfg20:59
blackboxswor powersj21:00
blackboxswon focal it doesn't work for me as it tries to interpret $user from config/cloud.cfg.tmpl line 1721:00
blackboxswas a required substitution param21:00
Odd_Blokeblackboxsw: Breakage of what exactly?21:01
blackboxsw    return str(selected_params[key])21:01
blackboxswKeyError: 'user'21:01
blackboxswmake: *** [Makefile:79: config/cloud.cfg] Error 121:01
blackboxswno emitted 'rendered' cloud-config21:02
blackboxswI'm unable to make that target (to generate cloud.cfg from template)21:02
blackboxswand 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.tmpl21:04
blackboxswit's tools/render-cloudcfg is called by setup.py during package creation. I'm wondering why that hasn't broken our package builds too21:06
blackboxswinteresting. this works on xenial: ./tools/render-cloudcfg --variant ubuntu config/cloud.cfg.tmpl21:08
blackboxswnot on focal21:08
Odd_BlokeI have never seen these Make targets before. :p21:08
blackboxswyeah 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 file21:08
blackboxswI think it may be focal only21:09
Odd_Blokeblackboxsw: What do you want me to run to reproduce?21:09
blackboxswchecking eoan /bionic I might have a trivial patch21:09
blackboxswOdd_Bloke   ./tools/render-cloudcfg --variant ubuntu config/cloud.cfg.tmpl21:09
Odd_BlokeAnd what are these used for?  (Should we remove them?)21:09
blackboxswshould emit output to stdout with the rendered template21:09
Odd_BlokeIt does.21:09
blackboxswOdd_Bloke: they are used in setup.py to build the package21:09
blackboxswbut we probably can drop the makefile target21:10
powersjblackboxsw, if these were broken, how did you upload to focal?21:10
Odd_BlokeOK, so we probably shouldn't remove them. :p21:10
blackboxswpowersj: I think something in the python environment used though dh_python is succeeding there whereas direct script running through python3 does not.21:11
powersjah21:11
Odd_Blokeblackboxsw: I can't reproduce a problem on focal.21:11
blackboxswok so something from where I sit21:11
blackboxswhrm21:11
blackboxswahh I'm on eoan :/21:12
blackboxswchecking eoan and focal containers21:12
blackboxswand upgrading my laptop21:13
blackboxswok success on focal21:14
blackboxswok; dirty local dev environment. Fresh eoan no problems. something I've inevitably pip installed that is colliding w/ the renders21:18
blackboxswOdd_Bloke: powersj n/m thanks for validation21:18
powersj:D21:18
* blackboxsw should work in a clean dev container to avoid thrashing 21:18
meenasomeone post an image link or a github thingy pls21:18
blackboxswhttps://imgflip.com/i/3k3kft21:22
meenaexcellent, previews are working.21:31
meenanow, to get back to refunctoring.21:31
meenawhoa21:37
meenaPython2.7 is dead?!21:37
Goneri<Odd_Bloke> meena: Goneri: It's landed! <321:38
Odd_Blokemeena: Yep! \o/21:39
meenaOdd_Bloke: can i get some starting help with the refactor?21:40
blackboxswlong live python 321:40
meenajust to get the class(es) started, i can do the rest myself.21:40
meenablackboxsw: ETA for Python 4? :P21:41
Odd_Blokemeena: This is wrong point in the decade to ask for help, I'm afraid. ;)21:44
GoneriOdd_Bloke, thank you, now I will refresh the netbsd branch :-)21:45
meenaOdd_Bloke: in that case, i'll just repeat all of Distros mistake, and you get to fix them next decade.21:45
Odd_Blokemeena: I would experiment with moving one of the two "*_on_{freebsd,linux}" functions onto either the Distro or Renderer classes.21:45
Odd_BlokeWhich one they go on will probably depend on what makes sense in the structure of the code.21:45
GoneriI think we need a distros/linux.py and some inheritance21:45
Goneriand a lot of linux specific content should be move from net/__init__.py to this new distros/linux.py21:46
meenaGoneri: that's what distros/__init__.py is.21:46
Goneridistros/__init__.py is linux specific, it should be agnostic21:46
Odd_BlokeOn the Distro would seem more natural to me, as the functions aren't to do with the rendering of network stuff.21:47
Odd_BlokeI would suggest that refactoring them onto an existing class would make sense.21:47
Odd_BlokeRefactoring 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
Goneria large part of net/__init__.py is actually just some Linux specific code.21:48
GoneriOdd_Bloke, yes maybe, it's indeed already a good step in the right direction.21:48
Odd_BlokeAs a reminder, the intent of the exercise is to gather data about what refactoring looks like it would make sense.21:49
Odd_BlokeSo we don't need it to be Done (TM).21:49
Odd_BlokeWe 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
meenaGood point.21:50
meenapoints.21:50
GoneriIMO, a good metric is the number of is_FreeBSD in the code base21:50
Gonerithe less, the better21:50
Odd_BlokeAgreed.21:51
meenaOdd_Bloke: how do we access the distro from cloudinit/net?21:59
Odd_Blokemeena: That will be one thing that will need to be worked out.22:03
meenaOdd_Bloke: >_>22:05
meenaokay.22:05
Odd_Bloke(=22:08
meenai wonder if we can do that with decorators… maybe. probably not.22:12
meenamaybe the easiest way would be to22:49
meenahmm… a class?23:02
* meena gives up for tonight o/~23:19

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