/srv/irclogs.ubuntu.com/2012/06/19/#juju-dev.txt

niemeyer_Heya00:33
=== niemeyer_ is now known as niemeyer
niemeyerandrewsmedina: ping00:34
andrewsmedinaniemeyer: PING andrews (0.0.0.0): 56 data bytes00:40
niemeyerandrewsmedina: Heya00:40
niemeyer:)00:40
andrewsmedinaniemeyer: 64 bytes from andrews: icmp_seq=0 ttl=48 time=613.936 ms00:41
andrewsmedinaniemeyer: =)00:41
niemeyerandrewsmedina: Gosh, that's a terrible ping time ;)00:41
davecheneyniemeyer: thanks for your comments on the dummy branch01:36
davecheneyi have another idea which i'll propoes for you and rog.01:36
niemeyerdavecheney: My pleasure01:36
niemeyerdavecheney: Sounds great, thanks01:36
davecheneyi'm thinking of making Operation an interface01:36
davecheneythen op.Kind becomes a type switch01:37
davecheneywill do a quick branch to see how large the change is01:37
davecheneyto me this feels better than sticking a lot of mostly zero fields in Operation01:37
niemeyerdavecheney: Sounds reasonable01:37
niemeyerdavecheney: We can also mix both01:37
niemeyerdavecheney: Having Kind() on the interface01:37
davecheneysure01:37
niemeyerBut see how it looks like..01:38
davecheneythat might be a good way to introduce it01:38
niemeyerExperimenting should tell the best path01:38
davecheneyi'll discuss it with Rog this evening01:38
niemeyerdavecheney: type OperationKind int; func (k OperationKind) Kind() OperationKind01:39
niemeyerdavecheney: ;)01:39
davecheneyindeed, it makes it easy to introduce a placeholder type01:39
niemeyer<3 Go01:39
davecheneyniemeyer: the reason I added the insts field to operation was so I could get the actual *instance01:40
davecheneyin general, do you think this is a sane way of doing it01:40
davecheneyit might require instance to define some sort of equality01:40
niemeyerdavecheney: I think it's reasonable.. for that specific case, you might as well have opened the environment a second time01:40
niemeyerdavecheney: and retrieved the instance from the env itself01:40
niemeyerdavecheney: But I don't think that works for everything01:41
niemeyerdavecheney: E.g. you might as well take the chance to check the machine id (!)01:41
niemeyerdavecheney: It's a sane field to stick in the candidate StartInstanceOp struct type01:41
davecheneybut not a good case for all operatoins01:41
niemeyerdavecheney: and that kind of thing starts to get boring to check on the environment01:41
niemeyerdavecheney: We'll have more of those over time01:42
niemeyerdavecheney: E.g. constraints, etc01:42
niemeyerdavecheney: Which are easier to take them out of the operation type than from querying the env externally01:42
davecheneyniemeyer: https://codereview.appspot.com/631504301:42
davecheneymercifully shorter01:42
davecheneywill propose this afternoon01:42
niemeyerdavecheney: Hm?01:53
niemeyerdavecheney: I've LGTMd it :)01:53
niemeyerdavecheney: Looks good overall, anyway01:54
niemeyerI'll head to bed now01:54
niemeyerNight all01:54
davecheneyniemeyer: night01:56
rogdavecheney: hiya06:14
rogdavecheney: the possibility of making Operation an interface was always there, but i didn't want to complicate things prematurely06:15
rogdavecheney: you might also consider adding an "Error() error" method, because ISTR that some test code relies on knowing that the operation has been invoked even though it returns an error06:18
davecheneyahoy!06:22
davecheneyrog: did you catch the conversation with gustavo ealier ?06:22
rogdavecheney: yeah06:22
davecheneyI had a quick crack at making Operation an interface and it isn't that horrible06:23
davecheneydozens of lines, not hundreds06:23
rogdavecheney: i did a similar thing with file operations some time ago06:23
davecheneyif you think it sounds good in principal, i'll polish it up and propose06:23
davecheneyrog: so the PA can now start and stop machines06:24
rogdavecheney: yeah, i think that sounds better than arbitrarily putting Instances in Operation, actually06:24
davecheneywhat is stopping us trying to bootstrap an environment ?06:24
rogdavecheney: cool. have you tried using it for real?06:24
davecheneyrog: yeah, then we can have concrete impls of operation that contain only the fields they need06:25
rogdavecheney: just the code in cloudinit06:25
rogdavecheney: yeah06:25
davecheneyrog: i agree that having a bunch of fields which are only valid in some circumstances is a code smell06:25
davecheneyand exactly what go interfaces avoid06:25
rogdavecheney: yup06:25
davecheneysounds like a solid case to proceed06:26
rogdavecheney: i just had a dream in which i was vigorously trying to defend Go interfaces against discriminated unions to an old work colleague :)06:26
rogdavecheney: while wandering through a forest full of fungi...06:27
rogdavecheney: strange06:27
* davecheney is speechless06:27
davecheneyso, lets change the subject to cloud init06:27
roglets06:27
davecheneytell me what is missing and if I can help06:28
rogdavecheney: i think that it just needs a line of code in environs/ec206:28
rogdavecheney: it might even have a TODO there06:28
davecheneycurses, we're doomed, we'll never make it06:28
davecheney:)06:28
rogdavecheney: yeah, grep for TODO in environs/ec2/*.go06:29
rogdavecheney: only problem is i think the amazon tests might currently be broken.06:30
rogdavecheney: i haven't been running them often enough (they take ages to run and only work 30% of the time anyway because of transitory errors).06:30
rogdavecheney: i need to up the timeout and ssh to the bootstrap machine to see what's going on06:31
rogdavecheney: in fact, i think i'll do that now.06:31
davecheneyrog: hotsauce06:31
rogdavecheney: congrats BTW. having the first agent done is a huge step forward!06:32
rogdavecheney: ha! found the culprit! http://paste.ubuntu.com/1048666/06:44
rogdavecheney: i've no idea why it's trying to use the dummy package in the cloud06:45
fwereaderog, davecheney: mornings06:45
rogfwereade: hiya!06:47
davecheneyrog: o_O!06:47
davecheneyrog: how much work is it to resolve that facepalm ?06:52
rogdavecheney: i hope not much. the stack traces don't seem to match the code, so i'm just sanity checking the binaries06:52
rogdavecheney: i don't know how it is ending up in that code.06:53
davecheneycould it be the old juju tree ?06:53
rogdavecheney: it's possible. i'll try again, modifying that error message...06:54
davecheneyrm -rf $GOPATH/pkg/launchpad.net/juju06:54
rogdavecheney: the binaries don't come from there06:54
rogdavecheney: it builds them on demand in a temporary directory06:54
davecheneygocheck ?06:54
rogdavecheney: gocheck?06:59
rogdavecheney: i've found the problem BTW07:00
rogdavecheney: and i think you came up with the solution a few days ago07:00
davecheneyfixitfixitfixit07:00
rogdavecheney: the problem is that provisioning.go imports the dummy environ07:00
davecheneyrog:  ... yes,07:01
davecheneymaybe it shouldn't, as long as I import it in the tests, it will work07:01
rogdavecheney: that's right07:01
* davecheney facepalm07:01
davecheneyi'll fix that shit right now07:01
rogdavecheney: i'll do it here and check that it works too.07:02
fwereaderog, I have a trivial for you: https://codereview.appspot.com/630808907:02
davecheneyrog: if you want to propse, please do, i have to run out in a second07:02
rogdavecheney: ok, will do07:02
rogfwereade: LGTM. oops.07:03
fwereaderog, np, cheers :)07:03
fwereaderog, how would you feel about me trying to factor out some sort of common topology watcher? I want a service relation watcher, and at first glance I'm going to end up duplicating most of the machines/machine-units watchers07:07
rogfwereade: i'm not convinced. i can't see that it could save more than 4 lines per watcher.07:09
rogfwereade: (the code that parses the topology)07:09
rogfwereade: what other code do you think you could factor out?07:10
fwereaderog, I was wondering whether I could get rid of the Stop and a fair amount of loop, but it might indeed not turn out all that nice07:12
rogfwereade: i'm not that keen on adding another buffered value for not that much gain07:13
fwereaderog, yeah, fair enough, I'll give it 15 mins and then take a cynical self-look07:14
rogfwereade: sounds like a good plan07:14
rogfwereade: could you check that "go test launchpad.net/juju-core/juju/..." works for you, please?07:20
rogfwereade: it's hanging up for me in jujuc/server07:20
fwereaderog, did just a few minutes ago07:20
rogfwereade: hmm.07:20
rogfwereade: oh, bizarre. i've found the problem.07:22
* fwereade concludes that, yeah, a topology watcher isn't worth the effort, and is sad about that07:23
* fwereade never expected to seriously miss c-style macros07:23
rogfwereade: there may easily be some other way to refactor all that code.07:24
rogfwereade: i had some ideas right at the beginning which might work.07:24
fwereaderog, I'll probably get annoyed with it again later today and give the tyres another kick, but it seems like it'll get a bit convoluted unless I'm careful07:26
rogfwereade: yeah, that's the potential problem.07:27
rogfwereade: here's why that test was hanging BTW. i'd changed state.zkTimeout to 45*time.Minute.07:28
rogfwereade: but... that *should not* have caused the test to hang07:28
rogfwereade: when i changed the timeout back to 15*time.Second, the dial in question succeeded after 5 seconds.07:29
fwereaderog, weird07:34
rogfwereade: for watcher refactoring, i was toying with the idea of something like this: http://paste.ubuntu.com/1048710/07:44
rogTheMue: good morning!07:45
TheMuerog: Morning rog.07:45
rogfwereade: i'm not entirely sure if it would be worth it though.07:46
fwereaderog, yeah, I was just toying again with a similar idea07:46
fwereaderog, I have a w.loop(w) in there, and that's the thing that feels a bit off really07:46
TheMueAh, and morning fwereade too.07:46
fwereadeTheMue, heyhey07:46
rogfwereade: it doesn't actually factor out that much code.07:46
fwereaderog, yeah07:47
rogfwereade: and it makes the code harder to follow, as callbacks do.07:47
fwereaderog, not so sure, there's a little more initial investment but I think once you have 3 of them it's arguable that it pays off07:47
rogfwereade: and closing the channel is awkward.07:47
fwereaderog, agreed :)07:47
rogfwereade: anyway, worth continuing to think on07:49
fwereaderog, ey up, I'm not sure about MachinesWatcher... is it ok to depend on the topology always containing at least one machine to guarantee the initial event?07:56
rogfwereade: hmm, does it?07:56
* rog goes to look.07:56
fwereaderog, looks like it does to me07:56
rogfwereade: yes, and the test agrees with you07:58
rogfwereade: that needs fixing. i should've seen it.07:58
fwereaderog, I think I reviewed that one as well :)07:58
fwereaderog, programming is hard ;)07:58
fwereaderog, btw, same applies to machine units watcher08:04
rogfwereade: ahem08:04
fwereaderog, or not?08:05
rogfwereade: definitely does08:05
rogfwereade: my fault. i blindly copied from MachinesWatcher.08:05
rogfwereade: without remembering the "first event" thing.08:06
fwereaderog, IMO once the code's reviewed the blame is distributed evenly ;)08:06
rogfwereade: and it's particularly important for machine units watcher too, as the machine agent actually acts specially on the first event.08:06
rogfwereade: good catch!08:06
rogfwereade: feel free to fix 'em both, if you like.08:07
rog:-)08:07
fwereaderog, sure08:07
fwereaderog, https://codereview.appspot.com/6295100 (again trivial IMO)08:23
rogfwereade: LGTM. i think i'd prefer "sentValue" as a name, but i see emittedValue is already used in watcher/watcher.go08:26
rogfwereade: "and -0 on ROW". do you really mean Roswell airport there?08:29
fwereaderog, I meant Rest Of World :p08:40
rogfwereade: ah!08:41
fwereaderog, I suspect I should amend it to -0 on ROW, excluding ROW, which also gets +1; but that would probably be even more confusing08:41
rogfwereade: :-)08:42
fwereaderog, yeah, I'm not too keen on emittedValue, but that was niemeyer's suggestion over "started" so I went with it08:42
rogfwereade: fine.08:42
fwereaderog, trivial enough to be a trivial?08:42
rogfwereade: i think so.08:42
fwereaderog, cool, cheers08:42
rogfwereade: i've just realised that we need some more working juju commands if we're to test the new PA08:43
rogfwereade: deploy!08:43
fwereaderog, I made a start on deploy a while ago but was blocked by lack of AddRelation08:44
fwereaderog, I guess i could switch back to that quickly08:44
fwereaderog, I'm a little reluctant to continue with my pipeline, it depends on the 2 I have out for review08:44
fwereaderog, I'd prefer to get at least one in before I propose another :)08:45
rogfwereade: couldn't we do a minimal deploy with no relations.08:45
rog?08:45
fwereaderog, my feeling was that half-working features were a no-no08:45
rogfwereade: gotta start somewhere!08:45
fwereaderog, individual features *entirely* not working is fine though ;p08:46
fwereaderog, I think I even have most of it implemented somewhere08:46
rogfwereade: "relation" is a feature :-)08:46
fwereaderog, I'll get on it now :)08:46
fwereaderog, yeah, but deploy is expected to add relevant peer relations08:47
fwereaderog, I guess I could have just done panic("can't deploy services with peer relations yet")08:47
rogfwereade: i'm sure that if you did an initial deploy implementation with "TODO" for the relations stuff, it would be acceptable08:47
fwereaderog, I think I'm actually unblocked on it now08:48
rogfwereade: a trivial for you: https://codereview.appspot.com/629510109:07
fwereaderog, LGTM09:23
fwereaderog, do we have a way t get the default series from the environ yet?09:53
rogfwereade: nope. there's no default series parsed in environs/ec2/config.go09:54
* fwereade grumbles09:56
fwereadeTODO comment I guess09:56
fwereaderog, half-implementing things really bothers me09:56
fwereaderog, I feel it's one of the biggest risks09:56
rogfwereade: it's not possible to implement everything at once09:56
rogfwereade: i started doing that originally, but there's just too much cruft and you don't know how it's gonna be used09:57
fwereaderog, yeah, but something that *looks* like it works, to a casual inspection, is IMO actually worse than something that doesn't exist at all09:57
* rog isn't sure.09:58
rogi think having something that works at all is useful in itself09:58
Arammoin.10:08
fwereadeAram, heyhey10:21
Aramso, we're nor going to brazil after all...10:22
niemeyerGooood mornings10:27
Aramheyhey.10:30
fwereadeheya niemeyer10:35
niemeyerfwereade, Aram, davecheney: Hey folks!10:36
rogniemeyer: hi10:40
niemeyerrog: Heya10:40
* davecheney hates prereqs10:48
Aramdavecheney: I replied to your named return argument note.10:49
davecheneyAram: yup, no worries10:50
davecheneyi'm glad we can agree to disagree10:51
rogniemeyer, fwereade, davecheney: here's an initial impression of the machine agent code (untested as yet). http://paste.ubuntu.com/1048896/11:00
rogniemeyer, fwereade, davecheney: am i missing something?11:00
niemeyerrog: Well, I'd prefer to review it in codereview :)11:01
davecheneyrog: line 45, line 6011:01
rogniemeyer: i have no tests yet11:01
rogniemeyer: actually, i'll propose it as wip11:01
fwereaderog, I don't think it needs to do anything else, honestly11:01
niemeyerrog: Well, write the tests?11:01
rogniemeyer: that's something i want to talk about11:02
fwereaderog, I would suggest that maybe the non-principal filtering should be done at the watcher level... do we expect any other clients?11:02
davecheneyrog: niemeyer busted by ass about making it recover if the watcher closes, so its only fair i pass on the love :)11:02
rogniemeyer: my current best idea is to add an exported function pointer to the container package that it will call to do the install.11:03
rogfwereade: no, but i think Machine.UnitsWatcher should mirror Machine.Units11:03
fwereaderog, PrincipalUnitsWatcher?11:03
rogfwereade: PrincipalUnitsForMachineWatcher :-)11:04
niemeyerrog: I'd prefer to have smaller bits going in11:04
niemeyerrog: Well tested11:04
niemeyerrog: and properly reviewed11:04
rogniemeyer: this isn't small?11:04
niemeyerrog: add the skeleton11:04
niemeyerrog: No, this is a paste with no tests11:04
rogniemeyer: it's 100 lines of code... i thought that was a reasonable size.11:05
rogniemeyer: in fact it's only 70 lines of new code.11:06
rogniemeyer: without Machiner.loop, i'm not sure there's any functionality to test11:06
niemeyerrog: If there's nothing to test, I guess we don't need the code..?11:07
* rog is feeling a bit shit.11:08
rog[12:04:14] <niemeyer> rog: I'd prefer to have smaller bits going in11:08
niemeyerrog: Sorry, that was a direct reaction to your statement that you had no tests and seemed unsure about what you were working on11:08
niemeyerrog: I prefer to break a task down further to a point you are sure about than to be reviewing untested code in a paste, that's all.. it wasn't a direct statement about your code11:09
rogniemeyer: i didn't want the code reviewed, just a quick glance for first impressions.11:11
niemeyerrog: Yes, deploy units and destroy units.. that seems right. I'd suggest having a look at some of the early on logic that Dave worked on before getting into those details.11:16
davecheneyrog: did you try removing dummy from the PA to see if it fixed the problem ?11:16
rogdavecheney: it did11:17
rogdavecheney: i proposed the change11:17
davecheneyhmmm, y u no email ?11:17
davecheneyi'll find it online11:18
rogdavecheney: https://codereview.appspot.com/6295101/11:19
davecheneyta11:19
rogdavecheney: i seem to have misspelled "remove"11:19
davecheneyLGTM anyway.11:20
davecheneyit's night time for me11:21
rogdavecheney: see you tomorrow, i hope11:21
davecheneyall: i'll be off and on line tomorrow because they are putting in a new floor downstairs, so I have to pack away the router and stuff11:22
davecheneyso i'll be on reduced internet rations via phone11:22
davecheneyi don't expect this will cause a problem11:22
rogfwereade: i've just realised a not-so-good thing about the watchers11:42
rogfwereade: if the sub-watcher watch channel is closed, the tomb is killed with "content change channel closed unexpectedly" which will actually mask the underlying error returned from the sub-watcher.Stop AFAICS11:43
niemeyerrog: http://etherpad.ubuntu.com/NCUR4J1kbL12:21
fwereaderog, won't the wtahcer.Stop return the underlying error?12:34
fwereaderog, oh, I see12:36
fwereaderog, hmm12:36
niemeyerfwereade:12:37
niemeyer/ mustErr panics in case err is not set.12:37
niemeyer/ This is used to make sure there's no weirdness in the implementation12:37
niemeyer/ of the watcher. Basically, and underlying watcher should never be12:37
niemeyer/ *cleanly* stopped if the outer watcher is still expecting it to be alive (duh!).12:37
niemeyerfwereade: Makes sense?12:37
fwereadeniemeyer, it does, I'll need to thik a little more to convince myself it's a panic situation12:38
fwereadeniemeyer, but offhand, yeah, it does seem like that would indicate a logic error12:38
niemeyerfwereade: Yeah, indeed.. rog mentioned it could return an error as well12:40
fwereadeniemeyer, I haven't thought of any problem with panicing yet12:41
fwereadeniemeyer, but I'm still a *little* reserved about it12:41
fwereadeniemeyer, not enough to say we shouldn't though12:41
niemeyerfwereade: rog had some good points about closing the Changes channels too12:43
niemeyerfwereade: It's silly for us to be closing them.. it's just creating more work12:43
niemeyerMagic!12:44
fwereadeniemeyer, I think I'll need a little more convincing there, not sure I totally like the idea of anything sitting watching an abandoned channel forever12:44
niemeyermramm found a reasonable flight for saturday the 27th, I forwarded it to the agency, and they "discovered" it12:44
fwereadeniemeyer, if we give every watch a Dying though I'd be very happy to select on Changes()/Dying()12:44
fwereadenihaha12:44
fwereadeniemeyer, haha12:44
fwereadeniemeyer, was that what you were you thinking of?12:45
niemeyerfwereade: Exactly12:45
fwereadeniemeyer, cool, +1 then12:45
niemeyerfwereade: Although, you do have a point..12:46
niemeyerfwereade: We could just as well do the same logic with closing the Changes12:46
niemeyerfwereade: if !ok { foo.tomb.Kill(mustErr(foo.watcher.Err())); return }12:46
niemeyerrog: ^12:46
fwereadeniemeyer, hmm, I think that's even better actually12:47
hazmatniemeyer, g'morning12:48
niemeyerhazmat: Heya12:48
niemeyerhazmat: What's up in hot Washington?12:48
fwereadeheya hazmat12:48
hazmatniemeyer, there are a couple of charms that afaics should be in the charm store, but aren't.. and its not clear per se why12:48
niemeyerfwereade: Agreed.. no need to be casing twice every time12:49
hazmatpretty good in dc.. wet atm.. waiting to the dog walk12:49
hazmatniemeyer, i put together this page of the missing ones.. http://jujucharms.com/tools/store-missing12:49
niemeyerhazmat: mthaddon is our man in those cases12:49
hazmatsome i can see why.. but quite a few its not clear12:49
niemeyerhazmat: He has to dig out of the log for the moment12:49
hazmatgotcha12:49
niemeyerhazmat: We need a proper interface for that, as these details are actually already in the database12:50
rogniemeyer: that LGTM12:50
hazmatniemeyer, well on a few it returns the reason with the response..12:50
hazmatniemeyer, also i was curious how to use the stats interface, like what's the param12:50
* hazmat pulls up charmstore src12:50
hazmatit looks like its listening on /stats/counter/  and then the param name is the lp branch name?12:52
AramI need some help with bzr13:02
AramI used a worng branch by mistake13:02
Aramand I don't know what to do... I created a correct branch with the changes, but I don't know how to fix the original13:03
fwereadeAram, just abandon it I think :)13:03
Aramit's the maste branch though13:04
Arammaster13:04
Aramcan I delete it and recreate it?13:04
Aramand still keep my other branch?13:04
fwereadeAram, master branch of what?13:04
Aramjuju13:04
fwereadeAram, if it's just some branch from which you have already merged the changes you should be fine13:04
Aramit's not13:04
fwereadeAram, ah, lp:juju-core/juju then?13:05
fwereadeAram, what's happened to it? :)_13:05
Aramyes13:05
AramI commited to my local copy of it.13:05
Aramsome changes.13:05
rogAram: i'm +1 with dfc on named return values FWIW. i think they should only be used for trivial functions - they're very easy to get wrong.13:06
fwereadeAram, hmm, I think there's a "bzr uncommit"13:06
rogAram: (and that's also the policy in the go core i think)13:06
fwereadeAram, http://doc.bazaar.canonical.com/beta/en/user-guide/undoing_mistakes.html has helped me once or twice13:07
fwereadeAram, better I think is to get into the habit of branching for *everything*13:07
fwereade;)13:07
rogAram: for reference: http://codereview.appspot.com/2125042/diff/15006/src/pkg/archive/zip/reader.go#newcode8513:11
Aramrog: I agree with rsc if s/trivial/small/. in that example named returns are bad because they force you to do 'return nil, err' in the middle of a huge function, but if the function is such that an unadorned return always suffices I see no problem with them.13:14
Aramfwereade: bzr uncommit worked for fixing that branch, thanks.13:16
AramI still have another problem though.13:16
fwereadeAram, sweet13:16
fwereadeAram, go on13:16
rogAram: i think it's worth using named return values if they actively add value. often that's not actually the case, and they force the reader to go back through the code to work out what's actually being returned.13:16
Aramwhat's the equivalent of hg update in bzr?13:16
rogAram: bzr pull?13:16
AramI though so, but then why:13:17
Arambzr: ERROR: These branches have diverged. Use the missing command to see how.13:17
rogAram: maybe you want to do a merge13:17
Aramwhat does that mean, there are no conflicts.13:17
rogAram: bzr merge lp:juju-core/juju13:17
Arambzr merge worked, but13:17
Aramzr merge lp:juju-core/juju13:18
Aramoops13:18
Aramwhite:state$ bzr diff | wc13:18
Aram    875    3448   2347513:18
Aramdo I have to commit after merge?13:18
rogAram: yes13:18
Aramhmm13:18
rogAram: i usually do: bzr commit -m 'merge trunk'13:18
Aramok, thanks.13:18
Aramall fine now.13:19
Aramrog: yes, I agree that named return values should be used only if they add value, but I think they can add a lot of value if the programmer writes the code in a particular way.13:19
rogAram: example: Machine.SetInstanceId. what value is the named return value adding there?13:21
Aramrog: none, I agree in that case.13:24
rogAram: another example. here i would definitely prefer the second version: http://paste.ubuntu.com/1049099/13:26
rogAram: at a glance it's obvious that we're returning the correct combination of machine and error13:26
rogAram: in the first version i have to look at the if err != nil logic to make sure that it's correctly returning a nil error.13:27
Aramrog: but if err != nil { return } is such a common idiom that by convention you know what it does, error out using the result from the previous function and code past it means it's all fine. it's like a for loop, you learn how it looks, you don't have to think about it.13:29
rogAram: it's the bare return at the end i was talking about.13:29
Aramyes, it's past the if err != nil { return } so you know err is nil.13:30
rogAram: exactly, you have to look back into the function to check that it's returning a nil error13:30
rogAram: for me, the second version has less code, is more trivially readable, and the documentation looks nicer too.13:31
Arambut with things like return &Machine{st: s, id: id}, nil I always have to look to match up return parrameters with the return types to figure out what am I doing and if it's right, if it's a bare return I don13:31
Aram't have to think about it.13:31
Aramand without named returns, error paths usually end up like 'return nil, err' or 'return "", err', and I always have to think about who is that nil or "".13:33
Aramand return &Machine{st: s, id: id}, nil makes me to fill up a mental stack frame processing &Machine{st: s, id: id} and then the return, whilst in my version the code is written in the same natural order the mind processes it (do the Machine, then return).13:35
Aramit's the same reason I don't like 'if ok := f(); ok {}', I like them separate.13:36
Aramok := f(); if ok  {}13:36
rogAram: there are almost always exactly two return values...13:39
rogAram: so matching return values with types isn't too onerous13:39
rogAram: i think my mind can process &Machine{...} as a blob to go along with the nil13:40
niemeyer_Aram: FWIW, I agree with rog in the original paste13:40
niemeyer_Aram: This seems like overusing named results to me as well13:41
hazmatAram, that's only safe to do when have a branch of trunk and not a checkout re uncommit13:41
niemeyer_(that, specifically: http://paste.ubuntu.com/1049099/)13:41
=== niemeyer_ is now known as niemeyer
niemeyerThe second seems both shorter and reads more clearly13:42
rogAram: in the "if ok := ..." case, i use the one line version when possible because it means i have to check less places to see if something relies on the result of ok.13:42
rogniemeyer: this is a one-line trivial change: https://codereview.appspot.com/6295101/13:58
niemeyerLooking13:58
niemeyerrog: LGTM13:58
rogniemeyer: thanks13:58
niemeyerrog: With that kind of change you can just go ahead if you have someone else's review13:59
rogniemeyer: it was interesting that it broke the agent.13:59
rogniemeyer: it made me think that it would be nice if we had something that ssh'd in to the bootstrap machine and tailed the logs so we could automatically get feedback when a bootstrap fails.14:04
rogniemeyer: but i think that's too much pain for not enough gain14:04
niemeyerrog: I've been thinking about something along those lines too14:28
niemeyerrog: Once we get it on pair, we should look at doing some debugging improvements14:28
niemeyerrog: I think we should make better use of syslog, though14:29
niemeyerrog: To deliver *all* logs onto a central location14:29
rogniemeyer: agreed. but in this case it died with a panic in init.14:29
niemeyerrog: So we can say "juju log" and get a tail of it aall going14:29
rogniemeyer: before we'd have managed to set up the log, i think.14:29
rogniemeyer: yeah, it would be fantastic to have a centrally tailable log.14:30
niemeyerrog: I see.. that doesn't concern me as much.. I'm happy to have juju ssh for that14:30
niemeyerrog: We should probably do some early use of papertrail to get started14:32
rogniemeyer: papertrail?14:32
niemeyerrog: papertrailapp.com14:32
rogniemeyer: looks good14:33
niemeyerrog: If we make juju set up the machine syslog up, which is on the trivial side, we can use their service while we don't have our own syslog receiver14:33
niemeyerrog: We may actually never *have* to have a syslog receiver.. just deploy a syslog charm as a first step, and then do "juju set-env syslog=<address>" or whatever14:34
niemeyerrog: This should be a big aid for us14:34
rogniemeyer: a syslog subordinate charm?14:34
niemeyerrog: No, a syslog server charm14:35
niemeyerrog: We should probably have a basic syslog setup within juju itself, so we can do debugging across the board more easily14:35
niemeyerrog: It's really quite simple to have syslog sending logs from one machine onto the server14:35
niemeyerrog: The machine agent could just do that14:36
niemeyerI have flights for Lisbon, for the full week, thanks to mramm14:36
Aramgreat, so it's the original date?14:37
* rog will go and try to book flights14:37
rogniemeyer: when should i plan to leave?14:39
rogniemeyer: friday evening? or sat morning?14:40
niemeyerrog: Late Fri or anytime Sat both are great14:40
niemeyerAram: Yeah14:40
niemeyerAram: The change didn't quite worked out, and in the end there *was* a flight returning on the proper day that the agency I was talking to "didn't see" (!?)14:41
Aramheh14:41
niemeyerrog: Sent a couple of ideas on https://codereview.appspot.com/6312044/14:43
rogniemeyer: seen. that's useful thanks.14:43
niemeyerrog: Glad to hear14:43
* rog is booking flights now.14:45
Aramso we don't use BTS or anything like that, we book our own flights?14:47
* Aram is a little bit confused14:47
fwereademramm, are we meeting in 10, or do I have time zones confused?14:48
niemeyerAram: We use BTS14:55
Aramniemeyer: ah, so I should contact BTS?14:55
niemeyerAram: Yeah14:55
Aramniemeyer: ok, thanks, understood.14:56
niemeyerAram: We as in you, me, and a few others.. depends on where the person is14:56
niemeyerAram: We have a few different agencies14:56
niemeyerAram: You can just get in touch with that email that I've CCd you in using your Canonical email address14:56
niemeyerAram: Point out dates, location, and event in case they have to confirm14:57
Aramthanks14:57
=== bcsaller1 is now known as bcsaller
=== Guest____ is now known as smaddock
hazmatsmaddock, bcsaller invitations out15:01
smaddockhazmat: thanks, jointing now15:02
rogniemeyer: i think i've addressed those issues now. https://codereview.appspot.com/6312044/16:05
niemeyerrog: Super, I'll have a look as soon as I returned from lunch.. just got a call from Ale about it16:06
rogniemeyer: ok16:06
hazmatbcsaller, incidentally not sure if you saw the lp, but i assigned you the lp bug re lxc16:24
bcsallerhazmat: yes16:24
fwereaderog, TheMue, niemeyer: I seek advice re testing deploy with the charm store; don't want to hit real cs:, don't know how I should intercept requests (or replace url from outside package, or whatever). suggestions?17:05
rogfwereade: chat about it tomorrow morning?17:19
rogi'm off for the evening17:19
fwereaderog, sure, sounds good, thanks :)17:19
rogniemeyer: another small CL: https://codereview.appspot.com/6312051/17:20
fwereaderog, happy evening :)17:20
rogfwereade: toi aussi17:20
niemeyerrog: Just done https://codereview.appspot.com/6312044/17:21
niemeyerrog: Reviewed too17:25
niemeyerrog: Just wondering about whether it should follow our established conventions17:25
niemeyerrog: fooFixture/setup/teardown  is generally FooSuite/SetUpSuite/TearDownSuite17:26
fwereadegn all, might make it on a bit later, or might not17:28
niemeyerfwereade: have a good one17:32
jimbakerhazmat, please see my comments re https://codereview.appspot.com/6308044/22:10
jimbakersadly the choice of using a json transport seems to be essential to preserving the format: 1 bugginess22:10
jimbakerwhen i restructured the code so the conditional logic was removed in favor being polymorphic, it might have made the comment in juju.lib.format.Format1 re JSON serialization too far away from what was going on22:13
jimbakerhazmat, but that's why there is dump/load methods in the Format classes, otherwise would just have used yaml.safe_load/safe_dump22:13
fwereadeniemeyer, fwiw, I have a couple of fixes and a couple of counterarguments on https://codereview.appspot.com/6305107/22:50
fwereadeniemeyer, if you're at a loose end (har har) I'd appreciate your thoughts :)22:50
niemeyerfwereade: Checking :)23:31

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