From 2212125f4657ff3494846e9b1790ff114a51aea7 Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Tue, 15 Dec 2015 12:00:04 -0500 Subject: [PATCH] Return DigitalOcean image ID in output. --- builder/digitalocean/artifact.go | 2 +- builder/digitalocean/artifact_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/digitalocean/artifact.go b/builder/digitalocean/artifact.go index 6abb561c9..8f6e81161 100644 --- a/builder/digitalocean/artifact.go +++ b/builder/digitalocean/artifact.go @@ -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{} { diff --git a/builder/digitalocean/artifact_test.go b/builder/digitalocean/artifact_test.go index 7ea586111..d8523154d 100644 --- a/builder/digitalocean/artifact_test.go +++ b/builder/digitalocean/artifact_test.go @@ -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)