A user just complained that he can't bootstrap because Juju is parsing
stderr text from flock, and his server isn't in English, so the error
message isn't matching.

https://github.com/juju/juju/blob/master/environs/sshstorage/storage.go#L254

Now, I think we all know that parsing error text is a bad idea, but I think
I understand why it was done - it looks like flock the application only
returns 1 on this failure, so it's not exactly a unique error code.
 However, flock the system call returns several different error codes,
which are quite unique and easy to handle in a way that is not dependent on
the language of the machine.

It also happens to be already implemented in the syscalls package:

http://golang.org/pkg/syscall/#Flock

So.... let's fix this, and try not to call out to bash unless there's
absolutely no other way.

-Nate
-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev

Reply via email to