Return DigitalOcean image ID in output.

This commit is contained in:
Andrew Starr-Bochicchio 2015-12-15 12:00:04 -05:00
parent 8d574962d9
commit 2212125f46
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ func (a *Artifact) Id() string {
}
func (a *Artifact) String() string {
return fmt.Sprintf("A snapshot was created: '%v' in region '%v'", a.snapshotName, a.regionName)
return fmt.Sprintf("A snapshot was created: '%v' (ID: %v) in region '%v'", a.snapshotName, a.snapshotId, a.regionName)
}
func (a *Artifact) State(name string) interface{} {

View File

@ -25,7 +25,7 @@ func TestArtifactId(t *testing.T) {
func TestArtifactString(t *testing.T) {
a := &Artifact{"packer-foobar", 42, "San Francisco", nil}
expected := "A snapshot was created: 'packer-foobar' in region 'San Francisco'"
expected := "A snapshot was created: 'packer-foobar' (ID: 42) in region 'San Francisco'"
if a.String() != expected {
t.Fatalf("artifact string should match: %v", expected)