~themue/juju-core/053-env-more-script-friendly

« back to all changes in this revision

Viewing changes to environs/agent/agent.go

Merge trunk and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
        "launchpad.net/goyaml"
7
7
        "launchpad.net/juju-core/state"
8
8
        "launchpad.net/juju-core/state/api"
9
 
        "launchpad.net/juju-core/trivial"
 
9
        "launchpad.net/juju-core/utils"
10
10
        "os"
11
11
        "path"
12
12
        "regexp"
190
190
        addCmd := func(f string, a ...interface{}) {
191
191
                cmds = append(cmds, fmt.Sprintf(f, a...))
192
192
        }
193
 
        f := trivial.ShQuote(c.confFile())
194
 
        addCmd("mkdir -p %s", trivial.ShQuote(c.Dir()))
195
 
        addCmd("echo %s > %s", trivial.ShQuote(string(data)), f)
 
193
        f := utils.ShQuote(c.confFile())
 
194
        addCmd("mkdir -p %s", utils.ShQuote(c.Dir()))
 
195
        addCmd("echo %s > %s", utils.ShQuote(string(data)), f)
196
196
        addCmd("chmod %o %s", 0600, f)
197
197
        return cmds, nil
198
198
}
225
225
        }
226
226
        // We've succeeded in connecting with the old password, so
227
227
        // we can now change it to something more private.
228
 
        password, err := trivial.RandomPassword()
 
228
        password, err := utils.RandomPassword()
229
229
        if err != nil {
230
230
                st.Close()
231
231
                return nil, "", err