github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/state/testing/agent.go (about) 1 // Copyright 2012, 2013 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package testing 5 6 import ( 7 "github.com/juju/version" 8 9 "github.com/juju/juju/state" 10 ) 11 12 // SetAgentVersion sets the current agent version in the state's 13 // model configuration. 14 // This is similar to state.SetModelAgentVersion but it doesn't require that 15 // the model have all agents at the same version already. 16 func SetAgentVersion(st *state.State, vers version.Number) error { 17 return st.UpdateModelConfig(map[string]interface{}{"agent-version": vers.String()}, nil, nil) 18 }