2013-09-02 23:23:52 -04:00
|
|
|
package qemu
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2013-09-03 19:13:05 -04:00
|
|
|
// Artifact is the result of running the Qemu builder, namely a set
|
2013-09-02 23:23:52 -04:00
|
|
|
// of files associated with the resulting machine.
|
|
|
|
type Artifact struct {
|
|
|
|
dir string
|
|
|
|
f []string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*Artifact) BuilderId() string {
|
|
|
|
return BuilderId
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) Files() []string {
|
|
|
|
return a.f
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*Artifact) Id() string {
|
|
|
|
return "VM"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Artifact) String() string {
|
|
|
|
return fmt.Sprintf("VM files in directory: %s", a.dir)
|
|
|
|
}
|
|
|
|
|
2014-01-19 13:32:44 -05:00
|
|
|
func (a *Artifact) State(name string) interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2013-09-02 23:23:52 -04:00
|
|
|
func (a *Artifact) Destroy() error {
|
|
|
|
return os.RemoveAll(a.dir)
|
|
|
|
}
|