~rogpeppe/juju-core/themue-058-debug-log-api

« back to all changes in this revision

Viewing changes to cloudinit/sshinit/configure.go

  • Committer: Frank Mueller
  • Date: 2014-01-07 13:59:00 UTC
  • mfrom: (2152.1.32 juju-core)
  • Revision ID: frank.mueller@canonical.com-20140107135900-t3akd2tp3s5fsujf
merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        // Config is the cloudinit config to carry out.
26
26
        Config *cloudinit.Config
27
27
 
28
 
        // Stdin is required to respond to sudo prompts,
29
 
        // and must be a terminal (except in tests)
30
 
        Stdin io.Reader
31
 
 
32
 
        // Stdout is required to present sudo prompts to the user.
33
 
        Stdout io.Writer
34
 
 
35
28
        // Stderr is required to present bootstrap progress to the user.
36
29
        Stderr io.Writer
37
30
}
48
41
        script = fmt.Sprintf(`F=$(mktemp); echo %s | base64 -d > $F; . $F`, scriptBase64)
49
42
        cmd := ssh.Command(
50
43
                params.Host,
51
 
                []string{"sudo", fmt.Sprintf("bash -c '%s'", script)},
52
 
                ssh.AllocateTTY,
 
44
                []string{"sudo", "-n", fmt.Sprintf("bash -c '%s'", script)},
 
45
                ssh.NoPasswordAuthentication,
53
46
        )
54
 
        cmd.Stdout = params.Stdout
55
47
        cmd.Stderr = params.Stderr
56
 
        cmd.Stdin = params.Stdin
57
48
        return cmd.Run()
58
49
}
59
50