[01:56] <davecheney> https://bugs.launchpad.net/juju-core/+bug/1059921
[01:56] <davecheney> --format=json :(
[05:03] <SpamapS> davecheney: I've been explicitly using --format=json to avoid formatting incompatibilities between go/python
[05:07] <davecheney> SpamapS: yeah, i'm fixing the command line parser to handle this case
[05:11] <davecheney> lucky(~/src/launchpad.net/juju-core) % juju bootstrap --upload-tools
[05:11] <davecheney> lucky(~/src/launchpad.net/juju-core) % juju deploy mysql
[05:11] <davecheney> error: no reachable servers
[05:11] <davecheney> outstanding ... bootstrap didn't
[05:11] <davecheney> aws said yes
[05:11] <davecheney> but the console says that instance is stillborne
[06:26] <davecheney> https://code.launchpad.net/~dave-cheney/gnuflag/001-parse-more-gnu-args/+merge/127419
[06:26] <davecheney> ^ gnuflags doesn't have lbox setup
[06:39] <rogpeppe> fwereade, davechen1y: mornin'
[06:39] <davecheney> monring
[06:39] <fwereade> rogpeppe, davecheney, heyhey
[06:39] <davecheney> rogpeppe: i have a non CL patch for you to review
[06:40] <fwereade> rogpeppe, davecheney: I'm thinking I might actually take my swap day, I fell asleep really early last night and would prefer not to waste the sudden urge to rest
[06:40] <fwereade> rogpeppe, davecheney, *but* ofc I have reviews to respond to first :p
[06:40] <davecheney> fwereade: sgtm - don't forget meeting this aternoon
[06:40] <rogpeppe> fwereade: ok, have fun if so!
[06:40] <fwereade> davecheney, good point, ty
[06:40] <rogpeppe> davecheney: i was about to ask if you had any reviews you wanted me to look at
[06:41] <davecheney> one to gnuflags
[06:41] <davecheney> rogpeppe: https://code.launchpad.net/~dave-cheney/gnuflag/001-parse-more-gnu-args/+merge/127419
[06:42] <davecheney> needed, basically, because all the charms expect it
[06:42] <rogpeppe> davecheney: no codereview link?
[06:43] <davecheney> rogpeppe: it doesn't make one
[06:43] <davecheney> hang on
[06:43] <rogpeppe> davecheney: what doesn't make one?
[06:43] <davecheney> lbox
[06:43] <davecheney> just found the option
[06:43] <rogpeppe> davecheney: -cr
[06:43] <davecheney> https://codereview.appspot.com/6588060
[06:44] <davecheney> rogpeppe: why don't i need to do that on juju-core ?
[06:44] <rogpeppe> davecheney: there's a .lbox file in its root
[06:44] <rogpeppe> davecheney: with flags in
[06:45] <davecheney> fairy nuf
[06:57] <rogpeppe> davecheney: i'm on the review BTW
[06:59] <rogpeppe> davecheney: i'm not sure it's as simple as your CL tries to make it (which is why i didn't do it before)
[07:10] <rogpeppe> davecheney: you've got a review
[08:30] <TheMue> good morning
[08:54] <TheMue> hi fwereade
[09:03] <fwereade> TheMue, heyhey, I'm not really here :)
[09:03] <TheMue> oh, where you are?
[09:05] <fwereade> TheMue, swap-daying
[09:05] <fwereade> TheMue, I'm tired and it's my birthday :)
[09:05] <TheMue> fwereade: ah, ic. so what do you do here? ;)
[09:05] <TheMue> oh, happy birthday
[09:06] <fwereade> TheMue, well, the most entertaining thing I can do for the next 10 mins is poke at how we implement relations and try to come up with something cleaner than what we have for the current use cases
[09:06] <fwereade> TheMue, after that I'll go out for a while, but see you at the meeting
[09:07] <TheMue> fwereade: so it's a half swap-day
[09:09] <fwereade> TheMue, whatever :)
[09:09] <TheMue> fwereade: :D
[10:54] <rogpeppe> fwereade: hippy barday to you!
[10:55] <rogpeppe> fwereade: BTW AgentName isn't happening, but we're renaming PathKey to... something else.
[10:55] <Aram> happy birthday fwereade.
[10:56] <rogpeppe> fwereade: my suggestion was Name, but that doesn't work because Service.Name already has implications. niemeyer suggested Key but that doesn't work because all kinds of things have keys.
[10:56] <rogpeppe> fwereade: currently going with an earlier of niemeyer's suggestions: EntityName
[10:57] <rogpeppe> fwereade: but i'm not greatly happy with that either - any suggestions welcome.
[11:00] <Aram> meeting in 1 min or 61 min?
[11:00] <Aram>  ow
[11:00] <Aram> now
[11:01] <niemeyer> Morning!
[11:01] <mramm> team meeting hangout invite sent
[11:01] <mramm> https://plus.google.com/hangouts/_/557e6f4f5f9de98be4769ec91fc82db48a75d356?authuser=0&hl=en-GB
[11:02] <niemeyer> mramm: Thanks
[11:03] <rogpeppe> fwereade: meeting...
[11:17] <davecheney> rogpeppe: https://bugs.launchpad.net/mgo/+bug/1045678
[11:17] <davecheney> ^ may be of interest
[11:19] <davecheney> niemeyer: --format=json
[11:19] <davecheney> gnuargs only supports --format json
[11:20] <davecheney> niemeyer: all: https://bugs.launchpad.net/juju-core/+bug/1059921
[11:36] <rogpeppe> davecheney: i'm happy to do the gnuflag change if you like
[11:36] <rogpeppe> davecheney: i do bear responsibility for that package, after all
[11:36] <davecheney> rogpeppe: if you want to take a crack over night, i would be most grateful
[11:36] <rogpeppe> davecheney: ok
[11:37] <davecheney> i also tried splitting on the = and pushing the remainder back into f.procArgs, which worked, but the testFlagsetParse tests were not happy
[11:37] <davecheney> and I couldn't figure out why
[11:37] <niemeyer> davecheney, rogpeppe: What's the problem with storing the empty flag in procFlag?
[11:37] <niemeyer> davecheney, rogpeppe: Sorry, I think I meant procArgs
[11:38] <rogpeppe> niemeyer: i'm not sure i understand the question
[11:38] <davecheney> niemeyer: that would probably work, but TestFlagSetParse always failed for reasons I didn't understand
[11:38] <niemeyer> rogpeppe: What's the problem with doing the straightforward and just splitting --foo=bar and storing "bar" as usual?
[11:38] <davecheney> niemeyer: that is what I tried first
[11:39] <davecheney> pushing the remainder back into procArgs
[11:39] <davecheney> but I couldn't make the test pass
[11:39] <rogpeppe> niemeyer: what if bar is empty?
[11:39] <niemeyer> rogpeppe: What's the problem with that/
[11:39] <niemeyer> ?
[11:39] <niemeyer> rogpeppe: --foo "" is fine
[11:39] <niemeyer> rogpeppe: and so is --foo=
[11:39] <fwereade> dammit -- did I completely miss it?
[11:39] <niemeyer> fwereade: Happy birthday!
[11:40] <fwereade> niemeyer, haha, cheers :)
[11:40] <niemeyer> :-)
[11:40] <davecheney> fwereade: happy annual celebration!
[11:40] <fwereade> niemeyer, went out for a nice casual brunch with cath and then got screwed by the busses on the way back :/
[11:40] <fwereade> niemeyer, the intent was there though :(
[11:40] <fwereade> davecheney, cheers :)
[11:41] <niemeyer> fwereade: No worries really, it was a nice and quick sync up
[11:41] <fwereade> niemeyer, excellent
[11:41] <rogpeppe> niemeyer: i have to remember the code properly, gimme a few moments
[11:42] <niemeyer> rogpeppe: And btw, given your suggestion in the review, note that "--foo=bar" and "--foo =bar" mean different things
[11:43] <rogpeppe> niemeyer: indeed, but i think that wouldn't be a problem if we did it the way i suggested
[11:43] <rogpeppe> niemeyer: because we wouldn't put the latter argument into procFlag
[11:45] <niemeyer> rogpeppe: Cool
[11:46] <rogpeppe> niemeyer: the main immediate problem with storing an empty procFlag is that i want to be able to do --foo=false for boolean flags.
[11:47] <rogpeppe> niemeyer: while still allowing --foo to mean the same as --foo=true
[11:50] <niemeyer> rogpeppe: Sounds good, although I'm not familiar with the algorithm there to have an opinion
[11:50] <rogpeppe> niemeyer: i'm nearly there. we'll see if the tests work :-)
[11:51] <niemeyer> rogpeppe: Super :)
[11:51]  * niemeyer gets some coffee
[12:00] <fwereade> niemeyer, Aram: can we talk a little about relations and their creation, retrieval, and watchery?
[12:00] <Aram> sure
[12:01] <fwereade> Aram, teh relation key is now a string with N service:relation pairs, in sort order, right?
[12:01] <Aram> yes
[12:03] <fwereade> Aram, this is interesting from my POV because we identify relations to hooks in a not-quite-neatly-fitting way
[12:04] <Aram> it's also used in some watchers to identify that the relation belongs to a service.
[12:04] <fwereade> Aram, as I see it we can either have an API that gets a relation by pre-existing ID number, rather than by key
[12:05] <fwereade> Aram, which will be convenient for the hook tools
[12:05] <fwereade> Aram, or we can try to do more interesting things with the key and do everything that way
[12:06] <fwereade> Aram, niemeyer: and I'm rather hoping someone else has some thoughts on this because I can't tell which is better
[12:06] <Aram> so, the hook cares about the id of the relation?
[12:07] <fwereade> niemeyer, eg, do we think that anyone is depending on any way on the format of the JUJU_RELATION env vars?
[12:07] <fwereade> Aram, the hook needs to differentiate between different relations on the same endpoint
[12:07] <fwereade> Aram, there's a JUJU_RELATION which is, say, "db", and a JUJU_RELATION_ID which is, say "db:7"
[12:09] <fwereade> Aram, niemeyer: if we were to specify, instead, a JUJU_RELATION_ID of "db:otherservice:otherrelation"
[12:09] <fwereade> Aram, niemeyer: I think it should be pretty simple to transform back and forth into real relation keys
[12:10] <fwereade> Aram, niemeyer: which would resolve the icky two-Relation-getter-methods-on-State thing
[12:12] <fwereade> niemeyer, Aram: I am then *very* torn on the issue of AddRelation and what params it should take
[12:12] <fwereade> niemeyer, Aram: on the one hand, it's very convenient to be able to make up any old relations we like
[12:13] <fwereade> niemeyer, Aram: and we make wanton use of this ability in the tests
[12:14] <fwereade> niemeyer, Aram: (thought, derail atm: there's some always-on relation we should always be able to handle, right? for subordinates?)
[12:15] <fwereade> niemeyer, Aram: on the other, it's pretty clearly a Bad Thing to be able to create any nonsensical relation we like, we ought to be validating them against the charms, just like we should be on upgrade
[12:17] <fwereade> niemeyer, Aram, so my instinct is drawn towards a fuzzy-name interface for both AddRelation and Relation: ie it accepts things like "wordpress mysql" and figures out the right answer without ambiguity
[12:17] <fwereade> niemeyer, Aram: but which mostly wants and expects real keys for normal usage
[12:17]  * niemeyer catches up
[12:17] <Aram> hmm?
[12:17] <Aram> how would it resolve the fuzzy naming?
[12:17] <fwereade> niemeyer, Aram: do I sound like I'm on crack, and just making needless work? I *think* there's something important buried in there somewhere
[12:18] <fwereade> Aram, not very fuzzy -- you have to specify the service names, but can leave the :relation bit off if there's no ambiguity
[12:19] <niemeyer> fwereade: No, I think you're on a good track
[12:20] <fwereade> Aram, the point is just that it allows for a single clean API that includes appropriate validation for all uses
[12:20] <niemeyer> fwereade: I dislike a bit the way relations are referred to right now
[12:20] <fwereade> Aram, it's definitely not a polished proposal just a feel that *something* is wrong
[12:20] <fwereade> niemeyer, in what context?
[12:20] <niemeyer> fwereade: In general
[12:21] <fwereade> niemeyer, they're represented too many ways already, I think ;)
[12:21] <niemeyer> fwereade: Oh, sory
[12:21] <niemeyer> sorry
[12:21] <niemeyer> fwereade: I mean the way we refer to them by a string that is a concatenation of the endpoints
[12:22] <niemeyer> fwereade: It ended up as a convenient way, though
[12:22] <fwereade> niemeyer, ha, I've been coming to rather like that -- if it is (or is trivially transformable to/from) the relation "names" that the user types/sees, I think it is a good thing
[12:22] <niemeyer> fwereade: So, let me try to help on a few of your questions above
[12:23]  * fwereade sits attentively
[12:23] <niemeyer> fwereade: I don't think we should change the environment variable
[12:23] <niemeyer> fwereade: It's breakage that sounds easy to avoid
[12:23] <fwereade> niemeyer, ok, wholeheartedly accept that argument
[12:24] <niemeyer> fwereade: It sounds fine to have a method that grabs the relation by its numeric id
[12:25] <niemeyer> fwereade: I'm not sure I get the problem you describe referring to AddRelation, though
[12:26] <fwereade> niemeyer, a client of the API is perfectly able to AddRelation(<wordpress:lol>, <mysql:giggle>)
[12:26] <fwereade> niemeyer, and we will consider that a perfectly good relation, and join it, and just not run any hooks
[12:27] <fwereade> niemeyer, IMO this is bad because if that relation *becomes* valid in future charms, to which we upgrade, we'll start running hooks in a weird weird state -- not installed, for a start
[12:27] <rogpeppe> davecheney, niemeyer: https://codereview.appspot.com/6598052/
[12:27] <rogpeppe> now for some lunch
[12:28] <fwereade> niemeyer, so, we should really just not be allowed to create them, just as we don't create services referring to charms that cdon't exist
[12:28] <Aram> fwereade: yeah, we should validate the relation, we didn't do so because we didn't have the emans when I've written that/
[12:28] <Aram> s/emans/means/
[12:29] <fwereade> Aram, did we not? I thought charm.Meta was all we needed?
[12:29] <fwereade> Aram, ok, but it's not just a matter of validating the endpoints
[12:29] <niemeyer> fwereade: Curious.. :-)
[12:29] <fwereade> Aram, it's a matter of specifying them in the first place, in add-relation, which requires that we do the validation
[12:29] <niemeyer> fwereade: A bit of history.. https://codereview.appspot.com/6305067/ ;-)
[12:30] <fwereade> niemeyer, ok, that is referring (I think) to a somewhat lower standard of validity
[12:31] <fwereade> niemeyer, I think that in apprehending the charm-upgrade issue, my thoughts on this matter have taken a harder line
[12:32] <niemeyer> fwereade: Yeah, your thoughts on it are well appreciated
[12:32] <niemeyer> fwereade: So, hmm.. what prevents a relation from being added while an upgrade is in progress?
[12:33] <fwereade> niemeyer, nothing yet
[12:33] <fwereade> niemeyer, things are still changing under my feet enough that I don't have a clear picture of the final shape of the solution
[12:33] <fwereade> niemeyer, I just know it's something that should be borne in mind
[12:34] <niemeyer> fwereade: We should certainly validate the relation.. just trying to imagine how to do it properly
[12:37] <fwereade> niemeyer, I don't see any way around getting the charms' Metas
[12:37] <niemeyer> fwereade: We can add an assertion against the revision numbers of the involved services, I suppose
[12:37] <fwereade> niemeyer, I think it's easier that that if we are careful with the lifetimes and with what upgrades we allow
[12:37] <fwereade> niemeyer, block upgrades which would change non-Dead relations
[12:37] <niemeyer> fwereade: Yeah, this is the basic need.. the next question is which charm
[12:38] <niemeyer> fwereade: That's already an agreement I think, although we didn't put it in place yet
[12:38] <fwereade> niemeyer, the current one of the service -- by blocking upgrades until incompatible relations are gone we can always use the service's current charm
[12:38] <niemeyer> fwereade: But besides that, we must also prevent adding a relation after the decision that it was ok to upgrade happens
[12:40] <fwereade> niemeyer, it becomes a matter of figuring out what races we have to deal with between client 1 adding relations and client 2 upgrading charms
[12:40] <niemeyer> fwereade: Yeah, that's what I was referring to above
 fwereade: We can add an assertion against the revision numbers of the involved services, I suppose
