Reorganize client/common packages
This commit is contained in:
parent
fe584f4448
commit
0866cb3714
|
@ -4,7 +4,6 @@ package client
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/packer/builder/azure/common"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -303,4 +302,4 @@ func (c *Config) FillParameters() error {
|
|||
}
|
||||
|
||||
// allow override for unit tests
|
||||
var findTenantID = common.FindTenantID
|
||||
var findTenantID = FindTenantID
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// +build !linux
|
||||
|
||||
package common
|
||||
package client
|
||||
|
||||
// IsAzure returns true if Packer is running on Azure (currently only works on Linux)
|
||||
func IsAzure() bool {
|
|
@ -1,4 +1,4 @@
|
|||
package common
|
||||
package client
|
||||
|
||||
import (
|
||||
"bytes"
|
|
@ -1,4 +1,4 @@
|
|||
package common
|
||||
package client
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
|
@ -1,4 +1,4 @@
|
|||
package common
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
|
@ -6,12 +6,11 @@ import (
|
|||
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
|
||||
"github.com/hashicorp/packer/builder/azure/common"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_MetadataReturnsComputeInfo(t *testing.T) {
|
||||
if !common.IsAzure() {
|
||||
if !IsAzure() {
|
||||
t.Skipf("Not running on Azure, skipping live IMDS test")
|
||||
}
|
||||
mdc := NewMetadataClient()
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
|
||||
"github.com/Azure/go-autorest/autorest/adal"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
packerAzureCommon "github.com/hashicorp/packer/builder/azure/common"
|
||||
)
|
||||
|
||||
func NewDeviceFlowOAuthTokenProvider(env azure.Environment, say func(string), tenantID string) oAuthTokenProvider {
|
||||
|
@ -36,5 +35,5 @@ func (tp *deviceflowOauthTokenProvider) getServicePrincipalTokenWithResource(res
|
|||
tp.say(fmt.Sprintf("Getting token for %s", resource))
|
||||
}
|
||||
|
||||
return packerAzureCommon.Authenticate(tp.env, tp.tenantID, tp.say, resource)
|
||||
return Authenticate(tp.env, tp.tenantID, tp.say, resource)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue