I wanted to postpone that, in case there is a use case in tests to reset
the provisioned state, by passing "", "". But this is not needed now, so
I'll add the check, thanks.
https://codereview.appspot.com/8561044/diff/1/state/machine.go#newcode410
state/machine.go:410: {{"instanceid", ""}},
On 2013/04/09 13:26:27, fwereade wrote:
> Hmm. I think it might be better to simplify this -- just assert that
instanceid
> and nonce are empty, and leave the rest of the error handling as is.
> I'm worried that this is a situation in which arbitrarily delayed
transactions
> can have real-world effects, but I can't see what to do about it. One
to think
> about...
I raised my concerns online about replaying transactions, etc. I'll do
it.
Please take a look.
https:/ /codereview. appspot. com/8561044/ diff/1/ state/machine. go
File state/machine.go (right):
https:/ /codereview. appspot. com/8561044/ diff/1/ state/machine. go#newcode407 go:407: func (m *Machine) SetProvisioned(id InstanceId,
state/machine.
nonce string) error {
On 2013/04/09 13:26:27, fwereade wrote:
> Please check that neither id nor nonce are "".
I wanted to postpone that, in case there is a use case in tests to reset
the provisioned state, by passing "", "". But this is not needed now, so
I'll add the check, thanks.
https:/ /codereview. appspot. com/8561044/ diff/1/ state/machine. go#newcode410 go:410: {{"instanceid", ""}},
state/machine.
On 2013/04/09 13:26:27, fwereade wrote:
> Hmm. I think it might be better to simplify this -- just assert that
instanceid
> and nonce are empty, and leave the rest of the error handling as is.
> I'm worried that this is a situation in which arbitrarily delayed
transactions
> can have real-world effects, but I can't see what to do about it. One
to think
> about...
I raised my concerns online about replaying transactions, etc. I'll do
it.
https:/ /codereview. appspot. com/8561044/ diff/1/ state/machine. go#newcode418 go:418: errMsg := "cannot set instance id of machine %q: ErrorContextf( ...)
state/machine.
%v"
On 2013/04/09 13:26:27, fwereade wrote:
> defer trivial.
Ha! One place where using it is actually a good idea :)
https:/ /codereview. appspot. com/8561044/ diff/1/ worker/ provisioner/ provisioner. go provisioner/ provisioner. go (right):
File worker/
https:/ /codereview. appspot. com/8561044/ diff/1/ worker/ provisioner/ provisioner. go#newcode272 provisioner/ provisioner. go:272: }
worker/
On 2013/04/09 13:26:27, fwereade wrote:
> nonce := "fake_nonce"
Done.
https:/ /codereview. appspot. com/8561044/ diff/1/ worker/ provisioner/ provisioner. go#newcode274 provisioner/ provisioner. go:274: inst, err := StartInstance( m.Id(), "fake_nonce", m.Series(), cons, nonce"/ nonce/
worker/
p.environ.
stateInfo, apiInfo)
On 2013/04/09 13:26:27, fwereade wrote:
> s/"fake_
Done.
https:/ /codereview. appspot. com/8561044/ diff/1/ worker/ provisioner/ provisioner. go#newcode280 provisioner/ provisioner. go:280: if err1 := params. MachineError, err.Error()); err1 != nil {
worker/
m.SetStatus(
On 2013/04/09 13:26:27, fwereade wrote:
> s/err1/err/, I think?
We'll lose the context of the previous error, won't we?
https:/ /codereview. appspot. com/8561044/ diff/1/ worker/ provisioner/ provisioner. go#newcode287 provisioner/ provisioner. go:287: // TODO(dimitern) generate an
worker/
unique random nonce in a follow-up.
On 2013/04/09 13:31:41, TheMue wrote:
> Take trivial.NewUUID() for it.
That's coming in the follow-up :)
https:/ /codereview. appspot. com/8561044/ diff/1/ worker/ provisioner/ provisioner. go#newcode288 provisioner/ provisioner. go:288: if err := d(inst. Id(), ""); err != nil {
worker/
m.SetProvisione
On 2013/04/09 13:26:27, fwereade wrote:
> I think SetProvisioned with an empty nonce should fail, really.
s/""/nonce/
> anyway.
Done.
https:/ /codereview. appspot. com/8561044/ diff/1/ worker/ provisioner/ provisioner. go#newcode292 provisioner/ provisioner. go:292: // killed again.
worker/
On 2013/04/09 13:26:27, fwereade wrote:
> We should try to stop the instance right away anyway, I think. TODO it
maybe?
We'll do that a bit later in the loop. But I guess it's worth a TODO.
https:/ /codereview. appspot. com/8561044/