Merge pull request #3000 from andrewsomething/do-image-id

Return DigitalOcean image ID in output.
This commit is contained in:
Chris Bednarski 2015-12-17 17:11:46 -05:00
commit cca054f4f4
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)