state/apiserver: keep backups in env storage

Whenever the backup API is called keep the backup tarball in environment storage in addition to returning it to the client. Among other things, this will be used to support rollback when upgrades fail.

There is more work to be done to add APIs to support management of these backups. This will be done at a later date by the Moonstone team.
In that case use path.Join()


On Wed, Jul 9, 2014 at 3:26 PM, Menno Smits <notifications@github.com>
wrote:

> In state/backup/backup.go:
>
> > @@ -233,3 +233,9 @@ func Backup(password string, username string, outputFolder string, addr string)
> >  	}
> >  	return bkpFile, shaSum, nil
> >  }
> > +
> > +// StorageName returns the path in environment storage where a backup
> > +// should be stored.
> > +func StorageName(filename string) string {
> > +	return "/backups/" + filepath.Base(filename)
>
> This is very much intentional. This is a path in environment storage, not
> a path on disk. I want the same paths regardless of OS. It would be bad if
> we generated different storage paths depending on the OS this code runs on.
>
> Add a comment to make this clearer?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/juju/juju/pull/278/files#r14694028>.
>