/srv/irclogs.ubuntu.com/2013/02/18/#juju-dev.txt

davecheneyvar m = make(map[string]int)00:00
davecheneytype T struct { name string }00:01
* thumper is beginning to want proper inheritance in go...01:26
* thumper sighs01:26
* thumper has another thought...01:28
thumpergah, must finish something before starting another01:28
* thumper puts head down again01:28
thumperdavecheney: by splitting out the SetFlags from the Init, a bunch of tests are failing...02:22
thumperdavecheney: as they are testing Init02:22
thumperdavecheney: is there a place where we put helper test functions?02:22
thumperdavecheney: for example, jujud/agent_test.go has a method called initCmd02:23
thumperwhich creates some flags, and calls init02:23
thumperI added the setflags to it, and I'd like to make the function more generally useful in other tests02:23
* thumper guesses davecheney is at lunch02:27
davecheneythumper: generally suite_test.go is a good start02:43
davecheneybut i think you have to leiway to create your own tradition02:43
thumperwhoever thought that "c *C" were good params for tests should be given a very stern look04:00
* thumper jumps through hoops04:16
* thumper wonders if 1000 lines of diff are enough for first change to juju04:21
davecheneythumper: i'd say most things are up for grabs if you are prepared to argue your case04:27
thumperhmm...04:27
thumperdavecheney: are there dependencies between the juju-core packages that I have to make sure I don't screw up?04:28
davecheneythumper: not sure i parsed that correctly04:31
thumperdavecheney: there are tests lying around...04:31
thumperdavecheney: and I want to put some common command test helper methods into juju-core/testing04:31
davecheneykk04:32
thumperwhich would add a depencency on juju-core/cmd04:32
thumperwhich I don't think is there yet04:32
thumperlikely to be fine?04:32
davecheneysure04:32
thumperkk04:32
davecheneyI'm sure there is alreayd a dep between cmd/juju and cmd04:32
davecheneythumper: go list -f '{{ .Imports }}' launchpad.net/juju-core/cmd/juju04:33
davecheney^ direct imports of cmd/juju04:33
davecheneygo list -f '{{ .Deps }}' launchpad.net/juju-core/cmd/juj04:33
davecheney^ all transitive deps04:33
thumperah...04:33
thumperhandy04:33
thumperI may try that shortly04:33
thumperholy shit04:50
wallyworld_thumper: you got your rietveld account all set up for your mp?04:50
thumperrealised that my tollerance for duplication in tests is way below some others04:50
thumperwallyworld_: no04:50
wallyworld_thumper: it's not just tests - i'm finding Go to be very verbose04:51
thumperwallyworld_: this isn't go04:51
thumperit is just code04:51
wallyworld_yeah agreed, it's also elsewhere04:51
thumperdavecheney: umm... if I Ctrl-C the tests while running, have I left things behind that might cause further tests to hang?05:08
davecheneythumper: in theory no05:10
davecheneyin practice05:10
davecheneyyes, you'll eventyualy leak enough mongo processes to run out of swap05:10
davecheneyif you put /tmpfs on swap, then you ahve to be doubly careful05:11
davecheneyas each mongo will write 200mb of journal files on startup05:11
thumperhmm...05:22
thumperok, something to watch for then :)05:22
thumperI'm almost at the state of making all these tests pass again...05:22
davecheneyneat05:22
thumperhmm...05:22
thumper$ bzr diff | wc -l05:22
thumper146705:22
thumperalthough, not quite that bad:  58 files changed, 223 insertions(+), 188 deletions(-)05:23
thumperand much of that is duplicated05:23
thumperok, I hear the kids home05:24
thumpertests are running, pretty confident05:24
thumpertomorrow lets get this reviewed and landed05:24
thumpernight all05:24
davecheneynight05:25
davecheneygot a branch ?05:26
thumperwork  up at  lp:~thumper/juju-core/command-set-flags if you are curious05:26
* thumper signs off05:26
davecheneykk05:26
thumperand all tests passed \o/05:26
wallyworld_davecheney: hi, thanks for finding that data race. what tool did you use?06:52
TheMueMorning08:13
dimiternTheMue: morning!08:14
fwereadedimitern, TheMue, heyhey08:25
dimiternfwereade: hiya08:25
TheMuefwereade, dimitern: Hi08:25
fwereadedimitern, TheMue: fwiw I have a few constraints branches from last night up08:25
dimiternfwereade: yeah, already on these08:25
fwereadedimitern, you rock08:26
fwereadeTheMue, you have a trivial LGTM on the deletes branch08:26
TheMuefwereade: Yep, thx, just doing the final merging and test.08:26
rogpeppemornin' all08:28
TheMuerogpeppe: Hiya08:28
rogpeppeTheMue: yo!08:28
dimiternrogpeppe: morning08:28
rogpeppedimitern: hi!08:28
dimiternfwereade: you've got 2 reviews10:23
fwereadedimitern, tyvm10:23
fwereaderogpeppe, ping10:35
rogpeppefwereade: pong10:35
fwereaderogpeppe, last weekend, I had a thought related to the api10:35
rogpeppefwereade: ok10:36
fwereaderogpeppe, would you agree that the following is a valid perspective: a machine agent can be defined to be trusted, or not, dependent on whether it has a state.Info and can hence connect directly to mongo10:36
fwereaderogpeppe, and that we thus always require that at least one trusted machine exists10:37
rogpeppefwereade: given that the state.Info contains a valid password, yeah10:37
fwereaderogpeppe, because we need it to run the API server, through which untrusted machine/unit agents will connect10:37
rogpeppefwereade: yup10:37
rogpeppefwereade: there must always be at least one API server running10:38
fwereaderogpeppe, ok, so, if we keep the Provisioner and Firewaller just as they are, and only allow them to run on trusted machines -- against a state.Conn, I think you get to cut down the API surface quite pleasingly (and not need to even *touch* the code for the pro/fw)10:39
rogpeppefwereade: hmm, i'm not sure10:40
fwereaderogpeppe, that way we don't even expose an EnvironConfig API call that returns the user's credentials10:40
rogpeppefwereade: how does a trusted machine get the credentials in the first place?10:40
fwereaderogpeppe, however it does as it is? sorry, I'm not sure of the impact, can you expand?10:41
fwereaderogpeppe, machine 0 would have it magically; subsequent machine agents that need to run trusted tasks would, I presume, get the state info published to them10:41
rogpeppefwereade: i'd envisaged that we'd be able to repurpose an existing machine to run any job10:41
fwereaderogpeppe, I had a vague feeling that was in line with the approx plans?10:41
fwereaderogpeppe, yeah, I think we still can10:42
rogpeppefwereade: so how do we publish the state info to an existing machine?10:42
fwereaderogpeppe, you had the plans for a Publisher of API info, right? why not analogously for state info, but with more restrictions in the API?10:43
rogpeppefwereade: sure. but surely the place to publish it is in the state, no?10:43
fwereaderogpeppe, yeah, via the API... right?10:43
rogpeppefwereade: bingo10:44
rogpeppe[10:40:12] <fwereade> rogpeppe, that way we don't even expose an EnvironConfig API call that returns the user's credentials10:44
fwereaderogpeppe, ok, but the attack surface is limited to that one call... much like Login10:44
rogpeppefwereade: ah, no i see10:45
fwereaderogpeppe, and I *think* the savings form not having to implement the API bits that are only used by trusted workers will be handy10:45
rogpeppefwereade: yeah, i think that certainly for an interim period, your suggestion is good10:45
fwereaderogpeppe, yeah, we can evaluate how well it works :)10:46
rogpeppefwereade: rather than having an EnvironConfig call, we have a MongoStateInfo call (or something) which gives untrammelled access to the underlying state10:46
fwereaderogpeppe, btw, ISTM that the tools param to Environ.StartInstance is used very rarely indeed10:46
fwereaderogpeppe, yeah, exactly10:46
fwereaderogpeppe, that information feels like the stuff we also have to give to a machine running another Stater to connect them all up10:47
rogpeppefwereade: i'm not sure long term though10:47
rogpeppefwereade: having direct access to the state feels a bit like granting root access10:47
fwereaderogpeppe, don't worry, I'm not laying down cathedral plans ;)10:47
fwereaderogpeppe, sure, agreed10:47
rogpeppefwereade: and actually neither provisioner or firewaller need that level of access10:48
rogpeppefwereade: only the API server does10:48
fwereaderogpeppe, agreed -- I am not laying down cathedral plans10:48
rogpeppefwereade: ok10:48
fwereaderogpeppe, I'm suggesting that it's a good interim goal because it looks like the quickest way to get all our code running with *a* security boundary in place10:49
rogpeppefwereade: the only difficulty is that the logic in the machiner becomes more complex10:51
rogpeppefwereade: but that's probably a reasonable tradeoff10:52
fwereaderogpeppe, it feels tolerable, yeah10:52
rogpeppefwereade: yeah, it looks like we could get rid of the tools arg to StartInstance without losing anything significant10:57
rogpeppefwereade: trivial CL: https://codereview.appspot.com/731705011:04
fwereaderogpeppe, well, I think the tools interact very closely, I'm still trying to figure out the right way to go11:07
rogpeppefwereade: i managed to reproduce that mongodb "--format provided but not defined error" BTW. i'm not entirely sure which command is drawing that error, hence my trivial CL above.11:08
rogpeppefwereade: that's the bug i found w.r.t. the mongodb charm, BTW11:08
fwereaderogpeppe, LGTM trivial11:09
rogpeppefwereade: thank11:09
fwereaderogpeppe, but it's not reliably reproducible?11:09
rogpeppes11:09
rogpeppefwereade: yeah, it is11:09
fwereaderogpeppe, ah, fantastic11:10
rogpeppefwereade: it just takes a while to do it11:10
fwereaderogpeppe, heh11:10
fwereaderogpeppe, I'm thinking of --upload-tools, which I think at the moment just uses version.Current, which is probably right (given an absence of cross-compiling)11:12
rogpeppefwereade: it can't do anything else, yeah11:13
fwereaderogpeppe, in which case we have to check that the series and arch of the image/instance we start actually match what we're uploading11:13
rogpeppefwereade: hmm, i have to think about that a bit11:14
rogpeppefwereade: currently upload-tools is just an argument to bootstrap11:14
rogpeppefwereade: and there's nothing stopping you from provisioning more instances that don't use the originally uploaded tools11:14
fwereaderogpeppe, yeah, and vice versa11:14
fwereaderogpeppe, ok then, cool11:15
rogpeppefwereade: i'm not sure what you mean by "vice versa" there actually.11:15
rogpeppefwereade: you can't upload tools later11:15
fwereaderogpeppe, we *just* upload the tools we can, and the user is responsible for starting instances on which they will actually run11:15
fwereaderogpeppe, oh, I thought upgrade-juju could do that?11:16
rogpeppefwereade: oh yeah, so it does!11:16
fwereaderogpeppe, :D11:16
rogpeppe[11:16:00] <fwereade> rogpeppe, we *just* upload the tools we can, and the user is responsible for starting instances on which they will actually run11:17
rogpeppe+111:17
fwereaderogpeppe, ok, sweet11:17
fwereaderogpeppe, I am also eyeing environs.FindTools11:17
fwereaderogpeppe, I am suspecting that it should somehow give me a list of available tools matching certain criteria (filter on series and arches, I think)11:18
rogpeppefwereade: yeah. the significant issue around this is that currently we choose what tools an instance will run before we actually ask the provider to start the instance11:19
fwereaderogpeppe, that is I think ok11:19
rogpeppefwereade: but if the provider itself can decide on an architecture, for example, then that might be a problem11:19
rogpeppefwereade: perhaps FindTools should take a Constraints as an argument?11:20
rogpeppe[11:20:10] <rogpeppe> fwereade: perhaps FindTools should take a Constraints as an argument?11:20
rogpeppealthough series isn't really a constraint11:20
fwereaderogpeppe, perhaps -- yeah, I'm eyeing (series string, cons Constraints) args11:21
fwereaderogpeppe, that said... it would be *really* convenient if Series was a constraint11:21
rogpeppefwereade: yeah, and... why shouldn't it be?11:21
fwereaderogpeppe, because it's not something amenable to direct control like the others11:22
fwereaderogpeppe, the series is determined by the service's charm, which itself may be determined by the environ's default-series11:22
rogpeppefwereade: isn't it actually in a way *more* amenable to direct control (we can start different series on a given piece of hardware)11:22
fwereaderogpeppe, from the juju level, it is -- juju deploy cs:precise/foobar -- bam, there's precise11:23
fwereaderogpeppe, and there's the distinct setting of constraints, in which series does not play a part11:23
rogpeppefwereade: i'm not intrinsicaly opposed to the idea that a charm might influence the constraints of the machine that's started to deploy it11:23
fwereaderogpeppe, it *must*11:23
fwereaderogpeppe, precise charms run on precise11:23
fwereaderogpeppe, quantal charms run on quantal11:24
fwereaderogpeppe, etc11:24
rogpeppefwereade: ok, so how can the series *not* be part of the constraints?11:24
rogpeppefwereade: BTW how does getting a list of available tools from FindTools help you?11:25
fwereaderogpeppe, it is not entirely clear that the internal representation of a Constraints should *necessarily* carry with it the series information which is specified in a different way and could I think be inferred where necessary11:25
rogpeppefwereade: all constraints are optional, no? so there's no "necessary" there.11:26
fwereaderogpeppe, series is not optional11:26
fwereaderogpeppe, which is another way in which it is different to the other constraints11:27
rogpeppefwereade: no constraint is optional when the machine is actually instantiated :-)11:27
fwereaderogpeppe, that's information about a running instance, which we do want to match against constraints in future; but they are not themselves constraints11:28
fwereaderogpeppe, they represent a solution to the constraints, if you like11:28
rogpeppefwereade: yeah, and the form of the solution might look exactly like a Constraint :-)11:28
fwereaderogpeppe, they do indeed look very similar11:29
fwereaderogpeppe, but actually not exactly the same :)11:29
rogpeppefwereade: anyway, i'm not sure i see the advantage to passing the series around as an extra parameter to the constraints.11:29
rogpepperather, a parameter extra to the constraints11:30
rogpeppefwereade: and i definitely see simplicity advantages to including it with the constraints11:30
fwereaderogpeppe, I'm not sure the case is overwhelming either way, is all; it could easily be stored on state.Machine when a unit is assigned -- you always have a series, because the unit has a service has a charm -- as well as the service having constraints11:31
rogpeppefwereade: in fact, if series was part of the constraints, we perhaps wouldn't need default-series11:31
fwereaderogpeppe, I don't think it's the same thing, quite11:32
rogpeppefwereade: because it could be specified by the environment's series constraint.11:32
fwereaderogpeppe, that's where the default would come from -- but then you override that constraint in a different and magical way when you deploy, and you can't even set it from the UI11:33
rogpeppefwereade: i'm not sure it's "magical" - every charm comes with an implied series constraint.11:34
rogpeppefwereade: maybe you would want some special case code to prevent you setting a service's series constraint to something other than the charm's series though.11:35
fwereaderogpeppe, I am weighing up the costs and benefits of that special casing11:35
fwereaderogpeppe, I don;t feel entirely in favour of it: I think that doing that in the python was a bit of a mistake11:35
rogpeppefwereade: but tbh, "series" doesn't seem like something that should be so special. it's special now because everything's ubuntu-only.11:36
fwereaderogpeppe, I don;t suppose you know if there's a wiki page for the sprint yet?11:36
rogpeppefwereade: not afaik11:36
* rogpeppe must book flights11:36
fwereaderogpeppe, it's gonna be very special one day, I just hope it can bear the load that's put on its shoulders11:36
fwereaderogpeppe, it's in charms, it's in juju, and it's our one way of specifying a target os11:36
rogpeppefwereade: i could see it becoming a (os, os-version) tuple11:37
fwereaderogpeppe, indeed it might11:37
rogpeppefwereade: but maybe that's just a compound name11:37
fwereaderogpeppe, plausibly11:37
dimiternanyone seen mramm ?11:37
rogpeppefwereade: i'd prefer it to be two attributes as part of the constraints though,11:37
fwereadedimitern, we can all dogpile him when he gets on :)11:38
dimiternfwereade: :D sure11:38
rogpeppefwereade: to put it another way, what *wouldn't* work well (or be more complex) if series was part of the constraints?11:38
fwereaderogpeppe, environ-level series constraints would be weird -- they'd work a bit like default-series and a bit like the other constraints11:40
rogpeppefwereade: say we took default-series to be just the seed for setting the environ-level series constraint? would that cause problems?11:42
rogpeppefwereade: (we've already got to segregate default series from the other environment config params)11:42
rogpeppefwereade: (mind you, that's true of the agent version field too, and probably others)11:43
fwereaderogpeppe, yeah -- I think that it is tempting to put lots of stuff into constraints but I want to grow it prudently11:44
rogpeppefwereade: i would *not* put the agent version into constraints11:44
fwereaderogpeppe, quite so11:44
rogpeppefwereade: but i think series does work well as a constraint11:45
fwereaderogpeppe, a constraint that can't be set like the other constraints, can't be changed like the other constraints, and affects parts of the codebase that no other constraints impact?11:45
fwereaderogpeppe, it *may* indeed be a good place for it11:46
fwereaderogpeppe, but it will take some pretty seriously ugliness on the other side to balance that out11:46
fwereaderogpeppe, so, anyway, as I solve the constraints I will eliminate various images and instance-types from consideration, but I will still probably end up with multiple candidates11:49
fwereaderogpeppe, of those that the provider offers, there may not be tools available11:49
fwereaderogpeppe, gaah, sorry11:51
rogpeppefwereade: np11:51
fwereaderogpeppe, what was the last thing you saw?11:51
rogpeppe[11:49:26] <fwereade> rogpeppe, of those that the provider offers, there may not be tools available11:51
fwereaderogpeppe, cool, that was all I'd said11:51
rogpeppefwereade: yeah, i see where you're coming from11:52
fwereaderogpeppe, but still I will end up with a bunch of possible instance/image pairs, and appropriate tools for each, and then have to try to pick the "best" according to whatever soft constraints we have11:52
fwereaderogpeppe, that's a separate problem though11:53
rogpeppefwereade: the thing to be careful of is that you always want to pick from Storage over PublicStorage where possible.11:53
fwereaderogpeppe, hmm, if you want to use your own storage you're surely using it for higher-than-public versions..?11:54
rogpeppefwereade: "where possible" might just mean "where the difference is just in version  number"11:54
rogpeppefwereade: no, not necessarily11:54
rogpeppefwereade: it's important that you be able to upload lower-than-public versions too11:55
rogpeppefwereade: and have them used11:55
rogpeppefwereade: that was a significant part of the current design11:55
fwereaderogpeppe, ok, sgtm, thank you for pointing that out11:57
rogpeppefwereade: it means that if you use upload-tools, you rely on the fact that you're going to run the uploaded tools (assuming that you deploy to the same architecture)11:57
fwereaderogpeppe, but wait11:57
* rogpeppe waits with baited breath11:57
rogpeppeor is it "bated bread"?11:57
rogpeppebreath11:57
rogpeppeah, it is11:58
fwereaderogpeppe, the latter -- and fwereade is not sure11:58
* fwereade has just been reminded that he has to visit the shops for cath's lunch; bbiab11:58
rogpeppefwereade: ok11:58
fwereaderogpeppe, heyhey12:27
rogpeppefwereade: hihi12:28
fwereaderogpeppe, can we explore the public/private use cases a little more? I think I need a little refresher12:29
rogpeppefwereade: ok12:29
rogpeppefwereade: motivating example #1: we want to be able to run the local dev version of the tools without worrying about what might be in a public bucket12:30
rogpeppefwereade: what in particular are you interested in finding out?12:33
fwereaderogpeppe, hum, ok, so: does FindTools currently return the latest compatible tools in private, or if that's not there the latest compatible tools in public?12:35
rogpeppefwereade: yup12:35
fwereaderogpeppe, ok, so, I think the FindTools variant wants to return all latest matching private toolses, followed by all latest matching public toolses?12:37
* rogpeppe likes "toolses"12:37
fwereade:)12:37
rogpeppefwereade: i'd like to see a sketch of your algorithm for constraints solving before i commit to whether that's the right approach or not12:38
fwereaderogpeppe, 1) eliminate non-matching instance types12:39
fwereaderogpeppe, 2) eliminate non-matching images12:39
fwereaderogpeppe, discard bad combinations in (1) x (2)12:39
fwereaderogpeppe, (that may not come exactly there, but will be somewhere)12:40
fwereaderogpeppe, 3) eliminate images for which no tools can be found12:40
fwereaderogpeppe, 4) discard bad combinations12:41
fwereade5) magic happens here to nail down exactly which one we pick12:41
rogpeppefwereade: i've been wondering about the possibility of *starting* with the available tools12:42
rogpeppefwereade: but i'm not quite sure how that would look, or whether it would be better or worse. i suppose anything that eliminates more possibilities earlier is to be preferred.12:43
fwereaderogpeppe, yeah, it shouldn't be too hard to reorder stages if we need to12:43
rogpeppefwereade: that depends if each stage is dealing with a list of the same things12:46
fwereaderogpeppe, well, yes: we were I think talking about two stages of image-filtering12:46
rogpeppefwereade: {instance-type} -> {(instance-type, image)} -> {(instance-type, image, tools)}12:47
rogpeppefwereade: is that a reasonable summary of what the data types might look like through each stage?12:48
rogpeppefwereade: where {a} represents a set of a, and (a, b) represents a tuple of a and b.12:48
fwereaderogpeppe, yeah, roughly like that12:48
rogpeppefwereade: got lunch. back in a short while.12:51
* dimitern lunch12:58
rogpeppeniemeyer: yo!13:05
fwereadeniemeyer, heyhey13:22
niemeyerHeya13:23
* fwereade goes to eat the other half of lunch that he neglected before13:23
rogpeppefwereade: from the mongodb charm uniter log: http://paste.ubuntu.com/1676994/13:43
fwereaderogpeppe, what's --format json meant to do for relation-set?14:05
rogpeppefwereade: ha, good question, i'd missed that14:06
rogpeppefwereade: i'm surprised the python version allows it14:06
fwereaderogpeppe, (that is to say: grar, I guess to match python we need to implement the --format stuff on every hook tool, whether or not it makes sense14:06
fwereade)14:06
rogpeppefwereade: we can just ignore it i suppose, mostly14:07
fwereaderogpeppe, yeah, I think so14:07
fwereaderogpeppe, but tyvm, good catch14:07
rogpeppefwereade: np14:07
fwereaderogpeppe, do yu have the bug number handy? I can jot in an explanation14:08
rogpeppefwereade: sorry, i hadn't yet made a bug - i wanted to replicate it first14:09
fwereaderogpeppe, np -- then just note that we should add it for everything14:09
rogpeppefwereade: yea14:09
rogpeppeh14:09
fwereaderogpeppe, (every hook tool that is)14:09
rogpeppefwereade: https://bugs.launchpad.net/juju-core/+bug/112913014:11
_mup_Bug #1129130: all hook tools should support --format <juju-core:New> < https://launchpad.net/bugs/1129130 >14:11
fwereaderogpeppe, cool, tyvm14:11
hazmatbigjools, thanks for that mongo ppa, btw.14:55
dimiternfwereade: ping15:10
mgzthanks for the review hazmat15:11
hazmatmgz, np15:13
mgzhazmat: also, missed the review on the last change landed on lp:juju, have left a comment there now15:17
hazmatack15:18
mgzthe design for that changed too many times, and ended up in a confused state...15:19
hazmatmgz, r597 was pure breakage it appears15:20
hazmatmgz, the value returned by constraints convert is used for comparison and validation, the tests weren't previously getting to a real comparison because the constraints lacked series15:21
mgzthe issue is maas needs the original string, not something that juju constraints have mangled15:21
hazmatmgz, folks using it in practice would hit the issue that the string was being returned but the compare method was issubset15:21
mgzthe previous bug was from passing str(set(['tag-a', 'tag-b'])) which maas didn't understand because it doesn't parse python sets15:22
mgzso, that's fixable(ish) elsewhere, I just wonder if we've regressed the other bug...15:22
hazmatmgz, hmm.. the original string is preserved and serialized, noted thoug15:22
hazmatmgz, yeah.. not having a maas instance to test against makes this a bit of wackamole15:22
mgzprovided the convert method is only used for juju, and not in the api call, I think we're fine15:23
mgzbut I can't remember what exactly is the case there...15:23
hazmatmgz, the convert  call is also used against __getitem__ implicitly so the constraint acquisition for sending to maas may indeed have issue15:24
hazmatchecking15:24
mgzuses constraints.get... which I have a nasty feeling does convert15:24
mgzargh, and the maas client tests use dicts not real constraint objects because those are a pain to construst outside of a provider context15:26
hazmatnot clear that it does15:26
hazmatyeah..15:26
hazmatmgz, i'll have a look and try to do a proper constraints test with that api15:27
hazmatmgz, thanks15:38
hazmatmgz, digging through the tags stuff last  week, i did run into a concern of  tags that where valid at the time of service definition that are no longer valid cause issues16:11
mgzyeah, it's troublesome16:12
mgzthis is generally true for non-trivial constraints, just because it once resolved to something sane, doesn't mean it always will16:14
mgzso the provisioner needs to handle having a constraint that fails16:14
mgzrather than just going into a retry loop as it does at present...16:14
rogpeppefwereade: you'll like this one. noisy but trivial: https://codereview.appspot.com/732705016:38
fwereaderogpeppe, w00t!16:45
rogpeppefwereade: :-)16:45
rogpeppefwereade: i'm going to unexport state.NotFoundError and export state.NotFoundf16:46
rogpeppefwereade: because i want to be able to create a not-found error for testing purposes16:46
rogpeppefwereade: and there's no point really in exporting the type when we've got IsNotFound16:46
fwereaderogpeppe, yeah, as long as we have api.IsNotFound I'm not bothered by the precise gubbins16:47
TheRealMuefwereade: Just for info, I put the backend branch into work in progress again. I discovered a missing capability during the storage testing.16:47
rogpeppefwereade: cool16:47
fwereadeTheRealMue, ah, thanks16:47
=== TheRealMue is now known as TheMue
rogpeppefwereade: i'm leaning towards something a bit more general actually: api.ErrCode(err) == api.CodeNotFound16:48
rogpeppefwereade: although we could have IsNotFound as a short cut for that16:48
fwereaderogpeppe, sgtm16:48
fwereaderogpeppe, clear and close enough ;)16:48
=== deryck is now known as deryck[lunch]
rogpeppehmm, typing this was not a good idea:17:15
rogpeppebzr switch  lp:~rogpeppe/juju-core/221-instanceid-bool17:15
rogpeppenow: how to get myself out of it!17:16
mgzheh17:23
mgzwhat was the location before? just a plain branch, or something fancier?17:23
mgzrogpeppe: what do `bzr info` and `bzr branches` say?17:25
rogpeppemgz: it's ok, i've fixed it17:25
rogpeppemgz: i just edited the "location" file17:25
rogpeppemgz: i was using cobzr, so the location before was a file: branch17:26
mgz..that's okay for checkouts, if you also have sane tree state, switching back to the previous location is safer17:26
rogpeppemgz: i couldn't use "cobzr switch" because it complained at me17:27
mgzplain bzr switch, with the magic cobzr location, would work (with --force at least), but that does mean you need to know how cobzr maps names17:28
rogpeppemgz: ah, i didn't know that plain bzr had a "switch" command17:28
=== imbrando1 is now known as imbrandon
=== deryck[lunch] is now known as deryck
rogpeppehere's a dilemma: is it ethical to ask the company to pay 400 quid more for a flight so that i can get 4 hours sleep rather than none... ?18:37
rogpepperight, time to stop, see y'all tomorrow19:03
thumperpoos22:29
thumperdavecheney: ping22:29
davecheneythumper: ack22:30
thumperdavecheney: I have a slight problem22:30
davecheneyshoot22:30
thumperI've managed to cut out a lot of code duplication22:30
thumperwith one small problem22:30
thumperin all cases we want to parse the command line flags with "allowIntersperse=true"22:31
thumperexcept for the case of a supercommand22:31
thumperthe code is cmd.Main22:31
* davecheney looks22:31
thumperand I want to say "if this Command is a SuperCommand, then use false, otherwise use true"22:31
thumperCommand is an interface and SuperCommand just a struct22:32
thumperwhat is the best way to ask22:32
thumperdavecheney: the parsing used to be in the Init methods of *every* command22:32
thumperI'm wanting to remove that duplication22:32
davecheney+1 to that22:32
davecheneythumper: try a type switch22:32
thumperthe code is nice and simple22:32
thumperdavecheney: got an example?22:32
davecheneyc is of type cmd.Command22:33
davecheneyswitch c := c.(type) {22:33
davecheneycase *cmd.SuperCommand: // guess22:33
davecheney // do something22:33
davecheneydefault:22:33
thumperhmm... lemmie test22:33
davecheney // you are something else that conforms to cmd.Command22:33
davecheney}22:33
thumpersweet22:35
thumperworks in my small test prog22:35
thumperwill test in main code22:35
thumperdavecheney: I think I have it now, but I have to go collect daughter for lunch22:43
thumperback online after lunch22:43
davecheneythumper: no worries, i have to pop to the shops for breakfast stuffs22:46
bigjoolshazmat: the pleasure was all mine, believe me :)23:13

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