/srv/irclogs.ubuntu.com/2015/07/17/#cloud-init.txt

=== zz_natorious is now known as natorious
=== natorious is now known as zz_natorious
openstackgerritDaniel Watkins proposed stackforge/cloud-init: Convert reporting handlers to be instantiated.  https://review.openstack.org/20296010:14
openstackgerritDaniel Watkins proposed stackforge/cloud-init: Implementation of a simple registry.  https://review.openstack.org/20299011:53
openstackgerritDaniel Watkins proposed stackforge/cloud-init: Convert reporting handlers to be instantiated.  https://review.openstack.org/20296012:08
smoserOdd_Bloke, what is ropeproject ?13:24
smoserhttps://review.openstack.org/#/c/202960/2/tox.ini13:24
Odd_Blokesmoser: A Python refactoring library which vim can use.13:35
smoseryou can teach me how to use that sometime.13:36
smoserplease13:36
smoserdo you have any idea why py26 was broken and is now fixe d?13:37
smoserie, initially jenkins https://review.openstack.org/#/c/202576/ failed. the 'review' comment made it happy13:37
smoserer.. recheck13:37
=== Hazelesque_ is now known as Hazelesque
Odd_Blokesmoser: It looks like a new version of mock was released between the first and the second.13:58
Odd_Bloke1.1.3 is installed in the failing one, and 1.1.4 in the succeeding one.13:58
Odd_BlokeWhich would make sense; I'd heard from someone else that they'd broken 2.6 support in mock.13:58
Odd_BlokePresumably they have now fixed it.13:58
Odd_Blokesmoser: The registry is just a library thing that we can use where we need it.13:58
Odd_Blokesmoser: I'm going to use it in two ways in the reporting stuff: firstly, a registry of available reporters (i.e. mapping config names to actual classes), and secondly, a registry of the instantiated reporters (which the actual event reporting code will use).14:00
Odd_Blokesmoser: There will probably be further changes to it, but I figured getting the basic stuff out of the way would make other changes easier to review.14:01
smoseri really hate the internet14:01
Odd_Bloke?14:02
smoserOdd_Bloke, i hate that random dude on the interenet uploads mock 1.1.3 and breaks my tests14:07
smosercausing me to have to spend time figuring out why they're broken.14:07
smoseri find that anti-productive.14:07
Odd_Blokesmoser: Random dude on the Internet also wrote mock, meaning that writing our tests is much easier.14:08
Odd_BlokeSo I wouldn't be too harsh on him. ;)14:08
smoserclearly. and he probably makes less stupid mistakes than i do.14:08
smoserbut being human the number of stupid mistakes per unit of time > 0.14:09
smoserand the count of random dudes is > 014:09
smoserso the time lost on such things is definitely non-zero14:09
Odd_BlokeI'd still argue less than the cost of reimplementing everything yourself.14:10
Odd_BlokeSo net gain is positive.14:10
smoseri'm not complaining about using libraries14:10
Odd_BlokeWe should consider pinning our dependencies though.14:10
smoseri'm complaining about them moving14:10
smoseri complain when you break something in an ubuntu sru14:10
smoseri like stable14:11
smoserOdd_Bloke, i'll pll your reporting handlers instantiated14:26
smoseri know its obnoxious14:26
smoseri know its painful.. but please do not just throw additional changes in14:27
smoseryou're more than welcome to keep me honest on that also14:27
Odd_Blokesmoser: 'do not just throw additional changes in'?14:29
smoserropeproject14:29
Odd_BlokeAh, yeah.14:30
Odd_BlokeYep, will avoid doing it in future.14:30
smoserOdd_Bloke, you have a thought on how to fix http://logs.openstack.org/43/202743/1/check/gate-cloud-init-python27/1cf650f/console.html15:04
smoserhttp://paste.ubuntu.com/11893139/ is what ihave, an dit does work, but what is in that review now seems prettier15:05
Odd_Blokesmoser: Having a look now.15:09
smoserif i dont catch stderr, it goes to console15:09
Odd_Blokesmoser: Patch 'cloudinit.shell.sys.stderr' and then look at .write on the object passed to the test method.15:12
Odd_BlokeThe problem is trying to swap out just the 'write' method.15:12
Odd_Blokesmoser: Also, you have shell.py and test_main.py; would be good to make those the same name (as it took me a while to find one from the other). :)15:12
smoserk15:13
smoserso you can do 'cloudinit.shell.sys.stderr' ?15:13
smoserand that patches cloudinit.shell's usage of sys.stderr only ?15:13
Odd_BlokeYep.15:15
Odd_Bloke(Unless anywhere else is doing something stupid like 'from cloudinit.shell import sys', but that shouldn't every make it past code review :p)15:16
harlowja_at_homesmoser, https://github.com/openstack/oslotest/blob/master/oslotest/output.py is what most of openstack does for this15:20
harlowja_at_homeperhaps u can do something similar?15:20
harlowja_at_homeyes yes, i know, more fixtures :-P15:20
harlowja_at_homebut something like https://github.com/openstack/oslotest/blob/master/oslotest/output.py#L46 might work for u15:20
openstackgerritMerged stackforge/cloud-init: Convert reporting handlers to be instantiated.  https://review.openstack.org/20296015:25
openstackgerritMerged stackforge/cloud-init: README.rst: mention bugs are tracked in launchpad  https://review.openstack.org/20257615:26
openstackgerritDaniel Watkins proposed stackforge/cloud-init: Implementation of a simple registry.  https://review.openstack.org/20299015:32
openstackgerritDaniel Watkins proposed stackforge/cloud-init: Use a registry to configure reporting handlers.  https://review.openstack.org/20309315:38
openstackgerritDaniel Watkins proposed stackforge/cloud-init: Implement a DictRegistry.  https://review.openstack.org/20309415:38
smoserharlowja_at_home, Odd_Bloke http://paste.ubuntu.com/11893290/15:39
smoserthat looks pretty nice, and works in py27 and py34, but raises15:39
smoser http://paste.ubuntu.com/11893291/15:39
smoseron py26.15:40
smoseri believe that we discussed something about this , but i am not recalling details.15:40
Odd_Blokesmoser: This comes back to my not wanting to use testtools' TestCase, because you can't use that assertRaises syntax on 2.6.15:40
Odd_Bloke(Whereas you can if you use unittest2.TestCase)15:40
harlowja_at_hometrade-offs either way15:41
smoserok. i'll avoid it for now. it does look pretty though :)15:41
Odd_Bloketesttools should be using unittest2 by default (at some point).15:44
Odd_BlokeOh, it does.15:45
Odd_BlokeBut overrides the context-manager assertRaises. /o\15:45
smoserOdd_Bloke, http://paste.ubuntu.com/11893330/15:50
smoserthat works, does it seem sane to you ?15:50
Odd_Blokesmoser: You should be able to do something like 'sys_exit_exc = self.assertRaises(SystemExit, ...)', but I'm happy with that.15:51
Odd_Blokesmoser: Though maybe go for 'assertIsNotNone' instead of 'assertTrue', to make it clearer that you're trying to avoid the value you set initially.15:52
smoseri tried that.15:53
smoserAttributeError: 'TestMain' object has no attribute 'assertIsNotNone'15:53
Odd_BlokeEverywhere or on 2.6?15:53
smoser2.615:53
Odd_Bloke*flips table*15:53
smoserOdd_Bloke, with self.assertRaises ...15:53
smosercan i get the exception that was raised ?15:54
smosercause otherwise i can't check the .code15:54
Odd_Blokesmoser: Yeah, it should return it.15:54
smoseroh. i didn't realize that. nice.15:54
Odd_Blokesmoser: But maybe not on Python 2.6, because apparently everything I know about unittest isn't true there. ;)15:54
smoseri dont think it does.16:00
smoserhttp://paste.ubuntu.com/11893374/16:03
smoserproduces http://paste.ubuntu.com/11893375/16:03
smatzek_unittest lacks various assert methods in 2.6 and it's a pain.  I ended up having to write my own that mimiced the 2.7 methods in a parent test class to UT on 2.6 when my project used to support that level.16:04
Odd_Blokesmoser: What about with testtools.TestCase?16:04
smoseryeah, there its fine.16:05
Odd_BlokeRight, that's the superclass of cloud-init's TestCase.16:06
Odd_BlokeSo you _should_ be fine.16:06
Odd_BlokeBut, again, YMMV. :p16:06
Odd_Blokesmatzek_: unittest2 FTW. :)16:07
Odd_BlokeUnless you're working on a project with harlowja_at_home, apparently. ;)16:07
harlowja_at_homeand/or all of openstack, lol16:07
Odd_Blokeharlowja_at_home: Aren't those the same thing? :p16:08
harlowja_at_home:)16:08
harlowja_at_homeperhaps, hahaha16:08
* harlowja_at_home pumps out various thousands of lines of code a day (under different names)16:08
harlowja_at_homedon't tell anyone....16:08
Odd_BlokeI've never actually seen harlowja_at_home in the same room as anyone else.16:08
harlowja_at_homewhy testtools overrode assertRaises u got me16:08
Odd_BlokeSo you could theoretically be everyone.16:09
Odd_BlokeThat's hard science.16:09
harlowja_at_homequantum space-time16:09
Odd_Blokeharlowja_at_home: I'm guessing it was for 2.6 backwards compatibility before they used unittest2.16:09
harlowja_at_homeprob16:09
harlowja_at_homeand the api stuck16:09
harlowja_at_homeand thats how the story was written16:10
Odd_BlokeWell, it's their own implementation of assertRaises.16:10
Odd_BlokeSo it would probably take work to make it a context manager.16:10
Odd_BlokeSo I suspect it's just that no-one has cared. :p16:10
Odd_BlokePerhaps I'll care at some point.16:10
harlowja_at_homeya, or the api they created for assertRaises in testtools can't now be changed (since people depend on its behavior) and its just unforutante that python/unittest2 used the same name16:11
harlowja_at_homebut probably really easy to add a proxy method to the unittest2 one under a different name...16:12
=== zz_natorious is now known as natorious
Odd_BlokeYou could make it a context manager without changing the API for non-CM uses.16:12
harlowja_at_homeok, or that16:12
harlowja_at_homeget er done16:12
Odd_Bloke:p16:12
openstackgerritScott Moser proposed stackforge/cloud-init: add cloud-init main  https://review.openstack.org/20274316:24
=== natorious is now known as zz_natorious
openstackgerritScott Moser proposed stackforge/cloud-init: add cloud-init main  https://review.openstack.org/20274320:04
openstackgerritScott Moser proposed stackforge/cloud-init: improve test coverage  https://review.openstack.org/20324921:26

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