@@ -48,11 +48,12 @@ func NewRestoreCommand() cmd.Command {
4848// it is invoked with "juju restore-backup".
4949type restoreCommand struct {
5050 CommandBase
51- constraints constraints.Value
52- filename string
53- backupId string
54- bootstrap bool
55- uploadTools bool
51+ constraints constraints.Value
52+ filename string
53+ backupId string
54+ bootstrap bool
55+ buildAgent bool
56+ uploadToolsDeprecated bool
5657
5758 newAPIClientFunc func () (RestoreAPI , error )
5859 newEnvironFunc func (environs.OpenParams ) (environs.Environ , error )
@@ -111,7 +112,8 @@ func (c *restoreCommand) SetFlags(f *gnuflag.FlagSet) {
111112 f .BoolVar (& c .bootstrap , "b" , false , "Bootstrap a new state machine" )
112113 f .StringVar (& c .filename , "file" , "" , "Provide a file to be used as the backup." )
113114 f .StringVar (& c .backupId , "id" , "" , "Provide the name of the backup to be restored" )
114- f .BoolVar (& c .uploadTools , "upload-tools" , false , "Upload tools if bootstraping a new machine" )
115+ f .BoolVar (& c .buildAgent , "build-agent" , false , "Build binary agent if bootstraping a new machine" )
116+ f .BoolVar (& c .uploadToolsDeprecated , "upload-tools" , false , "DEPRECATED: see build-agent" )
115117}
116118
117119// Init is where the preconditions for this commands can be checked.
@@ -125,6 +127,12 @@ func (c *restoreCommand) Init(args []string) error {
125127 if c .backupId != "" && c .bootstrap {
126128 return errors .Errorf ("it is not possible to rebootstrap and restore from an id." )
127129 }
130+
131+ // TODO(wallyworld) - remove me when CI scripts updated
132+ if c .uploadToolsDeprecated {
133+ c .buildAgent = c .uploadToolsDeprecated
134+ }
135+
128136 var err error
129137 if c .filename != "" {
130138 c .filename , err = filepath .Abs (c .filename )
@@ -316,8 +324,8 @@ func (c *restoreCommand) rebootstrap(ctx *cmd.Context, meta *params.BackupsMetad
316324 CloudCredentialName : params .CredentialName ,
317325 CloudCredential : params .Cloud .Credential ,
318326 ModelConstraints : c .constraints ,
319- UploadTools : c . uploadTools ,
320- BuildToolsTarball : sync .BuildToolsTarball ,
327+ BuildAgent : c . buildAgent ,
328+ BuildAgentTarball : sync .BuildAgentTarball ,
321329 ControllerConfig : params .ControllerConfig ,
322330 HostedModelConfig : hostedModelConfig ,
323331 BootstrapSeries : meta .Series ,
0 commit comments