github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/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/juju/state" 8 "github.com/juju/juju/version" 9 ) 10 11 // SetAgentVersion sets the current agent version in the state's 12 // environment configuration. 13 // This is similar to state.SetEnvironAgentVersion but it doesn't require that 14 // the environment have all agents at the same version already. 15 func SetAgentVersion(st *state.State, vers version.Number) error { 16 return st.UpdateEnvironConfig(map[string]interface{}{"agent-version": vers.String()}, nil, nil) 17 }