/srv/irclogs.ubuntu.com/2014/03/10/#juju-dev.txt

waiganimorning axw01:20
axwwaigani: morning01:20
waiganican I ask you a quick golang question?01:20
axwcertainly01:21
waiganiI'm being stupid again (somewhere!): http://play.golang.org/p/lIn3HvcBNI01:21
waiganiI thought interface{} was like a type wildcard?01:21
axwyou can assign any type to interface{}, but this is different... *thinks how to phrase*01:22
davecheneyaxw: you can assign any value to a variable of type interface{}01:23
axwyes, value not type...01:23
davecheneywaigani: you can't do what you tried there because map[x]x and map[y]y are differetn types01:23
davecheneyin real terms, they have different layouts in memory01:24
davecheneywhat you tried to do won't work because go doesn't have type polymorphism01:24
waiganiright so the map as a whole is taken as one type?01:24
axwyes01:24
davecheneyyup01:24
davecheneymap, slide, array, chan01:24
waiganihmmm01:24
waiganiso is there a smarter way to do what I was trying to do?01:25
axwcopy each key/value01:25
thumperdavecheney: https://code.launchpad.net/~thumper/juju-core/no-proxy/+merge/210098 for you local issue01:25
davecheneythumper: ta01:25
axwwaigani: just do a range and assign each k/v01:25
davecheneywaigani: you can delete from a map as you range over it01:25
axwwaigani: what are you actually trying to do though?01:26
davecheneyyou could write a very long complicated functoin that does that via reflect, or just write01:26
davecheneyfor k,v := range m { if k == "whoot" { delete m[k] } }01:26
waiganiright, so your saying don't bother writing the generic function01:26
axwpretty much01:26
waiganiokay01:27
waiganidavecheney: "you can assign any value to a variable of type interface{}" - any value of any type? I'm missing something?01:27
waiganidavecheney: will that variable then have the type of the new value?01:28
davecheneywaigani: eh ?01:28
davecheneyvar v interface {}01:28
davecheneyv = something01:28
davecheneyv's type remains interface{}01:28
waiganiokay, cool got you.01:29
waiganithanks01:29
waiganilast question, if something was of type string and I tested v to be a string - would that be true or false?01:30
waiganidavecheney: ^01:30
axw_, ok := v.(string)   -- ok will be true01:30
axwif you assigned a string01:30
axwthe interface value remembers the type of the assigned value01:31
davecheneywaigani: http://play.golang.org/p/qsXniVhWSa01:31
davecheneys/remembers/stores01:31
thumperaxw: standup01:32
axwcoming01:32
axwstorage, memory, same thing.01:32
davecheneyremembers == ooh spookey magic01:32
davecheneystores == how it really works01:33
davecheney:)01:33
thumperwaigani: https://launchpad.net/juju-core/+milestone/1.18.001:44
waiganithumper: thanks01:45
thumperwallyworld_: here is the golxc branch https://code.launchpad.net/~thumper/golxc/clone/+merge/20979001:55
wallyworld_ok01:55
wallyworld_thumper: there are no tests for non nil extra args. should there be a test that at least checks that the args are assembled correctly ie "... extra args -- template args"02:03
thumperhmm...02:07
thumperok02:07
thumperwallyworld_: I wish I had the cleanup suite for that02:08
thumper...02:08
wallyworld_thumper: do you agree we should have the extra test?02:08
thumperI'd like to see a test that shows the command line being called02:09
thumperwe have some in juju02:09
thumperwhere we patch PATH, and create a command that echoes the args02:09
thumperso you can have a test that the command is being called with the right args02:10
wallyworld_yeah, that's what i'd like02:10
* thumper thinks02:10
thumperperhaps I should make "github.com/juju/testing"02:10
thumperthat has the cleanup suite and checkers from trunk02:10
wallyworld_that would be useful02:11
wallyworld_why should juju-core get all the toys02:11
thumperwell, more goose, goaws, etc02:11
* thumper goes to make the repo02:11
wallyworld_that's what i mean - why should juju-core be the only project with the cool stauff02:11
thumperhaha02:12
thumperI already made the repo02:12
thumperjust haven't stuck anything in there02:12
waiganiHow do you get a logger.Warningf message in testing? I need to assert it.02:35
waiganiI  saw ctx := testing.Context(c), but it seems that captures the output from a cli command.02:35
waiganihere is my test: http://pastebin.ubuntu.com/7065333/02:36
waiganic.GetTestLog() works! YAY :)02:40
thumperwallyworld_: https://github.com/juju/testing02:55
thumperdoesn't have checkers yet02:55
wallyworld_ok, give me a minute to finish a mp response comment02:55
wallyworld_great. let the mass migration begin :-)03:01
thumperthat's fine, I'll look to add a function for the "make me a fake exec" that we've used a lot03:01
waiganithumper: https://codereview.appspot.com/7336004303:01
waiganithanks for ploughing through the monster branch axw03:47
axwnp03:48
waiganithumper: https://codereview.appspot.com/73390043 (I've got a question in there)03:48
thumpergot a question where?03:54
thumperoh, that's a different one...03:54
thumperwaigani: can I get you to consider suspend and resume commands?03:57
thumperfor juju-local03:57
waiganithumper: okay ...03:58
thumperwaigani: :-)03:58
thumperdon't worry, it'll be fun03:58
thumperalthough there are a few interesting edge cases03:58
waiganiit always is ..03:58
thumper:)03:58
waiganithere always are ..03:58
waiganithumper: did you want to put the details in the review?03:59
thumperhttps://code.launchpad.net/~thumper/juju-core/autostart-containers-after-creation/+merge/21009904:00
thumperwaigani: this ^^ is the one we should land first04:00
waiganithumper: I forgot to take out AutoRestart() - I was just using it to debug/test04:04
waiganithumper: are you asking me to review your branch, I'm not sure if I'm ready for that :/04:07
thumperwaigani: no04:15
thumperwaigani: I'm asking you to wait :-)04:15
thumperwallyworld_: can I get you to look at this? https://code.launchpad.net/~thumper/juju-core/no-proxy/+merge/21009804:31
wallyworld_sure04:31
wallyworld_thumper: i would have looked but i thought you were getting someone else to look04:32
thumperwallyworld_: looks like dave didn't04:32
wallyworld_np04:32
dimiternjam, hey, i'll be 10m late for the 1-1 sorry07:31
dimiternaxw, hey07:45
dimiternaxw, what do you suggest as an appropriate place for these 2 scripts? utils/ssh/testing ?07:46
axwdimitern: hey. I think it should be close to environs/manual, if not inside07:46
axwdimitern: why not just expose the scripts from environs/manual, and add the testing code in environs/manual/testing?07:47
dimiternaxw, ok, i'll try that - i was having issues with import loops07:47
axwah07:47
axwI did try that at one point, maybe that's why I didn't finish it.. can't remember now07:47
dimiternaxw, the whole point of the change was to get rid of gocheck deps in production code - because of that we were importing gocheck's gnuflags, and since they're global juju commands were affected07:48
axwoops :\07:49
jamdimitern: I actually didn't expect you on today, since you get 1-2 days off for sprinting07:49
axwdimitern: I understood the intent (didn't realise that problem), the only issue I have is putting non-ssh-related things in utils/ssh07:49
dimiternjam, oh, i wasn't sure it about that :) i actually did some work yesterday, but perhaps I'll take a swap day this friday07:50
dimiternjam, should we have the 1-1 anyway?07:50
jamdimitern: we can if there's stuff you want to talk about, we did just see eachother 3 days ago :)07:52
dimiternjam, yep, let's skip it then :)07:52
dimiternwwitzel3, hey, just so you know - it's not needed to call lbox propose after each commit, what I usually do is go review the comments, do them all, answer them, doing one or more commits and finally do lbox propose (without posting the draft comments, as lbox does that for you)08:16
wwitzel3dimitern: yeah, it wasn't intentially .. I just kept seeing things I wanted to fix after I self reviewed it.09:44
dimiternwwitzel3, i know the feeling :)09:54
dimiternfwereade, wwitzel3, voidspace, mgz, jam, standup?10:47
jamdimitern: I think most people are away, but I'll join you in just a sec10:48
wwitzel3dimitern: I can't seem to get in to the call10:49
dimiternjam, yeah, i guess so - just pinging10:49
mgzI'll be in10:49
voidspacedimitern: coming10:49
voidspaceI need to find headset though10:49
natefinchwwitzel3: it can be tricky, try logging out of your gmail and log into canonical10:50
wwitzel3natefinch: I did that, I even opened up a private browser session and tried that.10:50
voidspaceaccording to hangouts I'm the only person here10:52
voidspaceam I in the right place?10:52
natefinchvoidspace: nope10:52
dimiternwwitzel3, are you logging in with your @canonical account?10:52
natefinchvoidspace:  retry10:52
voidspacenatefinch: I used the link from the calendar10:52
voidspacewill retry10:52
natefinchvoidspace:  thats the one, but sometimes it's finicky10:52
voidspaceah, so dimitern sent me a link10:53
voidspaceit says "you're not allowed to join this video call"10:53
voidspacefrom the calendar it uses my canonical id - but goes to the wrong place10:53
dimiternvoidspace, using your @canonical account?10:53
voidspacefrom a direct link it uses the wrong account10:53
voidspacedimitern: well, I'm logged into both10:53
voidspaceI will try a different browser10:53
dimiternvoidspace, log off from both and login in the @c first, that way it's the default10:54
voidspacedimitern: I am logged into multiple google services - making canonical my default would be very inconvenient :-)10:54
voidspaceI'll use another browser10:54
dimiternvoidspace, yeah, that's the alternative10:54
voidspacefor online services the calendar links always worked fine so I didn't need to10:55
voidspacedimitern: natefinch: same result - only logged into Canonical10:56
voidspace"you aren't allowed to join this video call"10:56
dimiternvoidspace, i'll invite you10:57
voidspacegoing to plus.google.com shows me definitely logged in with my canonical id10:57
voidspacedimitern: cool - thanks10:57
voidspaceyay10:57
voidspaceno audio though, fiddling with the settings :-)10:58
voidspaceI have audio10:58
voidspace:-)10:58
wallyworld_mgz: did my email about joyent make sense?11:29
mgzwallyworld_: I must confess to having opened it in a tab, gone, "that's long, I'll come back to it later"... and not having read it properly yet11:31
wallyworld_lol, np :-)11:31
wallyworld_tl;dr; we still have work to do11:31
mgzokay, so, it's actually pretty good progress11:32
wallyworld_i got it starting a bootstrap instance but ssh ing in to run the scripts fails11:32
wallyworld_and i had to hack the header date11:32
mgzyou had to fix a bunch of tings, but are at the bootstrap starts an instance stage, next is working out why ssh in doesn't work11:33
wallyworld_otherwise it barked with a timestamp skew error11:33
wallyworld_i also didn't see any tools metadata issue, which was the reason i was asked to help11:33
wallyworld_but yes, it's progress :-)11:34
wwitzel3added a test for TargetRelease if someone can take a look https://codereview.appspot.com/72270044/11:51
mattywfwereade, ping?12:36
natefinchmattyw: pretty sure he's out today12:36
mattywnatefinch, ah ok - no problem, thanks12:37
natefinchmattyw: welcome12:38
mattywnatefinch, in one of my code reviews fwereade suggested that I should pull out the admin user name "admin" into a const - I was going to ask if he had any idea where it should live - do you have any opinion?12:39
natefinchmattyw: depends on where and how it is used12:39
mattywnatefinch, I'm working on api calls to add/remove users - but there are places where the admin user is going to be a special case at the moment12:41
mattywnatefinch, it's only related to the apiserver at the moment I think12:41
natefinchmattyw: if it's only used in a single package, just make it a non-exported const for now, it just makes it easier to refactor, and make sure it doesn't get typoed.12:43
mattywnatefinch, do you have much experience with the client side of the api? do you know what william might be by unpacking the error?: https://codereview.appspot.com/61620043/patch/110001/12000713:37
=== bloodearnest_ is now known as bloodearnest
natefinchmattyw: I'm not sure familiar with the client API code, but looking at other examples, it looks like if you expect a maximum of one error from the api. you can call OneError() on the params.ErrorResults that is returned, and it'll return an error interface, which you can then return from your function14:16
natefinchmattyw: like this: func (m *Machine) EnsureDead() error {14:16
natefinchvar result params.ErrorResults14:16
natefinchargs := params.Entities{14:16
natefinchEntities: []params.Entity{{Tag: m.tag}},14:16
natefinch}14:16
natefincherr := m.st.caller.Call("Machiner", "", "EnsureDead", args, &result)14:16
natefinchif err != nil {14:16
natefinchreturn err14:16
natefinch}14:16
natefinchreturn result.OneError()14:16
natefinch}14:16
mattywnatefinch, the OneError() function returns an error if there's not on error in the result though doesn't it - so if there are > 1 errors (because it's part of a bulk call) then you won't get the error you expect?14:17
natefinchmattyw: yeah. it's only valid for non-bulk calls.. .but it looks like add user and remove user are just single calls14:21
mattywnatefinch, I guess they are actually - the server supports bulk calls but the client only allows single calls at the monent14:23
mattywnatefinch, that hadn't actually crossed my mind - thanks for helping out14:24
natefinchmattyw: Probably best to just follow the pattern the other API methods use.14:24
mattywnatefinch, that's normally a good plan14:27
jamespagefwereade, sinzui: gonna give me a clue as to when I might expect to have to go ask the release team for a freeze exception for 1.18?15:12
sinzuijamespage, 4 to 9 days. We will release 1.17.5 in a 1+ days. If we think it is stable enough, it becomes 1.18.015:15
jamespagesinzui, ok15:15
sinzuijamespage, I don't think it will be, I still see regressions, So I believe 1.18.0 will be 1.7.5 + some discrete fixes15:16
jamespagesinzui, ack15:16
sinzuiwhich reminds, me, time to rename 1.18.0 to 1.20.0. The new 1.18.0 will have only the crucial regressions and tests targeted15:17
wwitzel3I just spent 50 minutes on a failing test that was = vs := .. because the scope of the for was modifying the function scoped variable of the same name. lolcry16:38
=== Ursinha is now known as Ursinha-afk
natefinchwwitzel3: you'll get used to the := vs. = .... it's tricky at first, but after a while it becomes a lot more obvious, and you just pay more attention to := inside conditionals.17:47
wwitzel3natefinch: yeah, I figured as much, it just made me feel dumb when I finally noticed it.17:53
=== Ursinha-afk is now known as Ursinha
natefinchwwitzel3: pretty much everyone who writes Go code has done the same thing one time or another.17:53
thumpermramm: morning19:43
thumpermramm: seems like you had daylight savings19:43
thumper8am isn't such a good time for me :)19:43
mrammsure19:43
mrammI have another meeting in 15 min19:44
mrammcan we push ours back another hour?19:44
mrammto 1:15 from now19:44
mrammthumper: ^^^^19:47
thumpersounds good19:47
natefinchthumper: daylight savings time in the spring is nice.  I get up at the same time, but the clock says it's an hour later.19:58
* thumper growls20:23
thumper10 minutes chasing a dumb bug because I used "print" in the bash script instead of "printf"20:23
natefinchhaha20:23
natefinchthumper: ..... bash script ....      <- there's your problem20:24
hatchthe bigger problem there is 'bash script' ;)20:24
hatchlol ^520:24
natefinchnice20:24
thumperit is being tested in Go, does that help?20:24
hatch:)20:25
natefinchthumper: not really20:27
thumperhaha20:27
* thumper ignores natefinch20:28
natefinch:)20:28
mwhudsoncould be wore, could be csh!20:28
mwhudsonor perl20:28
natefinchthumper: serious question, though.  Any idea why I wouldn't be able to connect to an Amazon juju environment?  bootstrap says it's timing out trying to ssh in.. though if I manually make an amazon instance I can ssh in just fine.20:29
thumpernatefinch: nope, sorry20:30
dimiternthumper, hey, I've got a review for you when you have 15m :) https://codereview.appspot.com/72860045/20:36
* dimitern steps out20:36
* natefinch EODs21:04
thumperwallyworld: can you kick the bot?21:51
wallyworldok21:51
wwitzel3thumper: you know why this isn't being picked up by the bot? https://code.launchpad.net/~wwitzel3/juju-core/lp-1289316-lxc-maas-precise/+merge/209974 ?22:12
thumperbot is fubard22:12
wwitzel3ahh22:12
thumperwwitzel3: wallyworld was going to kcik it22:12
wwitzel3thumper: I thought it might of fixed itself since I saw the merge for your branch.22:13
thumperoh, yay it landed22:13
wwitzel3:)22:13
* thumper actually looks22:13
thumperwwitzel3: it takes a few minutes for the tests to run22:14
thumperperhaps 15-2022:14
thumperso wait a bit22:14
thumperit was fubared22:14
wwitzel3wwitzel3: Ok, I set it approved a couple hours ago, didn't know the bot was fubar then22:15
wwitzel3oops thumper22:15
wallyworldthumper: i did kick it22:22
thumperyeah I see that22:22
thumperthanks22:22
thumperwallyworld: wwitzel3 didn't realize and was waiting for his branch to land22:22
wwitzel3wallyworld: it seems to be working now22:22
wallyworldah ok22:22
wallyworld\o/22:22
wwitzel3thumper: I am getting a failure on the bot, juju-core/replicaset: error getting replset config : no reachable server22:24
wwitzel3thumper: but I am unable to replicate that behavior locally22:24
* thumper sighs22:25
thumperyeah22:25
thumperintermittent failure22:25
thumperI get it sometimes22:25
thumperyou have two choices22:25
thumperfix it22:25
wwitzel3thumper: ok, I will ticket it or + the bug22:25
thumperor click approve22:25
wwitzel3thumper: click approve where? I've createda bug for the intermitten failure and I'm going to approve this.22:31
thumperon the merge proposal near the top, from needs-review to approved22:32
wwitzel3thumper: ahh ok, just to put back in the queue22:33
* thumper nods22:37

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