Esempio n. 1
0
func initConstraintsAndBootstrapMachine(c ConfigSetter, st *state.State, cfg BootstrapMachineConfig) (*state.Machine, error) {
	if err := st.SetModelConstraints(cfg.ModelConstraints); err != nil {
		return nil, errors.Errorf("cannot set initial environ constraints: %v", err)
	}
	m, err := initBootstrapMachine(c, st, cfg)
	if err != nil {
		return nil, errors.Errorf("cannot initialize bootstrap machine: %v", err)
	}
	return m, nil
}
Esempio n. 2
0
func initConstraintsAndBootstrapMachine(c agent.ConfigSetter, st *state.State, cfg BootstrapMachineConfig) (*state.Machine, error) {
	if err := st.SetModelConstraints(cfg.ModelConstraints); err != nil {
		return nil, errors.Annotate(err, "cannot set initial model constraints")
	}
	m, err := initBootstrapMachine(c, st, cfg)
	if err != nil {
		return nil, errors.Annotate(err, "cannot initialize bootstrap machine")
	}
	return m, nil
}