[12:40] <fwereade> niemeyer, I am hoping that we will be able to express suitable asserts in the transactions
[12:41] <niemeyer> fwereade: To prevent adding a relation to a service that holds an unknown charm
[12:41] <fwereade> niemeyer, yeah, exactly
[12:41] <niemeyer> fwereade: Cool, nothing sounds too bad so far
[12:42] <fwereade> niemeyer, as long as we express the changes correctly on the client, we can find some way to keep not-yet-ok charms off to one side until the deployed charm can handle them
[12:42] <fwereade> niemeyer, not really sure how to do that yet
[12:43] <fwereade> niemeyer, doesn't feel likely to be a real dealbreaker
[12:43] <niemeyer> fwereade: You mean not-yet-ok relations?
[12:43]  * fwereade slaps self
[12:43] <fwereade> niemeyer, yes, thank you
[12:43] <niemeyer> fwereade: Cool, np
[12:44] <niemeyer> fwereade: Yeah, agreed.. we have easy access to the current charm from the uniter
[12:44] <fwereade> niemeyer, yeah, it feels quite neat
[12:44] <fwereade> niemeyer, you had doubts about the appropriateness of the current "foo:bar baz:qux" key, though?
[12:45] <fwereade> niemeyer, actually, that's in backward form :p
[12:45] <niemeyer> fwereade: I have a tiny dislike for it.. but it's not a big deal I think
[12:46] <fwereade> niemeyer, I *think* that the ease of transformation to/from user-speak is very nice
[12:46] <niemeyer> fwereade: The only change I'll likely propose in the short term is to order the keys by role
[12:46] <fwereade> niemeyer, +1
[12:47] <niemeyer> fwereade: Otherwise we have "wordpress:db mysql:server" and "mysql:server blogger:foo"
[12:47] <niemeyer> Which is not great
[12:48] <fwereade> niemeyer, requirer then provider?
[12:49] <niemeyer> fwereade: Yeah,  that sounds sensible
[13:03] <fwereade> ok then -- since the ids-in-watchers change, I have no way to progress on relations without working on some of this stuff
[13:03] <fwereade> niemeyer, ^^
[13:05] <fwereade> niemeyer, I really don't think it is sensible for me to get sidetracked by the CLI-related bit when the uniter is still to be done, so I think I will just add a minimal RelationById(int) (*Relation, error) and change Relation() to take a key instead of endpoints
[13:06] <fwereade> Aram, how are the watchers looking?
[13:06] <fwereade> Aram, specifically ServiceRelationsWatcher :)
[13:06] <Aram> nothing done on that front, there's one in review you can look at, it will definetly look very similar.
[13:07] <fwereade> Aram, great, I will * try* to check that out this evening
[13:08] <niemeyer> fwereade: Hmm
[13:08]  * fwereade listens
[13:09] <niemeyer> fwereade: Sorry, still pondering on the scheme you mention there
[13:10] <niemeyer> fwereade: Having the relation taking a key instead of endpoints doesn't feel great
[13:11] <niemeyer> fwereade: The way we have the current interface pretty consistent on that front feels like a nice win we have
[13:13] <fwereade> niemeyer, hmm; I need to get relations both by key (because I presume that is how the watcher will deliver them) and by id (because that is how I express them to the hooks, which might pass them back to me)
[13:14] <fwereade> niemeyer, getting relations, and watching relations, by key, seems natural to me
[13:14]  * rogpeppe had never realised the subtle difference in Gnu flags between -u=foo and --u=foo
[13:15] <fwereade> niemeyer, the intent is that at some stage we can change over AddRelation to take a string, just as GetRelation does, that does the appropriate inference of unambiguously underspecified endpoints
[13:15] <fwereade> niemeyer, and sorts appropriately, I guess
[13:15] <niemeyer> fwereade: :-)
[13:15] <niemeyer> fwereade: Effectively manipulating the key onto a different key
[13:16] <fwereade> niemeyer, and thereby as a second step get back a unified API, that is backward-compatible with the stuff I've been doing in the uniter
[13:16] <fwereade> niemeyer, ok, the heart of it is this
[13:17] <fwereade> niemeyer, I need to look them up in 2 different ways, neither of which is the same as the current way to get a relation
[13:17] <niemeyer> fwereade: What is the real underlying needs you have?
[13:17] <fwereade> niemeyer, if I just add two trivial RelationByKey and RelationById methods, I'm golden
[13:18] <niemeyer> fwereade: -1 on relation by key
[13:18] <niemeyer> fwereade: key is internal, and is a compilation of the current endpoint semantics
[13:18] <niemeyer> fwereade: I'm pretty sure we'll regret if we change it
[13:18] <fwereade> niemeyer, ah -- I had thought we were loving away from internal keys that differed from external names
[13:19] <fwereade> niemeyer, but, ok, if it's not the thing that we use to look things up by, and to send in watchers, it's not much of a key, is it?
[13:19] <niemeyer> fwereade: That's one of the reasons why I dislike the key mechanism. That said, I'm pretty sure exposing it as suggested will lead to many other issues that don't feel great to get into.
[13:20] <niemeyer> fwereade: You just mentioned one of them.. we cannot add a relation by its key, because we have to manipulate the key first
[13:20] <niemeyer> fwereade: It's a primary key used in the database.. there's no single place in our API that exposes this key
[13:20] <niemeyer> fwereade: It's an implementation detail
[13:21] <niemeyer> fwereade: To enable the API that we've agreed on so far
[13:21] <niemeyer> fwereade: We can kill the idea of using it as a key if we change the API
[13:21] <fwereade> niemeyer, ok, then ID remains the primary way of identifying relations?
[13:21] <niemeyer> fwereade: It depends on the way you look at it
[13:21] <niemeyer> fwereade: how does our API look like? Are we using id as a primary way to identify relations?
[13:21] <fwereade> niemeyer, ok: SRW will send IDs, and I will call a State method that takes an ID when I want to see what relation it refers to
[13:22] <fwereade> niemeyer, I have assumed ID to be the main way, yes, but little committed code depends on this
[13:23] <niemeyer> fwereade: We can make the concept more first class
[13:24] <niemeyer> fwereade: For instance, state.Relation(id) sounds fine..
[13:25] <niemeyer> fwereade: Feels a lot more sensible than obtaining all the endpoints to grab the relation
[13:26] <niemeyer> fwereade: We can then have e.g. state.EndpointsRelation(endpoints ...RelationEndpoint) (*Relation, error)
[13:27] <fwereade> niemeyer, great, +1
[13:28] <fwereade> Aram, in the absence of other feedback, then, I will probably move on to a SRW that generates IDs at some point tomorrow; please let me know if you suspect collisions
[13:28] <fwereade> Aram, I imagine I will implement it along the lines of your proposal
[13:28] <niemeyer> fwereade: This kills the inconsistency, I think, and makes state.Relation(relation.Id()) work, as usual for everything else
[13:28] <fwereade> niemeyer, yeah, that is fine by me
[13:29] <Aram> fwereade: I don't anticipate any collisions, everythung should be smooth
[13:29] <fwereade> niemeyer, and then we can have a state.InferEndpoints(eps ...string) ([]RelationEndpoint, error), that can be used by the CLI tools
[13:29] <niemeyer> fwereade: Yeah, that sounds great
[13:30] <fwereade> niemeyer, and as a bonus we can keep the AddRelation logic as it is for now and do that properly in concert with the upgrady bits
[13:30] <niemeyer> fwereade: Cool
[13:32] <niemeyer> fwereade: Btw, there's a great benefit of having the DB _id being the key as it is today
[13:32] <niemeyer> fwereade: The service relations watcher doesn't have to load the document to tell what service it targets
[13:33] <fwereade> niemeyer, +100
[13:33] <fwereade> niemeyer, I *knew* there *was* something really good about it
[13:34] <niemeyer> fwereade: Yeah, that was kind of an unanticipated benefit.. the real reason we changed was the transaction mechanism
[13:35] <niemeyer> fwereade: Without this, we can't add a unique relation
[13:35] <niemeyer> fwereade: Because we don't have anything to assert on
[13:35] <fwereade> niemeyer, very neat :)
[13:35] <niemeyer> fwereade: We can't assert on non-existence of something else that contains a given field
[13:44] <niemeyer> fwereade: Do you have a moment to talk about https://codereview.appspot.com/6588053/diff/2001/worker/uniter/modes.go#newcode171
[13:44] <niemeyer> fwereade: happy to postpone if you're in flow on something else
[13:47] <niemeyer_> :(
 fwereade: Do you have a moment to talk about https://codereview.appspot.com/6588053/diff/2001/worker/uniter/modes.go#newcode171
 fwereade: happy to postpone if you're in flow on something else
[14:12] <TheMue> hmm, the current test in environs/ec2 in trunk has one fail and one panic. anybody working on that?
[14:17] <niemeyer> TheMue: What's the failure/panic?
[14:18] <niemeyer> Hmm.. something in the last two revisions broke it
[14:18] <TheMue> niemeyer: Fail is NoSuchBucket in TearDownTest
[14:18] <niemeyer> Ah
[14:18] <niemeyer> That's Dave's change
[14:19] <TheMue> niemeyer: Panic is in localServerSuite.TestBootstrapInstanceUserDataAndState
[14:19] <niemeyer> Let's see in the previous revision
[14:26] <niemeyer> TheMue: Proposing
[14:33] <TheMue> niemeyer: Pardon?
[14:36] <niemeyer> TheMue: I've fixed it.. CL up in a moment
[14:37] <niemeyer> TheMue: https://codereview.appspot.com/6596056
[14:41] <TheMue> niemeyer: LGTM
[14:41] <rogpeppe> niemeyer: PathKey->EntityName https://codereview.appspot.com/6593061/
[14:44] <niemeyer> rogpeppe: LGTM
[14:44] <rogpeppe> niemeyer: thanks!
[14:47] <fwereade> niemeyer, I think I can for a mo :)
[14:47] <niemeyer> rogpeppe: np, and thanks
[14:47] <niemeyer> fwereade: Sorry, I just read your mail and didn't realize you were out before
[14:48] <fwereade> niemeyer, nah, I was explicitly doing it because I realised I needed to and, meh, cath was out :)
[14:48] <fwereade> niemeyer, while C&L are distracted together I'm more than happy to talk if it helps us progress
[14:48] <fwereade> niemeyer, it just means I may disappear abruptly for hours at a time :)
[14:48] <niemeyer> fwereade: I was just going to mention that the issue there was simpler than it sounded
[14:49] <niemeyer> fwereade: I was questioning why we do the wantEvent+waitForConfig dance at all
[14:49] <niemeyer> fwereade: Rather than just running the hook directly
[14:49] <fwereade> niemeyer, yeah -- as it turned out I really did have a reason ;)
[14:49] <fwereade> niemeyer, not well expressed in the comments though ;)
[14:50] <fwereade> niemeyer, oh yeah, I meant to ask about the resolved business
[14:51] <niemeyer> fwereade: Cool, I'm curious about why that is, but I can wait for the comment easily :)
[14:52] <fwereade> niemeyer, in suggesting that no ResolvedNone event needs to be sent, I imagine that, to go with this, a wantResolved would just do nothing if the state was ResolvedNone
[14:52] <fwereade> niemeyer, which makes "want" not quite right, maybe
[14:52] <fwereade> niemeyer, or maybe "want" is just right :)
[14:53] <fwereade> niemeyer, regardless, it would necessarily I think break the want-always-causes-a-send-as-soon-as-possible feature
[14:53] <fwereade> niemeyer, the immediate consequences are generally good
[14:53] <fwereade> niemeyer, but that property did seem like quite a nice one
[14:54] <niemeyer> fwereade: Yeah, a slight change in perspective.. it does send an event immediately, as long as the current state is sensible
[14:54] <fwereade> niemeyer, ha, actually, the way I expressed it above, it *doesn't* break it
[14:54] <fwereade> niemeyer, ok, if you've already considered it from that perspective I'm very happy indeed to do it that way
[14:55] <SpamapS> fwereade: aren't you supposed to be doing celebratory chores?
[14:55] <niemeyer> fwereade: Yeah, I wish we could do the same for upgrades actually
[14:55] <fwereade> SpamapS, did some, now I can relax again ;p
[14:56] <fwereade> niemeyer, upgrades aren't so simple, the upgradiness of a given service charm differs depending on mode
[14:57] <niemeyer> fwereade: You mean force vs. non-force?
[14:59] <fwereade> niemeyer, and what it's to
[14:59] <fwereade> niemeyer, X is not an interesting request when we're already upgrading to X even if it's forced
[14:59] <fwereade> nie sorry gtg for a while again
[14:59] <niemeyer> fwereade: Please do go :)
[15:32]  * niemeyer => lunch
[15:35] <TheMue> niemeyer: a final propose of https://codereview.appspot.com/6596051/ for the error message of illegal firewall modes
[15:59] <rogpeppe> niemeyer: any idea why this doesn't work? http://paste.ubuntu.com/1256219/
[16:00] <niemeyer> rogpeppe: Because you're authenticating against the wrong database
[16:00] <rogpeppe> niemeyer: ah, i wondered if it might be something like that
[16:00] <niemeyer> rogpeppe: The "/dbname" at the end of the URL does the trick
[16:00] <niemeyer> rogpeppe: That said, I don't think we want to use it like that, FWIW
[16:00] <niemeyer> rogpeppe: Login is a lot easier
[16:00] <rogpeppe> niemeyer: i don't think so either
[16:01] <rogpeppe> niemeyer: but i wanted something to verify that AddUser was actually doing something
[16:01] <rogpeppe> niemeyer: and in fact, for non-SSL connections, perhaps we do want to do it this way
[16:01] <rogpeppe> niemeyer: Login... hmm, i started doing it that way, then thought this was easier!
[16:32] <rogpeppe> niemeyer: SetPassword in state: https://codereview.appspot.com/6587060/
[17:02] <niemeyer> rogpeppe: Reviewed
[17:02] <rogpeppe> niemeyer: thanks
[17:03] <niemeyer> rogpeppe: np
[17:04] <rogpeppe> niemeyer: i'm not entirely sure how i can check that the presence database is authenticated. currently there's no difference between an authenticated and an unauthenticated connection AFAIK
[17:05] <niemeyer> rogpeppe: Perhaps we should fix that first then?
[17:05] <rogpeppe> niemeyer: i'm not sure i can do that without running mongo in auth mode, which comes in the next CL
[17:05] <niemeyer> rogpeppe: Perhaps we should do that first?
[17:06] <rogpeppe> niemeyer: hmm, yeah, we could do that
[17:06] <niemeyer> rogpeppe: As it is the CL has a bug that went unperceived because we had no tests.. feels like a good reason to step back
[17:06] <rogpeppe> niemeyer: i'm not entirely sure i understand how the auth mode thing works - the mongodb docs seem pretty sketchy
[17:07] <rogpeppe> niemeyer: i don't think the bug comment was published
[17:07] <niemeyer> rogpeppe: ?
[17:07] <rogpeppe> niemeyer: i don't see any comment in your review that points out a bug
[17:08] <rogpeppe> niemeyer: (apart from "Just needs a test to ensure the bug is fixed")
[17:08] <niemeyer> rogpeppe: Try to add the test then :-)
[17:08] <rogpeppe> niemeyer: ha
[17:08] <rogpeppe> niemeyer: i just looked at the comment in context :-)
[17:09] <niemeyer> rogpeppe: In terms of --auth, just running with --auth enables secure mode.. it allows connecting locally to the database before a user is added
[17:09] <niemeyer> rogpeppe: Which is quite handy for what we want
[17:10] <rogpeppe> niemeyer: ok, i'll make another CL that runs the testing mongodb server in auth mode.
[17:10] <rogpeppe> niemeyer: once a user is added, does it stop any further unauthenticated local connections?
[17:10] <niemeyer> rogpeppe: I think all we'd need is running the test mgo in auth mode, and use SetAdminPassword on it
[17:10] <niemeyer> rogpeppe: Right
[17:11] <rogpeppe> niemeyer: i don't see a SetAdminPassword method in mgo
[17:12] <niemeyer> rogpeppe: That's about juju :-)
[17:12] <rogpeppe> niemeyer: but we can add a user in state.Initialize
[17:12] <rogpeppe> niemeyer: i'd thought we might add a password argument to state.Initialize
[17:12] <niemeyer> rogpeppe: and then how do we connect?
[17:13] <niemeyer> rogpeppe: Well, sorry, that's irrelevant
[17:13] <rogpeppe> niemeyer: with Open as usual, no?:
[17:13] <niemeyer> rogpeppe: Yeah
[17:13] <niemeyer> rogpeppe: Either way, Initialize can be made in terms of SetAdminPassword..
[17:13] <rogpeppe> niemeyer: seems reasonable
[17:14] <rogpeppe> niemeyer: BTW in environs/cloudinit, i'm planning to write the entity name and password to $dataDir/admin/mongodb-auth
[17:14] <rogpeppe> niemeyer: then the agents will read that and put the info into the state.Info before connecting
[17:15] <rogpeppe> niemeyer: i've gotta go and cook up some wild mushrooms for tea :-)
[17:16] <niemeyer> rogpeppe: Sounds fine, except a "/auth" file sounds enough. We need to consider how to handle the multiple agents too. $dataDir is shared, IIRC
[17:17] <rogpeppe> niemeyer: ok. i wondered if there might be a problem with people reading the length of the file, given that $dataDir is globally readable.
[17:18] <rogpeppe> niemeyer: for multiple agents, i'd thought we'd use agents/$entityname/auth
[17:19] <niemeyer> rogpeppe: Not sure.. agents/ was going away, I think.. we'll have containers/ instead IIRC
[17:19] <rogpeppe> niemeyer: i think i'll fold in the Initialize changes into the current CL otherwise we've got a small chicken/egg problem .
[17:19] <niemeyer> rogpeppe: We must also think about how to avoid having the admin password exposed..
[17:20] <rogpeppe> niemeyer: well, the same directory that's used for the agent anyway
[17:20] <niemeyer> rogpeppe: I don't see the chicken/egg problem
[17:20] <rogpeppe> niemeyer: i think it's got to sit in a file. as long as it's in a 700 file in a 700 directory, i don't think there's a problem
[17:21] <niemeyer> rogpeppe: I mean how to get the admin password to be set in a way that doesn't leak it
[17:21] <niemeyer> rogpeppe: and at the same time is known by the client
[17:21] <rogpeppe> niemeyer: Initialize relies on SetPassword (well SetAdminPassword which is almost exactly the same thing), and that's what's in the current CL
[17:21] <niemeyer> rogpeppe: That's how we end up with big unfocused branches
[17:22] <niemeyer> rogpeppe: It doesn't really on unit.SetPassword or machine.SetPassword
[17:22] <niemeyer> rely
[17:22] <rogpeppe> niemeyer: yes, but the testing will be exactly the same (they both share tests)
[17:22] <rogpeppe> niemeyer: as will the implementation
[17:23] <rogpeppe> niemeyer: and we'll need the changes from the current CL that do the login too
[17:23] <niemeyer> rogpeppe: What happens if you login with an invalid user?
[17:23] <rogpeppe> niemeyer: you get an "auth failed" error
[17:24] <niemeyer> rogpeppe: s.Session.Login("admin", "foo")
[17:24] <niemeyer> rogpeppe: This means one can trivially implement SetAdminPassword, and test it
[17:25] <rogpeppe> niemeyer: ok, so that's stage 1. the next stage needs to have all the other login stuff in. and that's the bulk of it. SetAdminPassword is about two lines of code.
[17:25] <niemeyer> rogpeppe: Without Open, or machine.SetPassword, or unit.SetPassword, or Initialize, etc
[17:26] <niemeyer> rogpeppe: No, it doesn't
[17:26] <niemeyer> rogpeppe: The next stage can have just the changes to state.Open, I believe
[17:26] <niemeyer> rogpeppe: Without anything else again
[17:26] <rogpeppe> niemeyer: that's what i meant
[17:26] <niemeyer> rogpeppe: No unit.SetPassword, no machine.SetPassword, etc
[17:27] <rogpeppe> niemeyer: i didn't mean those as login stuff.
[17:27] <rogpeppe> niemeyer: anyway, it's all pretty small. i don't think there's a danger (currently) of the branch getting too unfocused
[17:27] <niemeyer> rogpeppe: That's how it starts every time
[17:28] <niemeyer> rogpeppe: and that's the direction that it was going again
[17:28] <niemeyer> rogpeppe: It's extremely rewarding to have small branches quickly integrated
[17:29] <rogpeppe> niemeyer: i will try
[17:29] <rogpeppe> niemeyer: BTW your admin password question is salient
[17:29] <rogpeppe> niemeyer: i don't know how we can get the admin password to the bootstrap machine without putting it in cloudinit
[17:29] <rogpeppe> niemeyer: and hence making it available forever
[17:30] <niemeyer> rogpeppe: I think we can use a hash trick on the original password
[17:30] <niemeyer> rogpeppe: hash it together with a well known token, and use that as the first password.
[17:30] <rogpeppe> niemeyer: yeah, i suppose we could use a hash designed for passwords.
[17:30] <niemeyer> rogpeppe: On first connection, replace with the actual password
[17:31] <niemeyer> rogpeppe: That's not the issue
[17:31] <niemeyer> rogpeppe: If we use a hash designed for passwords as the password, we'd still have the same issue
[17:31] <rogpeppe> niemeyer: i realise we have to change the password on first connection
[17:32] <rogpeppe> niemeyer: but we also need to use a hash designed for passwords, i think
[17:33] <niemeyer> rogpeppe: Not super worried about it, as long as it's a cryptographic hash
[17:33] <rogpeppe> niemeyer: otherwise someone can reverse the hash and connect as admin
[17:33] <niemeyer> rogpeppe: None of the traditional hashing algorithms are reversible
[17:33] <rogpeppe> niemeyer: i think it's important actually, if we're concerned about security from the bootstrap machine
[17:34] <rogpeppe> niemeyer: they don't need to be reversible if the password isn't so strong
[17:34] <niemeyer> rogpeppe: In fact, hashes are not reversible by definition.. they may have other weaknesses, but not reversibility
[17:34] <rogpeppe> niemeyer: i should've said "crack" not "reverse"
[17:35] <niemeyer> rogpeppe: It doesn't matter in this context
[17:35] <rogpeppe> niemeyer: because they can't make that many connections to mongodb?
[17:36] <niemeyer> rogpeppe: Sorry, I don't understand what problem you're trying to solve
[17:36] <rogpeppe> niemeyer: i'm imagining someone malicious on the bootstrap machine. they have the hash of the password from cloud-init; now they're trying to log in as admin
[17:37] <niemeyer> rogpeppe: Okay.. they have a hash based on the password.. so what?
[17:37] <rogpeppe> niemeyer: they can go through a few hundred billion passwords quite easily; when they find one that hashes to the same thing, they have the admin password.
[17:38] <rogpeppe> niemeyer: hence we slow down that process by using a hash designed for that purpose.
[17:39] <rogpeppe> niemeyer: i really must go; i'll pop my head in a little later.
[17:39] <niemeyer> rogpeppe: Enjoy
[18:22] <niemeyer> I've got a doc appointment.. back soon
[20:56] <fwereade> niemeyer, ping
[22:45] <niemeyer> fwereade: you're probably off by now, but I just sent a question in the review
[22:46] <niemeyer> fwereade: Have seen your email too, and pondering.. will reply later
[22:55] <davecheney> state_test.go:250: c.Assert(current, DeepEquals, initial)
[22:55] <davecheney> ... obtained map[string]interface {} = map[string]interface {}{"firewall-mode":"default", "name":"test", "development":true, "authorized-keys":"i-am-a-key", "default-series":"precise", "type":"test"}
[22:55] <davecheney> ... expected map[string]interface {} = map[string]interface {}{"type":"test", "name":"test", "development":true, "authorized-keys":"i-am-a-key", "default-series":"precise"}
[22:55] <davecheney> ^ when was firewall-mode added ?
[23:04] <davecheney> niemeyer: https://bugs.launchpad.net/juju-core/+bug/1060509
[23:04] <davecheney> can anyone else reproduce this, i'm getting it on two systems
[23:12] <niemeyer> davecheney: It was added today
[23:12] <niemeyer> davecheney: Well, yesterday from your perspective
[23:13] <niemeyer> davecheney: Frank probably didn't run the full test suite
[23:13] <davecheney> https://codereview.appspot.com/6590064 has the fix
[23:14] <niemeyer> davecheney: LGTM
[23:14] <davecheney> ta
[23:14] <davecheney> what happened with rogers gnuflag patch ?
[23:46] <davecheney> ok, the mysql charm is failing because falvor doesn't have a valid default
[23:56] <davecheney> niemeyer: it looks like charm setting's defaults are broken