~fwereade/juju-core/uniter-relations-working-but-somewhat-too-big

« back to all changes in this revision

Viewing changes to cmd/jujud/unit.go

cmd/jujud: make agents change passwords ASAP

R=niemeyer
CC=
https://codereview.appspot.com/6655044

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
 
80
80
// runOnce runs a uniter once.
81
81
func (a *UnitAgent) runOnce() error {
82
 
        st, err := openState(state.UnitEntityName(a.UnitName), &a.Conf)
 
82
        st, password, err := openState(state.UnitEntityName(a.UnitName), &a.Conf)
83
83
        if err != nil {
84
84
                return err
85
85
        }
91
91
        if err != nil {
92
92
                return err
93
93
        }
 
94
        if password != "" {
 
95
                if err := unit.SetPassword(password); err != nil {
 
96
                        return err
 
97
                }
 
98
        }
94
99
        return runTasks(a.tomb.Dying(),
95
100
                uniter.NewUniter(st, unit.Name(), a.Conf.DataDir),
96
101
                NewUpgrader(st, unit, a.Conf.DataDir),