Prepend a string to the User-Agent.
For both OpenStack and Rackspace drivers. Signed-off-by: Ash Wilson <ash.wilson@rackspace.com>
This commit is contained in:
@@ -2,9 +2,11 @@ package openstack
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/docker/machine/version"
|
||||
"github.com/rackspace/gophercloud"
|
||||
"github.com/rackspace/gophercloud/openstack"
|
||||
"github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs"
|
||||
@@ -416,6 +418,8 @@ func (c *GenericClient) Authenticate(d *Driver) error {
|
||||
return err
|
||||
}
|
||||
|
||||
provider.UserAgent.Prepend(fmt.Sprintf("docker-machine/v%s", version.VERSION))
|
||||
|
||||
if d.Insecure {
|
||||
// Configure custom TLS settings.
|
||||
config := &tls.Config{InsecureSkipVerify: true}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/docker/machine/drivers/openstack"
|
||||
"github.com/docker/machine/version"
|
||||
"github.com/rackspace/gophercloud"
|
||||
"github.com/rackspace/gophercloud/rackspace"
|
||||
)
|
||||
@@ -36,10 +37,18 @@ func (c *Client) Authenticate(d *openstack.Driver) error {
|
||||
APIKey: apiKey,
|
||||
}
|
||||
|
||||
provider, err := rackspace.AuthenticatedClient(opts)
|
||||
provider, err := rackspace.NewClient(rackspace.RackspaceUSIdentity)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
provider.UserAgent.Prepend(fmt.Sprintf("docker-machine/v%s", version.VERSION))
|
||||
|
||||
err = rackspace.Authenticate(provider, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c.Provider = provider
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user