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

asdawqweqHello everyone, could any one give an advice how to reset cloud-init so it runs normally after next restart. I tried to delte ../instances unfortunatelly does not work, using openstack. Any tips?09:13
asdawqweqa]\10:44
smoserasdsad, rm -Rf /var/lib/cloud/13:26
dpb1hi smoser13:46
smoserhello dpb113:59
blackboxswgood morning. hopefully all made it swiftly back home14:19
smoserthis is wierd14:52
smoserhttps://code.launchpad.net/~ajorgens/cloud-init/+git/cloud-init/+merge/32542414:52
smosercauses14:52
smoserhttps://jenkins.ubuntu.com/server/job/cloud-init-ci/nodes=metal-amd64/509/console14:52
smoserthere are issues in the MP, but the failures there show that util.append_file() is just broken14:52
smoseri'm not sure how we've not seen those failures before14:52
blackboxswhmm so octal is more strict than %s  in that %s convert None to "None".  So we've been passing in an empty self.args in the past and just not validating the output in TestGenericDistro maybe14:54
smoserblackboxsw, you're correct there.14:55
smoserbut if you ever call append_file("/tmp", "foo\n") it will just fail14:55
smoserwithout that change.14:55
smoseras that calls write_file with mode=None14:55
smoserwhich calls os.chmod("/tmp/myfile", None)14:56
smosershould have read append_file("/tmp/myfile, "foo\n")14:56
smoserabove14:56
ajorgIt's funny. I submitted https://code.launchpad.net/~ajorgens/cloud-init/+git/cloud-init/+merge/325424 as a no-brainer test of the current merge process (last time we were still using bzr).15:09
ajorgI thought, "surely this can't go wrong."15:09
ajorg"... it's a two character change"15:09
ajorg:-)15:09
smoser:)15:09
smoser(and you did so 0o3 years ago... thought i'd be clever and write that as octal, but its hard to read)15:11
smoserlooks like some funny ascii art15:11
ajorgsmoser: so if I submit a 2 char fix and you counter with an 8 line fix and a test case, I still get my name on it?15:15
ajorg;-)15:15
ajorgI need to setup an Ubuntu instance to run tox on. Hopefully I can keep carving off time for it.15:17
powersjajorg: out of curiosity what OS are you developing on?15:18
ajorgpowersj: Amazon Linux. I'm Amazon's cloud-init maintainer, when I can find time for it.15:20
ajorgyes, getting unit tests running on Amazon Linux is also somewhere on my TODO list.15:20
powersjajorg: cool :) does tox bomb out on Amazon Linux today?15:21
powersjwe recently got them going on centos 6/7, so I was curious how we were doing on other distros15:22
ajorgpowersj: I last ran the unit tests before it was moved to tox (I think?) and a bunch of the tests were failing. I'll give it another try.15:22
powersjok thanks!15:22
ajorgpowersj: the unit tests do work on Amazon Linux. Neat-o!16:02
smoserhttps://code.launchpad.net/%7Ecloud-init-dev/cloud-init/+git/cloud-init/+ref/master/+activereviews16:02
powersjajorg: woohoo! thanks for trying and that is good to know16:03
smoserajorg, yeah, i'd keep your name on it.16:06
smoser:)16:06
ajorgsmoser: heh, okay, verifying fix now.16:07
ajorgbleh, how did append_file ever work?16:17
ajorgit passes mode=None... chmod() doesn't accept None16:18
smoserajorg, ah. i see.16:22
smoserin util, 'chmod' is not os.chmod16:22
smoserand it does:16:23
smoserif path and real_mode:16:23
smoser   ... os.chmod()16:23
smoserso calling None just does nothing16:23
ajorgoh, okay16:23
smoserrharper, https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/32540216:25
smoserthat is good ?16:25
rharperI think I landed that, no ?16:25
smoseryes. fixed mp to mark that16:26
rharperack16:26
smoserrharper, you want me to grab https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/325404  ?16:31
smoseri can drop the 'pass' line in pulling it16:31
rharperyes16:31
rharperthx16:31
smoserrharper, do you have a link to the selinux guard python bug ?16:33
rharperI think that's in the MP or commit message16:33
rharperhttps://bugzilla.redhat.com/show_bug.cgi?id=140652016:33
ubot5bugzilla.redhat.com bug 1406520 in libselinux "calling libselinux python restorecon fails on /var/lib/nfs/rpc_pipefs" [High,Verified]16:33
smoseryep16:33
smosertghanks16:33
ajorgsmoser: not sure if I twiddled the state of https://code.launchpad.net/~ajorgens/cloud-init/+git/cloud-init/+merge/325424 correctly17:03
smoserajorg, please write a nicer commit message. i'll make the c-i bot re-run on it and then i think it looks pretty good17:09
ajorgsmoser: mind showing me an example of a nicer commit message to emulate?17:10
ajorg(or should I pick just any from the past?)17:10
smoserjust 'git log'17:11
smoserbasically17:11
smoserSummary17:11
smoser<blank line>17:11
ajorgand that's for the merge commit? Or you want nicer messages on all the commits (or squashed)17:11
smoserMore info17:11
smoserput it on the 'Commit Message' in the merge proposal17:11
smoserand then i will squash with that commit message17:11
smosermake sense ?17:11
ajorgk, I can do that17:11
smoserblackboxsw, i'd appreciate a review from you on https://code.launchpad.net/~ajorgens/cloud-init/+git/cloud-init/+merge/32542417:13
smoserpowersj, https://jenkins.ubuntu.com/server/view/Cloud-init/job/cloud-init-centos-6/32/consoleFull17:14
powersjsmoser: sup17:14
smoser^ that job, can you give me an explanation of what it does ? i think that is supposed to be unit test on trunk ? right ? and eventually i think move to use run-centos ?17:15
powersjsmoser: yes, exactly. Unit test + build17:15
powersjthe run-centos is broken atm because it is missing a dependency. I was going to wait on blackboxsw merge for dependencies to fix that up, to remove the hard-coded ones17:15
smoserok.17:16
ajorgsmoser: okay, I think I made the commit message better. Please be critical if I failed.17:20
smoserajorg, thanks.17:22
smoseri responded there. will wait for blackboxsw but other than that, great.17:22
ajorgcool, I'll try to prep a couple more of our smaller fixes today17:26
=== sambetts is now known as sambetts|afk
blackboxswsmoser: reviewing ajorgen's branch now17:46
blackboxswthx BTW ajorg17:47
ajorgI'm super happy to be pushing our fixes upstream again finally.17:47
ajorgWe have larger ones too, but I want to learn how you like to do things on smaller ones.17:48
blackboxswthe more the merrier. I'm learning too.17:54
dpb1ajorg: what are some of the larger ones?17:57
ajorgdpb1: lemme look so I can give you an example...17:57
* dpb1 nods17:58
ajorgAh, best example: I have a large patch for the migrator module that allowed us to seamlessly upgrade from 0.5 to 0.7.x. I had to restructure some things.18:00
ajorgWe also have some patches that add compatibility for how our fork of cloud-init worked before RPM / Yum support was added upstream18:01
ajorgSome of those may be less useful generally.18:01
dpb1ajorg: ah, so re-basing those and see what was unique18:02
ajorgWe have a new feature too.18:02
ajorgRight. Upstream took a different path, but we didn't want our customers to break, so we had to add some compat.18:02
ajorgWe have a new feature (write-metadata) that we use to write out /etc/yum/vars/* to configure repositories.18:03
ajorgAnd we have a feature that lets the user choose what level of security updates to install by default.18:04
ajorgOther than that it's mostly small bugfixes.18:04
ajorgSome more important than others.18:04
rharperlarsks: do you have a pointer to your downstream systemd unit files for cloud-init?  I'd like to take a look at those instead of fumbling to come up with what you already have working18:05
dpb1ajorg: that level of security updates to install sounds interesting18:16
smoserrharper, http://pkgs.fedoraproject.org/cgit/rpms/cloud-init.git/18:23
rharpersmoser: thx18:25
rharperhrm, we don't have something equivalent  to 'networking-wait-online.target'  ;  the rhel network service starts bringing up interfaces, but the network-online.target only requires that network.target has been reached, so, cloud-init.net runs before networking is completely up18:53
dpb1rharper: sounds bad18:56
rharperwell, it's a known problem; it's a matter of how to wait effectively18:57
* rharper looks into ifup on rhel 18:57
blackboxswsmoser: ajorg just finish review on https://code.launchpad.net/~ajorgens/cloud-init/+git/cloud-init/+merge/325424   see what you think19:10
blackboxswI wanted to use with_logs more if we could instead of mocking logging19:11
blackboxswhttp://paste.ubuntu.com/24843185 specifically for that branch19:11
* ajorg looks19:12
smoserblackboxsw, did you test your s?19:21
smoserdecode_perms has a somewhat silly signature (which we could change) where you pass in a 'log'19:22
blackboxswsmoser: ajorg I ran tox on my patch ________________________________________________________________________________ summary ________________________________________________________________________________19:22
blackboxsw  py27: commands succeeded19:22
blackboxsw  py3: commands succeeded19:22
blackboxsw  flake8: commands succeeded19:22
blackboxsw  xenial: commands succeeded19:22
blackboxsw  pylint: commands succeeded19:22
blackboxsw  congratulations :)19:22
blackboxswooops19:22
ajorgblackboxsw: yeah, that looks good to me, pushing that soon19:22
blackboxswsmoser: +1 on that thought. I felt the same19:22
ajorg(to my branch)19:22
smoser oh. i see. you did the self.logger19:22
blackboxswjust didn't want to hold up ajorg's branch for that sentiment (about logging)19:22
smoserer... i dont see.19:23
smoseroh.19:23
smoseri do19:23
smoserget with the program, smoser19:23
blackboxswyeah self.logger comes now out of tests.unittests.helper19:23
blackboxswheh19:23
smoseri say we change the signature19:24
smoserbut i do think you're being overly pedantic/brittle on19:24
smoserself.assertEqual("WARNING: Undecodable permissions '999', returning default None\n", ...)19:25
smoser(linke 113 of your paste19:25
smoseri would (and did) assertIn19:25
blackboxswsmoser: works for me I was only trying to keep with the fact that len(warnings) was being used in your tests (to assert that we didn't have more than 1 warning in the log). But yes that was overly pedantic. assertIn would work instead of assertEqual when checking logs. we don't really have to count # of warnings etc in unit tests.19:26
ajorgSo http://paste.ubuntu.com/24843292/19:27
smoserblackboxsw, true.19:27
smoseri guess i was *as* pedantic19:27
smoserajorg, yeah, that looks fine to me.19:28
blackboxsw+1 from me ajorg19:28
blackboxswheh, I just like passing the scapegoat smoser19:28
* ajorg reruns tox because Jenkins is a cruel master19:28
ajorgk, pushed that latest, anything I need to do on the merge proposal to push it along?19:34
powersjajorg: as long as it is in "Needs review" and not "work in progress" you should be good to go. I usually do like to add a comment to the merge so folks see I addresses the changes.19:35
ajorgpowersj: thanks19:36
ajorgso I'm confused by the distros / os families thing. I've got 'amazon' added to the 'redhat' os family, and there's a module (cc_resolv_conf.py) that has distros = ['fedora', 'rhel', 'sles'] ...21:50
ajorgI thought that changing that to distros = ['redhat', 'sles'] would enable it for 'amazon', but it doesn't.21:50
rharperajorg: the distro tag is mostly for documentation, IIRC, if you want a module to run, then you need to update /etc/cloud/cloud.cfg ; in there the modules list for each stage (local, init, config, final) is what controls which modules run21:53
ajorgrharper: I get stages.py[INFO]: Skipping modules ['resolv-conf'] because they are not verified on distro 'amazon'.  To run anyway, add them to 'unverified_modules' in config.21:54
rharperinteresting, if amazon is like rhel, then you shouldn't needed it per the documentation which suggests that sysconfig to manage resolv.conf21:54
rharperbut it sounds like you can add a 'unverified_modules: ['resolv_conf'] to the user-data to make it work21:56
* rharper looks up unverified-modules in the code21:56
ajorgrharper: we don't use that specific module by default. we had a customer specifically ask that we enable it for them21:56
rharperack21:56
ajorgThere's another module (cc_spacewalk) that has 'redhat' in the distros list. My hunch is that it doesn't work on 'rhel'21:56
rharperyeah, looks like the stages code will check21:56
ajorgrharper: I'm less worried about how to let a customer us an unverified module than I am about understanding how that distros list in a module is used to decide if it's verified.21:57
ajorgIf I'm wrong that 'redhat' is supposed to enable both 'rhel' and 'fedora' then I'll be on my merry way.21:58
rharperI'd say it get's set in merge of contributions21:58
ajorgI'm trying to figure out if there's a bug or a misunderstanding21:58
rharperajorg: it's likely a bug here, the distro names and variants can mismatch, a distro variant of 'redhat' should match 'rhel'21:59
rharperajorg: it's likely a bug here, the distro names and variants can mismatch, a distro variant of 'redhat' should match 'rhel'21:59
rharpersorry for the dupe22:00
ajorgI'll try to find out if it's something that broke recently.22:00
rharperok22:01
ajorgah, will have to revisit it tomorrow though, got a meeting22:01
rharperpython -c 'import platform; print(platform.linux_distribution()[0].lower())'  that's what gets the distro value, and then in cloudinit/util.py there's a mapping of variants22:01
ajorgbe back tomorrow, thanks for help today!22:02

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