/srv/irclogs.ubuntu.com/2017/12/07/#cloud-init.txt

blackboxswsmoser: pushed WIP branch. started adding unit tests https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+ref/fix-ds-identify-vmware-ovf00:28
blackboxsw->dinner00:28
dojordanhey folks, any idea about this pylint error? Cell variable section_name defined in loop01:21
smoserdojordan: more context ?01:25
dojordanfor section_name in ('PlatformSettingsSection', 'PlatformSettings', 'PreprovisionedVm'):01:27
dojordansections = find_child(section, lambda n: n.localName == section_name)01:27
smoserdo you use section_name outside the loop ?01:27
dojordannope01:27
dojordanah think i may have found it01:30
dojordani was using sections outside the loop01:31
smosermaybe chttps://stackoverflow.com/questions/25314547/cell-var-from-loop-warning-from-pylint01:32
smosersome context there.01:32
smoserif you run with '--output-format=parseable' you get the code nubmer (W0640)01:32
dojordanhaha i was on that page. but good idea01:33
smoserthe answer there is probably as good as i would be able to give you and it'd take me a minute to fully grock it too01:34
smoser:)01:34
catmandohey all11:38
catmandoquestion: i want to disable datasources completely: i've set ```datasource_list: ['None']``` but when an instance comes up it still takes a _very_ long time looking for metadata (e.g.: ``` Calling 'http://172.16.8.254/latest/meta-data/instance-id```)11:43
sinanpHi, how can I add peerdns=no to the ifcfg configuration file?12:51
ybaumysmoser: remember we talked about datasources in foreman. there is a rpm ruby gem userdata for foreman13:18
ybaumysmoser: its nocloud datasource13:19
ybaumysmoser: but only for userdata13:19
ybaumysmoser: i couldnt test it yet completly because i have problems with my templates13:20
sinanpShouldn't this create an user account including the provided password and public key? https://pastebin.com/J7J6cZ9X13:27
sinanpIt doesn't create any user...13:31
sinanpsmoser: Thanks! Have it working now. Any clue how to have peerdns=no in the ifcfg-eth0 file?15:30
smosersinanp: probably not able to.15:32
sinanpAh ok :) Thanks15:33
sinanpAnd another problem :) Shouldn't "disable_root: 1" disable root login over SSH? It doesn't disable it...16:02
smosersinanp: it disables it with the keys that you gave.16:41
=== shardy is now known as shardy_afk
smoserrharper: i didnt realize that we were *not* running pylint for python2 and python318:34
smoserwe do that in curtin18:34
smoserhm..18:34
rharperright, we have a py27-pylint and py3-pylint in curtin18:35
rharpervs. just 'pylint' in cloud-init18:35
rharperI thought it was only python3 based due to the default env; but I didn't verify18:35
rharperdo you want me to fix up top to use py27-/py3 pylints ?18:36
rharperwith the exception of no py27 on cloud-tests ?18:36
smoseripm not even sure.18:36
rharperand what do you want to do about tools ?18:36
smoserwhich it woudl pick.18:36
smoseri'll fix tools it cant be that hard.18:36
smoseri'm just tsarted looking at your branch.18:36
smoseri'll see.18:36
rharperok18:37
rharperone was optparse18:37
rharperI didn't really want to rewrite that to argparse; seemed hardly worth it, not knowing how often that tool is used18:37
rharperthe other one about a missing default parametter to the mime-type finder wasn't very obvious where we need to set a default value18:37
smoserharlowja: tools/hacking.py ...18:47
smoserwhy does that exist ?18:47
harlowjasup dawg18:47
harlowjalet me see18:47
harlowjai think it was before time18:49
smoserhm..18:49
harlowjabefore https://pypi.python.org/pypi/hacking came to existence18:49
harlowjahttps://pypi.python.org/pypi/hacking was born18:49
harlowjaso that file can die18:49
harlowjalol18:49
smoserright18:49
smoserand we have hacking in our flake818:49
smoserso we get it.18:49
smoserthanks18:49
harlowjayup18:51
harlowjakill its18:51
smoserrharper: https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+ref/fix/cloud-test-add-pylint-and-fix19:22
rharperwhoa19:22
rharperwhat's the trailing slash do ?19:23
smoseri dont know. :)19:23
rharperhehe19:23
smoseri thikn it would then go searching for modules in that directory19:23
rharperfreaky19:23
smoserversus treating that as a module19:23
smosertry it though i'm pretty sure you can reproduce19:23
rharperI'm sure I can, just kinda boggles my mind19:27
smoserwell, anyway, with those changes tip-pylint works also19:29
smoserandd tools/ is clean19:29
smoseror 'tools'' rather19:29
rharperhehe19:30
rharperpulling your branch now19:30
smoserand drop the metadata bit19:30
smoseri did not intend to get that to you19:30
smoserit was in my working dir ithink19:30
rharperoh, did you drop that already ?19:30
rharperin your branch ? or do I still need to ?19:30
rharperpowersj was asking about that19:31
powersjyeah it was in your diff yesterday19:31
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33478019:31
smoserthat was how i found out that integration tests were busted19:31
smoseri was going to run integration test on m y changes19:31
smoserand found it broken19:31
smoserand t hen wentn off to try to get pylint going19:32
smoserand then handed that off to you19:32
powersjwhat a chain of events :)19:32
smoserso i'd say drop that commit19:32
rharperright, I just meant did you drop that delta out of the pylint branch in the thing you just  proposed to merge into my pylint branch ?19:32
smoserand we can pull it in separately.19:32
smoserjust git rebase -i master19:32
smoserand delete it19:32
smoserthen after your merge we'llg rab mine19:32
rharperwell, it's not a separate commit19:32
rharperso I was going to find out which bits were unneeded and diff them out in a another commit and squash during rebase19:33
smoseroh its not ?19:33
rharperit's the "what bits do I need to drop" that I'm asking for19:33
smoser:-(19:33
rharperI don't know19:33
rharperthat's what I've been asking19:33
rharperI'm generally not aware of which files were the "metadata" changes that powersj  and smoser are speaking of19:33
smoserwell, its in that mp there. probably will patch -R off if you wanted to19:33
rharperok19:34
rharperthat works19:34
* rharper patch -Rs19:34
smosergit show 612f9896330e | patch -p1 -R19:34
smoserone hunk failed19:34
smoseri'll get it19:34
rharperhttp://paste.ubuntu.com/26134634/19:36
rharperI did: git diff -r master <path to both files>19:36
rharperand then I can patch -p1 -R  <that diff> and it applies cleanly to revert those changes19:36
rharperlook sane ?19:36
dpb1nice blog post bbsw: https://twitter.com/davidpbritton/status/93816099613627187219:39
smoseri think so19:39
rharperk, pushing again to my branch19:39
rharperI commited the revert and squashed into my first commit19:39
rharperok19:40
rharperhttps://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/33486819:40
rharperthat looks better19:40
smosermention removal of tools/hacking.py (obsolete)19:42
smoserand then i thikn happy19:42
smoserassuming c-i is19:42
rharperman, really don';t like cloud-images not having apt sources update data in them19:43
rharpersmoser: did we file a bug on that?19:43
rharperapt install foo breaks until you apt update first19:43
rharperon daily images , no less19:43
rharperyou noticed that ?19:44
smoser?19:44
rharperI just launched daily bionic, sudo apt install tree19:44
rharperfails, I have to apt update first19:44
smoserwell, youc ant really do anythign about bionic19:44
smoserdevelopment release is basiclaly guaranteed to have out of date apt19:44
rharperok, on arful19:44
rharperon xenial19:44
rharperon zesty19:44
rharperit's the new thing19:44
rharpersame in lxd images too19:45
smoseri think that released iamges should have the frozen release pocket up to date in the image.19:45
rharperlaunch a new one, lxc launch ubuntu-daily:xenial x119:45
rharperpretty sure it was broken there too19:45
rharpersmoser: I didn't squash your three commits; I'll do that and add their changes to the commit message, wait for ci and then push to master19:48
rharperTridactyl (Vimperator/Pentadactyl's successor).19:50
rharpersmoser: surely you've tried this in ff57+;  i really wanted to switch to ff, but the input-box editor is missing (using wasavi on chrome for that now)19:51
smoseroh ther is one.19:51
smoseri use it.19:51
smoserlet me find19:51
smoseri have tridactlyl installed not really using it though19:51
smoserhttps://github.com/jlebon/textern19:53
smoserand 'xvim' is the editor i invoke19:53
smoser https://gist.github.com/smoser/1ee3f2b223717625c5f419:53
smoserie, my editor configured is ['xvim', 'block']19:53
rharpernice19:56
rharperdoes that get your input box editing ?19:56
smosertext area, i hit 'ctrl-I'19:56
rharpernice!19:57
smoserlike i did before and gnome-terminal window pop up19:57
rharperI couldn't get textern to work when I tried it a few weeks ago19:57
rharperbut I used gvim19:57
rharperso maybe xvim will do the trick19:57
smoseryeah i dont liek gvim19:57
smosergvim will work fine19:57
rharperhuh, not for my system, probably a win manager thingy19:57
smoseri just dont like the mouse i think always messed me up19:57
smoseron paste and things.19:57
rharpergot some xmonad here19:57
smoseroh. i dont know. it does work for me. i dont remembered every thing i did. i just followed the doc it had19:58
smoserrharper: so it looks like, on xenial the images have these20:06
smoseroh man20:08
smoserlooks like haste is dead20:08
smoserhttp://paste.ubuntu.com/26134814/20:08
smoserso in /var/lib/apt/lists/ on xenial daily we have lists present for20:08
smoser xenial-updates mmain restricted20:09
smoser xenial main restricted20:09
smoser security main restricted20:09
smoserno universe or multiverse or backports20:09
smoserwhich are all going to be pulled when you type 'apt-get update'20:09
smoseri've had discussions with rbasak about this before20:10
smoserand i think the right thing to do would be to include only the "frozen" data20:10
smoserie,20:10
smoser xenial main restricted universe multiverse20:10
smoserremoving those files from the iamge just causes the user to have to download them and get the exact same thing as they could have been given in the image.20:11
smoserfor xenial-updates and security, it somewhat makes sense to have those out of date20:11
smoserer... somewhat makes sense to not have those at all20:12
smoseras they're basically guaranteed to be out of date.20:12
smoseri think what we have now is probably just  happenstance or regression20:12
smoserbut one could probably argue that its best to have nothing in there20:12
smoserwhich will force a user to 'apt-get update'20:12
smoserbecause if they had only the 'frozen' bits, then they could 'apt-get install foo' and get a vulnerable 'foo'20:13
smoserbut that comes at a big cost20:13
smoseron mirrors and data download and cpu decompression that.20:14
rharperyeah20:35
rharperwell, it feels different, for better or for worse20:36
smoserit may well have changed.20:36
smoseri didnt check that20:36
rharperdaily images, for example are unlikely to get a security vulnerable one if they included up-to-date cached files20:36
smoserand it feels wrong to me to have 'main' and 'universe' there but no multiverse or backports20:36
rharperI think that's my gripe, if I'm already downloading a daily20:36
rharperit shouldn't be out of date20:36
smoserif the user is just going to get them on first 'apt-get update'20:36
smoser(and gets them by default on an install)20:36
smoserso.20:36
smoseryour tests failed in centos620:37
smoserthe unittest there is to old to have assertRaisesRegex20:37
rharperhow does tox not find that ?20:37
rharperoh, have to run tox *in* centos620:37
rharperthat's py26, right ?20:37
smoseryeah. and with system packages. yeah.20:38
rharperurg20:38
smoseri think easiest thing tpo do is just use the 'ignore' comment20:38
rharperno pip unittest magic ?20:38
rharperyeah20:38
smoseroh. acutally20:38
smoseroh.20:39
smoseri think that unittest is builtin to python20:40
smoserso we're using the one from python2.6 installed there.20:40
rharperright, was wondering if we could somehow upgrade it; but I suspect not as easily as # pylint: disable=FOO20:41
smoserwell, helpers could patch smpething in20:44
smoseroh. actually...20:44
smoserhttp://paste.ubuntu.com/26134987/20:48
smoserrharper: ^20:48
smosertry that20:48
rharperoh, heh20:48
rharperwhat happens is that pylint will mark that line as using depricated method20:48
rharperthen we hae to mark #pylint: disabled=W1505 there20:49
rharpernow, we have two call sites20:49
rharperwe could add that and the disable, and then we'd be free to always use Regex20:49
rharperthoughts?20:49
smoser?20:50
smosercant we just monkey patch it like that and use the new name ?20:50
rharperwe can, but we'll still get the warning, now on cloudinit/tests/helpers.py20:51
rharperbut I think that's better to do it in one place20:51
smosersure. but then its one place to coment and it has a text coment saying why20:51
rharperprolly should move the parse_and_read() method to helpers too20:51
rharperyes20:51
rharperI'll do that as well for the ConfigParser20:51
smoserok. i got to go afk for a bit. biab20:52
rharperk20:52
dojordan@blackboxsw, can you take a look? I responded to the comments which i didn't fix, the rest are fixed21:00
dojordanhttps://code.launchpad.net/~dojordan/cloud-init/+git/cloud-init/+merge/33434121:00
smoserrharper: http://paste.ubuntu.com/26135182/21:20
smoseri think that atually works. i had '2' in the wrong place :)21:20
rharperah21:22
rharperyeah, was just debugging that21:22
smoseri think pylint wont even complain.21:23
rharperso, how does pylint get executed in py27 ?21:24
rharperon curtin we have those py27-pylint and p3-pylint targets which set base-python = ...21:24
smoserit doesnt21:24
rharperhrm21:24
rharperdo we not care then ?21:25
smoserwe can absolutely follow like curtin did/does21:25
smoserand have explicit ones21:25
smoserthe thing i dont like about it is that... slow21:25
rharperyeah21:25
rharperwell, in cloud-init we run .pylintrc with jobs=421:25
rharperso it does run in parallel21:25
smoserstill slow21:25
rharperwhich is pretty nice21:25
rharperyes21:25
smoseri'm not opposed to it.21:27
smoserbut i dont think we *have* to do it right now21:27
smoseri like to give future smoser some reason to think past smoser was an idiot21:27
smosertox -e pylint on diglett takes 1m28 seconds21:30
smoserbso adding another of those just seems costly.21:30
smoserwithout tools/ and tests/ it was only 30s ish21:30
rharperwhat's the total tox run ?21:32
rharperboo21:33
smoser2m2621:41
smoser1m30 of that to tox21:41
smoserer.. to pyklint21:42
rharperman, can't win;21:42
rharperwith the centos fix, tox -e pylint fails21:43
smoseri think just for now do pylint on python3 only.21:43
smoser?21:43
rharpereven though unittest2.TestCase has both attributes21:43
rharperif I comment out your patch21:43
rharperit passes21:43
rharpersmoser: well, we can demote pylint to something like tip-pylint21:45
rharperpresent, but not always run ?21:45
rharperI think we don't lint on package build anyhow, right ?21:45
rharperdo we tox on package build ?21:45
rharperor just unittest21:45
smoserwell we want to run pylint . i am fine with 1x that cost21:47
smosernot 2x21:47
smoserand yeah, we can add a py2-pylint that only runs on manual21:47
smoserbut i dont think we really need to.21:47
rharperI still can't figure out why it's failing with your cent6 fix21:47
rharperit doesn't make any sense; the fix-up path isn't taken at all21:47
rharperhttps://github.com/PyCQA/pylint/issues/165321:48
dojordan:q!22:00
dojordan(whoops)22:00
rharpersmoser: so I'd like to drop the cent6 2.6 pylint fix unless you can figure out how to fix that;  and just skip running pylint on the package builds;22:01
smoseroh. its not actually pylint that complained22:01
smoserit was a unit test complaining22:01
smoserright?22:01
rharperah, lemme see22:02
rharperyeah22:03
rharper    self.assertRaisesRegex(util.ProcessExecutionError22:03
rharper /test_util.py", line 698, in test_subp_warn_missing_shebang22:03
rharper    self.assertRaisesRegex(util.ProcessExecutionError22:03
rharperthe fix you had will work but pylint blows up on it22:03
rharperand I can't figure it out22:04
rharperso, I guess we leave it as Regexp and mark them disables22:04
rharperwhat a pita22:04
smoserhttp://paste.ubuntu.com/26135444/22:12
smoserrharper: ignore the basepython thing in that patch22:12
smoserand that runs for me (make unittest) in centos622:12
rharperwow22:13
rharperhow did you figure that one out?22:13
smoserit was juts comp;laining that the thing was an integer22:13
rharperbut I don't like not using assertRaises*22:13
smoserit still uses it.22:13
smoserjust the context_manager.exception.code22:13
smoseris wht differs22:13
rharperoh, my failure is on ubuntu22:13
rharperwith that the older assertRaisesRegexp fix22:14
rharpertox -e pylint on my ubuntu system fails22:14
rharpersaying we're using deprecated methods22:14
rharperRegex22:14
rharperwhich 1) isn't deprecated  2)  hasn't been patched22:14
rharperI hadn't yet run under centos again22:15
smoserhttps://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaisesRegex22:15
rharperwas still trying to get a clean tox run on ubuntu first and added your older unittest2 fix for centos to test in a bit but; it won't pass pylint for me22:15
smoserit may not be deprecated, but it deffinintely not renamed22:15
rharperhttps://github.com/PyCQA/pylint/issues/165322:15
smoserthat is odd.22:18
smoserugh22:19
rharperyeah22:19
rharperexactly22:19
smoserrharper: http://paste.ubuntu.com/26135510/22:23
smoserthat i thikn is happy everywhre22:24
smoserstupid22:24
smoserthat is on top of 5335e1632ddabdbad9ffb011720929ae4cd8ebe322:24
smoseroh boy22:27
smoserhten i realize that Makefile (that runs 'nosetests' only runs on tests/ not on cloudinit)22:27
smosergah22:27
rharperman, what a rat hole22:28
smosermisplaced 2 again22:28
rharperwow, what is that tricky bit ?22:28
smoserhttp://paste.ubuntu.com/26135531/22:28
rharperhow does that help ?22:29
smoserthat worked in 'tox '22:29
rharperI fail to see what tox found the first time22:29
rharperso the "fix" is just as mystical to me too22:29
smoserand it works in 'make unittest' in centos622:29
smoserthe '_tricky' part there is complete crap22:29
rharperk22:29
rharperyeah22:29
smoserwhat i think is happening is that pylint is looking for Regexp to go complaining22:30
smoserand realiaes that the thing we're calling is == that other thing22:30
rharperyeah22:30
smoserbut then now its not strictly equal22:30
rharperlemme get both those in my branch now22:30
rharperright22:30
smoserall problems solved by anbother level of indirection :)22:30
smoseroh. i was wrong.  'make unittest' *does* run with cloudinit22:31
smoserso thats good.22:31
smoseri thikn we're set here.22:31
smoseryou get that, push it, and  maybe we'll be happy!22:31
smosermaybe22:31
smoserand on that note, /me is out22:31
rharperok22:33
rharperthanks22:33

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