Acceptance Test Updates (#218)

* compute: don't pass choices

* blockstorage: don't pass choices

* DumpResource Function

This function prints a resource in JSON format but retains the actual
field name rather than using the name specified in the JSON tag.

* New DumpResource

This version just converts the resource into JSON. The original is
being left in git history for posterity.

* Renaming DumpResource to PrintResource

* Removing all print functions in favor of PrintResource

* Rebase reconcilliation
diff --git a/acceptance/openstack/blockstorage/extensions/volumeactions_test.go b/acceptance/openstack/blockstorage/extensions/volumeactions_test.go
index 83d1571..a088dd6 100644
--- a/acceptance/openstack/blockstorage/extensions/volumeactions_test.go
+++ b/acceptance/openstack/blockstorage/extensions/volumeactions_test.go
@@ -23,12 +23,7 @@
 		t.Fatalf("Unable to create a compute client: %v", err)
 	}
 
-	choices, err := clients.AcceptanceTestChoicesFromEnv()
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	server, err := compute.CreateServer(t, computeClient, choices)
+	server, err := compute.CreateServer(t, computeClient)
 	if err != nil {
 		t.Fatalf("Unable to create server: %v", err)
 	}
diff --git a/acceptance/openstack/blockstorage/v1/blockstorage.go b/acceptance/openstack/blockstorage/v1/blockstorage.go
index 3d4c9f1..41f24e1 100644
--- a/acceptance/openstack/blockstorage/v1/blockstorage.go
+++ b/acceptance/openstack/blockstorage/v1/blockstorage.go
@@ -140,44 +140,3 @@
 
 	t.Logf("Deleted volume type: %s", volumeType.ID)
 }
-
-// PrintVolume will print a volume and all of its attributes.
-func PrintVolume(t *testing.T, volume *volumes.Volume) {
-	t.Logf("ID: %s", volume.ID)
-	t.Logf("Status: %s", volume.Status)
-	t.Logf("Name: %s", volume.Name)
-	t.Logf("AvailabilityZone: %s", volume.AvailabilityZone)
-	t.Logf("Bootable: %s", volume.Bootable)
-	t.Logf("CreatedAt: %v", volume.CreatedAt)
-	t.Logf("Description: %s", volume.Description)
-	t.Logf("VolumeType: %s", volume.VolumeType)
-	t.Logf("SnapshotID: %s", volume.SnapshotID)
-	t.Logf("SourceVolID: %s", volume.SourceVolID)
-	t.Logf("Size: %d", volume.Size)
-	t.Logf("Metadata: %#v", volume.Metadata)
-	t.Logf("Attachments: %#v", volume.Attachments)
-}
-
-// PrintVolumeType will print a volume type and all of its attributes.
-func PrintVolumeType(t *testing.T, volumeType *volumetypes.VolumeType) {
-	t.Logf("ID: %s", volumeType.ID)
-	t.Logf("Name: %s", volumeType.Name)
-	t.Logf("ExtraSpecs: %#v", volumeType.ExtraSpecs)
-}
-
-// PrintSnapshot will print a snapshot and all of its attributes.
-func PrintSnapshot(t *testing.T, snapshot *snapshots.Snapshot) {
-	t.Logf("ID: %s", snapshot.ID)
-	t.Logf("Status: %s", snapshot.Status)
-	t.Logf("Name: %s", snapshot.Name)
-	t.Logf("AvailabilityZone: %s", snapshot.AvailabilityZone)
-	t.Logf("Bootable: %s", snapshot.Bootable)
-	t.Logf("CreatedAt: %v", snapshot.CreatedAt)
-	t.Logf("Description: %s", snapshot.Description)
-	t.Logf("VolumeType: %s", snapshot.VolumeType)
-	t.Logf("SnapshotID: %s", snapshot.SnapshotID)
-	t.Logf("VolumeID: %s", snapshot.VolumeID)
-	t.Logf("Size: %d", snapshot.Size)
-	t.Logf("Metadata: %#v", snapshot.Metadata)
-	t.Logf("Attachments: %#v", snapshot.Attachments)
-}
diff --git a/acceptance/openstack/blockstorage/v1/snapshots_test.go b/acceptance/openstack/blockstorage/v1/snapshots_test.go
index 2dc58db..3545371 100644
--- a/acceptance/openstack/blockstorage/v1/snapshots_test.go
+++ b/acceptance/openstack/blockstorage/v1/snapshots_test.go
@@ -6,6 +6,7 @@
 	"testing"
 
 	"github.com/gophercloud/gophercloud/acceptance/clients"
+	"github.com/gophercloud/gophercloud/acceptance/tools"
 	"github.com/gophercloud/gophercloud/openstack/blockstorage/v1/snapshots"
 )
 
@@ -26,7 +27,7 @@
 	}
 
 	for _, snapshot := range allSnapshots {
-		PrintSnapshot(t, &snapshot)
+		tools.PrintResource(t, snapshot)
 	}
 }
 
@@ -53,5 +54,5 @@
 		t.Errorf("Unable to retrieve snapshot: %v", err)
 	}
 
-	PrintSnapshot(t, newSnapshot)
+	tools.PrintResource(t, newSnapshot)
 }
diff --git a/acceptance/openstack/blockstorage/v1/volumes_test.go b/acceptance/openstack/blockstorage/v1/volumes_test.go
index e375c59..9a55500 100644
--- a/acceptance/openstack/blockstorage/v1/volumes_test.go
+++ b/acceptance/openstack/blockstorage/v1/volumes_test.go
@@ -6,6 +6,7 @@
 	"testing"
 
 	"github.com/gophercloud/gophercloud/acceptance/clients"
