Fwd: Machine.InstanceId error condition.

David Cheney david.cheney at canonical.com
Wed Jun 20 10:02:30 UTC 2012




Begin forwarded message:

> From: Dave Cheney <dave at cheney.net>
> Date: 20 June 2012 19:59:54 AEST
> To: juju-dev at lists.ubuntu.com
> Subject: Machine.InstanceId error condition.
> 
> Hello,
> 
> I'm working on a branch to address the todo surrounding machine.InstanceId retuning an error if no Id was set. Given the frequency of this condition (at least 50% of the code paths expect the instance id to be _not_ set) I am considering this signature. 
> 
> id, set, err := machine.InstanceId()
> 
> Where set is a Boolean, and error is only non nil when something error worthy happened. 
> 
> In other words, id should not be an empty string unless set is false or err is non nil. 
> 
> I've already prototyped the more obvious
> 
> id, err := ...
> 
> version, but found that I was duplicating a lot of logic dissecting the err value for the NoInstanceIdError sentinel. 
> 
> Thoughts
> 
> Cheers
> 
> Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20120620/2800f5c6/attachment.html>


More information about the Juju-dev mailing list