Merge pull request #3718 from rakutentech/rename-config-parameters

provider/vsphere: rename vcenter_server config parameter to something clearer
This commit is contained in:
Paul Hinze 2015-12-02 14:04:52 -06:00
commit 4216a8d1e1
4 changed files with 11 additions and 11 deletions

View File

@ -16,12 +16,12 @@ const (
type Config struct {
User string
Password string
VCenterServer string
VSphereServer string
}
// Client() returns a new client for accessing VMWare vSphere.
func (c *Config) Client() (*govmomi.Client, error) {
u, err := url.Parse("https://" + c.VCenterServer + "/sdk")
u, err := url.Parse("https://" + c.VSphereServer + "/sdk")
if err != nil {
return nil, fmt.Errorf("Error parse url: %s", err)
}

View File

@ -23,11 +23,11 @@ func Provider() terraform.ResourceProvider {
Description: "The user password for vSphere API operations.",
},
"vcenter_server": &schema.Schema{
"vsphere_server": &schema.Schema{
Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("VSPHERE_VCENTER", nil),
Description: "The vCenter Server name for vSphere API operations.",
DefaultFunc: schema.EnvDefaultFunc("VSPHERE_SERVER", nil),
Description: "The vSphere Server name for vSphere API operations.",
},
},
@ -43,7 +43,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config := Config{
User: d.Get("user").(string),
Password: d.Get("password").(string),
VCenterServer: d.Get("vcenter_server").(string),
VSphereServer: d.Get("vsphere_server").(string),
}
return config.Client()

View File

@ -37,7 +37,7 @@ func testAccPreCheck(t *testing.T) {
t.Fatal("VSPHERE_PASSWORD must be set for acceptance tests")
}
if v := os.Getenv("VSPHERE_VCENTER"); v == "" {
t.Fatal("VSPHERE_VCENTER must be set for acceptance tests")
if v := os.Getenv("VSPHERE_SERVER"); v == "" {
t.Fatal("VSPHERE_SERVER must be set for acceptance tests")
}
}

View File

@ -27,7 +27,7 @@ provider at this time only supports IPv4 addresses on virtual machines.
provider "vsphere" {
user = "${var.vsphere_user}"
password = "${var.vsphere_password}"
vcenter_server = "${var.vsphere_vcenter_server}"
vsphere_server = "${var.vsphere_server}"
}
# Create a virtual machine
@ -55,8 +55,8 @@ The following arguments are used to configure the VMware vSphere Provider:
be specified with the `VSPHERE_USER` environment variable.
* `password` - (Required) This is the password for vSphere API operations. Can
also be specified with the `VSPHERE_PASSWORD` environment variable.
* `vcenter_server` - (Required) This is the vCenter server name for vSphere API
operations. Can also be specified with the `VSPHERE_VCENTER` environment
* `vsphere_server` - (Required) This is the vCenter server name for vSphere API
operations. Can also be specified with the `VSPHERE_SERVER` environment
variable.
## Acceptance Tests