+	"github.com/gophercloud/gophercloud/acceptance/tools"
 	"github.com/gophercloud/gophercloud/openstack/blockstorage/v1/volumes"
 )
 
@@ -26,7 +27,7 @@
 	}
 
 	for _, volume := range allVolumes {
-		PrintVolume(t, &volume)
+		tools.PrintResource(t, volume)
 	}
 }
 
@@ -47,5 +48,5 @@
 		t.Errorf("Unable to retrieve volume: %v", err)
 	}
 
-	PrintVolume(t, newVolume)
+	tools.PrintResource(t, newVolume)
 }
diff --git a/acceptance/openstack/blockstorage/v1/volumetypes_test.go b/acceptance/openstack/blockstorage/v1/volumetypes_test.go
index 843ea21..ace09bc 100644
--- a/acceptance/openstack/blockstorage/v1/volumetypes_test.go
+++ b/acceptance/openstack/blockstorage/v1/volumetypes_test.go
@@ -6,6 +6,7 @@
 	"testing"
 
 	"github.com/gophercloud/gophercloud/acceptance/clients"
+	"github.com/gophercloud/gophercloud/acceptance/tools"
 	"github.com/gophercloud/gophercloud/openstack/blockstorage/v1/volumetypes"
 )
 
@@ -26,7 +27,7 @@
 	}
 
 	for _, volumeType := range allVolumeTypes {
-		PrintVolumeType(t, &volumeType)
+		tools.PrintResource(t, volumeType)
 	}
 }
 
@@ -42,5 +43,5 @@
 	}
 	defer DeleteVolumeType(t, client, volumeType)
 
-	PrintVolumeType(t, volumeType)
+	tools.PrintResource(t, volumeType)
 }
diff --git a/acceptance/openstack/blockstorage/v2/blockstorage.go b/acceptance/openstack/blockstorage/v2/blockstorage.go
index 555bdcd..39fb7da 100644
--- a/acceptance/openstack/blockstorage/v2/blockstorage.go
+++ b/acceptance/openstack/blockstorage/v2/blockstorage.go
@@ -42,11 +42,16 @@
 
 // CreateVolumeFromImage will create a volume from with a random name and size of
 // 1GB. An error will be returned if the volume was unable to be created.
-func CreateVolumeFromImage(t *testing.T, client *gophercloud.ServiceClient, choices *clients.AcceptanceTestChoices) (*volumes.Volume, error) {
+func CreateVolumeFromImage(t *testing.T, client *gophercloud.ServiceClient) (*volumes.Volume, error) {
 	if testing.Short() {
 		t.Skip("Skipping test that requires volume creation in short mode.")
 	}
 
+	choices, err := clients.AcceptanceTestChoicesFromEnv()
+	if err != nil {
+		t.Fatal(err)
+	}
+
 	volumeName := tools.RandomString("ACPTTEST", 16)
 	t.Logf("Attempting to create volume: %s", volumeName)
 
@@ -79,26 +84,3 @@
 
 	t.Logf("Deleted volume: %s", volume.ID)
 }
-
-// PrintVolume will print a volume and all of its attributes.
-func PrintVolume(t *testing.T, volume *volumes.Volume) {
-	t.Logf("ID: %s", volume.ID)
-	t.Logf("Status: %s", volume.Status)
-	t.Logf("Size: %d", volume.Size)
-	t.Logf("AvailabilityZone: %s", volume.AvailabilityZone)
-	t.Logf("CreatedAt: %v", volume.CreatedAt)
-	t.Logf("UpdatedAt: %v", volume.CreatedAt)
-	t.Logf("Attachments: %#v", volume.Attachments)
-	t.Logf("Name: %s", volume.Name)
-	t.Logf("Description: %s", volume.Description)
-	t.Logf("VolumeType: %s", volume.VolumeType)
-	t.Logf("SnapshotID: %s", volume.SnapshotID)
-	t.Logf("SourceVolID: %s", volume.SourceVolID)
-	t.Logf("Metadata: %#v", volume.Metadata)
-	t.Logf("UserID: %s", volume.UserID)
-	t.Logf("Bootable: %s", volume.Bootable)
-	t.Logf("Encrypted: %s", volume.Encrypted)
-	t.Logf("ReplicationStatus: %s", volume.ReplicationStatus)
-	t.Logf("ConsistencyGroupID: %s", volume.ConsistencyGroupID)
-	t.Logf("Multiattach: %t", volume.Multiattach)
-}
diff --git a/acceptance/openstack/blockstorage/v2/volumes_test.go b/acceptance/openstack/blockstorage/v2/volumes_test.go
index 3508bc5..9003ca7 100644
--- a/acceptance/openstack/blockstorage/v2/volumes_test.go
+++ b/acceptance/openstack/blockstorage/v2/volumes_test.go
@@ -6,6 +6,7 @@
 	"testing"
 
 	"github.com/gophercloud/gophercloud/acceptance/clients"
+	"github.com/gophercloud/gophercloud/acceptance/tools"
 	"github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes"
 )
 
@@ -26,7 +27,7 @@
 	}
 
 	for _, volume := range allVolumes {
-		PrintVolume(t, &volume)
+		tools.PrintResource(t, volume)
 	}
 }
 
@@ -47,5 +48,5 @@
 		t.Errorf("Unable to retrieve volume: %v", err)
 	}
 
-	PrintVolume(t, newVolume)
+	tools.PrintResource(t, newVolume)
 }