/srv/irclogs.ubuntu.com/2013/06/12/#maas.txt

=== ehw|afk is now known as ehw
_nbk_hello,10:16
_nbk_i need help to enlist the 1st node. It does not show up in the List on the controller in the Browser.10:17
_nbk_On the node screen an error message is running: "bmc-config:xxxx map pfn expected mapping type uncached-minus xxxx-xxx, got write-back"10:17
rbasakSounds like that could be a problem related to IPMI on that hardware. What hardware is it?10:21
_nbk_both boxes core i5, asus board P8H67-I10:31
_nbk_the node is booting fine from the maas-controller but after all these bmc- messages it also has a curl error about the ssl certificate10:32
rbasakWhat's the error exactly?10:47
_nbk_i could not read the error about curl and the ssl certificate so fast. i will reboot the node and try again. I have a bad netskin in my eyes :-(10:58
_nbk_syslog shows all errors about bmc-config but not the error about the ssl certificate11:00
rbasakUse a camera, perhaps?11:03
rbasakIt might be worth installing one node manually and checking that freeipmi works correctly with the BMC on it.11:03
_nbk_i use my phone to take a picture.11:04
_nbk_curl: (60) SSL_Certificate problem, verify that the CA cert is OK. Details:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed11:34
_nbk_More details here: http://curl.haxx.se/docs/sslcerts.html11:34
_nbk_i would like to use the -k (or --insecure) option on that screen because i have the self signed certificate.11:34
_nbk_so what can i do to get the 1st node enlisted?11:39
roaksoaxjtv: ping14:59
jtvHi roaksoax14:59
roaksoaxjtv: howdy!! so I was wondering something14:59
roaksoaxjtv: how to compare that {} is {} in a test?15:00
roaksoaxjtv: MismatchError: None is not {}15:00
jtvThen clearly it's not {}.  :)15:00
jtvYou can test that x is an empty dict by doing self.assertEqual(x, {})15:01
roaksoaxjtv: yeah, so I was comparing None with {}. but I want to compare that {} is {}15:01
jtvI think I may be missing something here...  one of the two must be a variable, and the other a constant, right?15:01
jtvBecause we already know that {} equals {}, although {} is not {} in the sense of the "is" operator.15:02
roaksoaxjtv: http://paste.ubuntu.com/5758477/15:02
jtvThat should work, if get_snippet_dir() really returns {}.15:02
jtvAhem — get_snippet_context15:03
jtvnog get_snippet_dir15:03
roaksoaxjtv: yeah, that worked! thanks! (and yeah was adding that test as per your recommendation)15:03
jtvAh :)15:03
jtvSome background: there's "{} == {}" (which is true),15:04
jtvand there's "{} is {}" (which is false).15:04
jtvThe reason the latter is false is that "is" compares the identity of the objects.15:04
roaksoaxjtv: test_get_snippet_context_empty_if_no_snippets ->> the test renamed like this sounds better?15:04
jtvYes, that's good.15:05
roaksoaxjtv: right, I see, similar to the 'is None' to 'if not None' case15:05
jtvYeah — there's only one None.15:05
roaksoaxjtv: btw... are the tests broken in saucy?15:05
jtvThat's why you can compare with "is None."  The "is" operator basically compares the pointers you pass it, instead of the things they point to.15:05
jtvTests should work in Saucy, I think.  But there are sometimes changes that break them.15:05
jtvWhat are you seeing?15:06
roaksoaxjtv: stuff like: http://pastebin.ubuntu.com/5758493/15:06
roaksoaxjtv: so I upgraded to saucy and tests are now broken, initially thought it was because i did something (like have maas installed), but I removed it and dunno whether it is related15:07
jtvOh dear15:08
jtvThis looks a bit as if piston's put() no longer returns anything.15:08
jtvLet me just see if I can try that on a Saucy system.15:09
roaksoaxjtv: yeah, better double check cause I did a raring->suacy upgrade which might have left something unclean, hence causing this15:10
jtvRight.  It shouldn't, but then again, there shouldn't be any failures.15:10
jtvroaksoax: seeing errors too...  :(15:23
roaksoaxboomer15:30
jtvBoomer?  Isn't that the robot dog from the original Battlestar Galactica series?15:34
roaksoaxlol no idea :)15:37
ehwer… no that was moffet15:46
ehwboomer was the (only?) African-American pilot15:46
jtvAh thanks15:49
ehwjust doing my job *tips hat*16:00
jtvroaksoax: at least some of the errors seem to be related to a change in django 1.5.  The tests seem to hang, so I'm not seeing the other ones yet.16:19
roaksoaxjtv: so I'm looking at this: https://jenkins.qa.ubuntu.com/job/maas-merger-trunk/319/console16:22
jtvHmmm16:24
roaksoaxjtv: it seems that the tests are testing the rendering of the preseeds (including the enlistment preseed, but instead of calling render_enlistment_preseed for the case of enlistment, it is calling render_preseed16:25
jtvYes, IIRC render_preseed has to decide which one it should render.16:26
roaksoaxjtv: right, that's only for commissioning or install16:27
roaksoaxjtv: but enlistment has its own render_enlistment_preseed16:27
roaksoaxjtv: since there's *no* node status for enlistment, then obviously the test would be testing the wrong stuff :)16:28
roaksoaxjtv: so we are basically saying "node.status is commissioning, but test the enlistment preseed" ((i think)16:30
jtvI don't remember what it was that drove the decision "oh, this node is enlisting" but we'd probably have a comment to mark the spot.16:31
roaksoaxjtv: oh no, i know wthat the issue is.16:31
jtv?16:31
roaksoaxjtv: so the running code calls render_enlistment_preseed for enlistment, and for everything else, render_preseed is called16:31
roaksoaxjtv: however, the tests are testing for the enlistment preseed using render_preseed16:32
jtvAh.  Maybe the test could assume at some point that the status didn't matter, and that changed?16:33
roaksoaxjtv: so the status always matters, if a node enlist then it has no node status16:34
roaksoaxjtv: so the test is testing depending on PRESEED_TYPE,16:34
roaksoaxjtv: http://pastebin.ubuntu.com/5758742/ --> you'll find the explanation there16:36
jtvDamn non-wrapping pastebin...16:37
roaksoaxyeah!16:38
roaksoaxjtv: so see what I mean? so test_render_preseed should only test for escenarios with COMMISSIONING, DEFAULT preseeds, while test_enlistment_preseed should test for ENLIST and ENLIST_USERDATA16:39
jtvI have no idea why load_preseed_template consists of exactly (1) an enclosed function definition and (2) a call to that function.  I feel like punching someone.16:41
roaksoaxjtv: I'm guessing that the key here is that the preseeds (default, commissioning) are being loaded depending on the node.status, while the enlistment preseeds are not16:43
roaksoaxand that's where the difference lies in the code16:43
jtvYes, I recall it being something like that.16:43
roaksoaxhowever, in the tests they do test as if both type of preseeds where the same16:44
jtvMaybe it was a matter of the node itself being None...16:44
jtvAh16:44
roaksoaxjtv: so this is what it should kinda do http://paste.ubuntu.com/5758765/ (note that it is just an example)16:46
jtvAny idea why this worked before and breaks now?16:47
roaksoaxjtv: yes, it is broken now becuase the maas_ipmi_autodetect stuff for enlistment is inserted in the context in render_enlistment_preseed, but since test_render_preseed calls render_preseed() for the enlist/enlist_userdata templates, then they cannot find the variable in the context16:49
roaksoaxjtv: so doing this would fix it: http://paste.ubuntu.com/5758777/16:50
roaksoax(or should)16:50
roaksoaxI'm gonna test that16:50
jtvDoesn't look quite right to circumvent the test scenarios like that though...16:51
roaksoaxjtv: this is what it does the test itself though: preseed = render_preseed(node, self.preseed, "precise")16:52
roaksoaxwhere self.preseed would be *all* preseeds16:52
jtvYes, IIRC the code was deliberately kept very indifferent to that.16:52
jtvMaybe the test can be split up into two scenarios?16:52
jtvOne for enlistment preseeds, one for the rest?16:53
jtvAlthough it is nice to know that all scenarios are tested, even in stupid combinations...16:53
roaksoaxjtv: in reality it is already split in 2 different scenarios16:55
roaksoaxthe problem was that the render_preseed scenario was also testing for enlistment preseeds16:55
jtvSo then maybe that could just return if this-is-an-enlistment-preseed-type?16:56
roaksoaxjtv: so how can I filter here: http://pastebin.ubuntu.com/5758815/17:01
roaksoaxjtv: something like. startswidth('ENLIST')17:01
roaksoaxto filter the nelistment preseeds out of it17:01
jtvIs the filtering appropriate for the entire test case?  Or just for some of the test functions inside it?17:02
jtvIf it's just a few test functions inside it, you can put an "if" inside the test.  For instance, you could just "return" early on if the preseed type starts with ENLIST.17:02
roaksoaxjtv: there's just 2 functions for the class that test this, and both functions uses it17:02
roaksoaxjtv: so I would say that it is necessary to filter it17:02
jtvIf it's the entire test case, then list comprehensions also support "if":17:02
jtvscenarios = [17:03
jtv        (name, {'preseed': value})17:03
jtv        for name, value in map_enum(PRESEED_TYPE).items()17:03
jtv            if not value.startswith('ENLIST')]17:03
roaksoaxjtv: ok awesome! thakns17:03
jtvGood luck...  I'll see what I can find out about the Saucy failures.17:05
roaksoaxjtv: ok this does it: http://paste.ubuntu.com/5758825/17:05
jtvroaksoax: don't forget to update those comments!  It's no longer "each possible value" of preseed type.17:06
roaksoaxjtv: http://paste.ubuntu.com/5758831/ -> alright, this way the test_render_preseed tests everything but enlistment preseeds, and test_render_enlistment_preseed() will test all enlistment preseeds other than just one17:09
jtvroaksoax: careful!  The comments should say "why" — the "what" is often clear from the code already.17:11
jtvYou could say something like "test against all preseed types, except the enlistment ones.  Those have their own test case."17:12
jtv(It may seem silly to say what's coming later in the file, but somebody who's reading it has to start somewhere and then all the other stuff is still a mystery to them)17:13
ehwdoes anyone have any go-juju maas docs I can follow? I'm having… issues getting this running17:14
roaksoaxjtv: ok, updated17:15
roaksoaxjtv: https://code.launchpad.net/~andreserl/maas/consolidate_maas_ipmi_autodetect/+merge/16780617:16
jtvLooking...17:16
jtv(diff still updating)17:17
roaksoaxjtv: done now17:17
* jtv reloads17:18
jtvroaksoax: looks like it's even going to extend enlistment-preseed test coverage a bit...  Do tests pass now?17:19
roaksoaxjtv: yeah they do17:19
jtv\o/17:20
roaksoax\o/17:20
jtvThen land it!17:20
* jtv is off17:24
=== kentb is now known as kentb-out

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