make fmt
This commit is contained in:
parent
0694f2635b
commit
716f19a457
|
@ -20,7 +20,7 @@ func TestBuilder_Prepare_DiskAsInput(t *testing.T) {
|
|||
t.Error("Expected the returned error to be of type packer.MultiError")
|
||||
}
|
||||
for _, err := range errs.Errors {
|
||||
if matched, _:=regexp.MatchString(`(^|\W)source\W`,err.Error()); matched {
|
||||
if matched, _ := regexp.MatchString(`(^|\W)source\W`, err.Error()); matched {
|
||||
t.Errorf("Did not expect an error about the 'source' field, but found %q", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,11 +17,11 @@ type MetadataClientAPI interface {
|
|||
GetComputeInfo() (*ComputeInfo, error)
|
||||
}
|
||||
|
||||
type ComputeInfo struct{
|
||||
type ComputeInfo struct {
|
||||
Name string
|
||||
ResourceGroupName string
|
||||
SubscriptionID string
|
||||
Location string
|
||||
Location string
|
||||
}
|
||||
|
||||
// metadataClient implements MetadataClient
|
||||
|
@ -65,7 +65,7 @@ func (client metadataClient) GetComputeInfo() (*ComputeInfo, error) {
|
|||
return &vminfo.ComputeInfo, nil
|
||||
}
|
||||
|
||||
func(ci ComputeInfo) ResourceID() string{
|
||||
func (ci ComputeInfo) ResourceID() string {
|
||||
return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachines/%s",
|
||||
ci.SubscriptionID,
|
||||
ci.ResourceGroupName,
|
||||
|
|
|
@ -1,31 +1,30 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"os"
|
||||
"testing"
|
||||
"net/http"
|
||||
"errors"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest/azure/auth"
|
||||
)
|
||||
|
||||
func GetTestClientSet(t *testing.T) (AzureClientSet, error) {
|
||||
if (os.Getenv("AZURE_INTEGRATION_TEST") == "") {
|
||||
t.Skip("AZURE_INTEGRATION_TEST not set")
|
||||
if os.Getenv("AZURE_INTEGRATION_TEST") == "" {
|
||||
t.Skip("AZURE_INTEGRATION_TEST not set")
|
||||
} else {
|
||||
a, err := auth.NewAuthorizerFromEnvironment()
|
||||
if err == nil {
|
||||
cli := azureClientSet{}
|
||||
cli.authorizer = a
|
||||
cli.authorizer = a
|
||||
cli.subscriptionID = os.Getenv("AZURE_SUBSCRIPTION_ID")
|
||||
cli.PollingDelay = 0
|
||||
cli.sender = http.DefaultClient
|
||||
return cli, nil
|
||||
} else {
|
||||
} else {
|
||||
t.Skipf("Could not create Azure client: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil, errors.New("Couldn't create client set")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue