~rogpeppe/juju-core/315-api-dialopts

« back to all changes in this revision

Viewing changes to environs/agent/agent.go

  • Committer: Roger Peppe
  • Date: 2013-05-25 13:11:46 UTC
  • Revision ID: roger.peppe@canonical.com-20130525131146-knkj6367hnnmapq4
api: add DialOpts to Open

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
// to the state should be changed accordingly - the caller should write the
206
206
// configuration with StateInfo.Password set to newPassword, then
207
207
// set the entity's password accordingly.
208
 
func (c *Conf) OpenAPI() (st *api.State, newPassword string, err error) {
 
208
func (c *Conf) OpenAPI(dialOpts api.DialOpts) (st *api.State, newPassword string, err error) {
209
209
        info := *c.APIInfo
210
210
        if info.Password != "" {
211
 
                st, err := api.Open(&info)
 
211
                st, err := api.Open(&info, dialOpts)
212
212
                if err == nil {
213
213
                        return st, "", nil
214
214
                }
221
221
                // with the old password.
222
222
        }
223
223
        info.Password = c.OldPassword
224
 
        st, err = api.Open(&info)
 
224
        st, err = api.Open(&info, dialOpts)
225
225
        if err != nil {
226
226
                return nil, "", err
227
227
        }