packer-cn/builder/vmware/common/remote_artifact.go

40 lines
734 B
Go
Raw Normal View History

package common
2013-06-06 15:12:54 -07:00
import (
"fmt"
)
2013-06-06 15:12:54 -07:00
// Artifact is the result of running the VMware builder, namely a set
// of files associated with the resulting machine.
type RemoteArtifact struct {
builderId string
2017-07-28 03:59:11 +03:00
id string
dir OutputDir
f []string
config map[string]string
2013-06-06 15:12:54 -07:00
}
func (a *RemoteArtifact) BuilderId() string {
return a.builderId
2013-06-06 15:12:54 -07:00
}
func (a *RemoteArtifact) Files() []string {
2013-06-06 15:12:54 -07:00
return a.f
}
func (a *RemoteArtifact) Id() string {
2017-07-28 03:59:11 +03:00
return a.id
2013-06-06 15:12:54 -07:00
}
func (a *RemoteArtifact) String() string {
2013-06-06 15:12:54 -07:00
return fmt.Sprintf("VM files in directory: %s", a.dir)
}
func (a *RemoteArtifact) State(name string) interface{} {
return a.config[name]
}
func (a *RemoteArtifact) Destroy() error {
return a.dir.RemoveAll()
}