open question: should the methods on juju.Conn take a string or a type

David Cheney david.cheney at canonical.com
Tue Aug 7 11:47:15 UTC 2012


Hello, 

Sorry I didn't raise this on the call, but the call quality was so marginal I doubt it would have been effective.

Should the methods on juju.Conn take a string, or a type (*state.Service, et al)?

Currently there are precedents for *both*, conn.AddService takes the name of the service as a string, but conn.AddUnits takes a *state.Service (possibly because it follows logically on from the result from AddService).

William has suggested in the juju add-unit command branch that calling conn.State(), to get the *state.Service to pass to AddUnits is a smell as it breaks the (verbal) contract that "clients should only interact with Juju via the Conn". I am inclined to agree.

At the end of the day, if this leads to removing conn.State() from the public client API, I think this is a good thing. 

Thoughts ?

Cheers

Dave 





More information about the Juju-dev mailing list