Merge pull request #3000 from andrewsomething/do-image-id
Return DigitalOcean image ID in output.
This commit is contained in:
commit
cca054f4f4
|
@ -36,7 +36,7 @@ func (a *Artifact) Id() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Artifact) String() 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{} {
|
func (a *Artifact) State(name string) interface{} {
|
||||||
|
|
|
@ -25,7 +25,7 @@ func TestArtifactId(t *testing.T) {
|
||||||
|
|
||||||
func TestArtifactString(t *testing.T) {
|
func TestArtifactString(t *testing.T) {
|
||||||
a := &Artifact{"packer-foobar", 42, "San Francisco", nil}
|
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 {
|
if a.String() != expected {
|
||||||
t.Fatalf("artifact string should match: %v", expected)
|
t.Fatalf("artifact string should match: %v", expected)
|
||||||
|
|
Loading…
Reference in New Issue