fixed nits

This commit is contained in:
= 2017-04-06 16:27:22 -06:00
parent 4bfd0fd15b
commit 1d02ed51c1
5 changed files with 11 additions and 14 deletions

View File

@ -11,17 +11,13 @@ func TestAccOPCIPAddressAssociation_importBasic(t *testing.T) {
resourceName := "opc_compute_ip_address_association.test" resourceName := "opc_compute_ip_address_association.test"
ri := acctest.RandInt() ri := acctest.RandInt()
config := testAccIPAddressAssociationBasic(ri)
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { PreCheck: func() { testAccPreCheck(t) },
testAccPreCheck(t)
},
Providers: testAccProviders, Providers: testAccProviders,
CheckDestroy: testAccCheckIPAddressAssociationDestroy, CheckDestroy: testAccCheckIPAddressAssociationDestroy,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
{ {
Config: config, Config: testAccIPAddressAssociationBasic(ri),
}, },
{ {
ResourceName: resourceName, ResourceName: resourceName,

View File

@ -72,7 +72,7 @@ func Provider() terraform.ResourceProvider {
"opc_compute_vnic_set": resourceOPCVNICSet(), "opc_compute_vnic_set": resourceOPCVNICSet(),
"opc_compute_security_protocol": resourceOPCSecurityProtocol(), "opc_compute_security_protocol": resourceOPCSecurityProtocol(),
"opc_compute_ip_address_prefix_set": resourceOPCIPAddressPrefixSet(), "opc_compute_ip_address_prefix_set": resourceOPCIPAddressPrefixSet(),
"opc_compute_ip_address_association": resourceOPCIPAddressAssociation(), "opc_compute_ip_address_association": resourceOPCIPAddressAssociation(),
}, },
ConfigureFunc: providerConfigure, ConfigureFunc: providerConfigure,

View File

@ -90,7 +90,11 @@ func resourceOPCIPAddressAssociationRead(d *schema.ResourceData, meta interface{
d.SetId("") d.SetId("")
return nil return nil
} }
return fmt.Errorf("Error reading IP Address Association %s: %s", d.Id(), err) return fmt.Errorf("Error reading IP Address Association %s: %s", getInput.Name, err)
}
if result == nil {
d.SetId("")
return fmt.Errorf("Error reading IP Address Association %s: %s", getInput.Name, err)
} }
d.Set("name", result.Name) d.Set("name", result.Name)

View File

@ -140,9 +140,6 @@ data "opc_compute_network_interface" "eth0" {
instance_id = "${opc_compute_instance.test.id}" instance_id = "${opc_compute_instance.test.id}"
interface = "eth0" interface = "eth0"
} }
data "opc_compute_vnic" "foo" {
name = "${data.opc_compute_network_interface.eth0.vnic}"
}
resource "opc_compute_ip_address_reservation" "test" { resource "opc_compute_ip_address_reservation" "test" {
name = "testing-ip-address-association-%d" name = "testing-ip-address-association-%d"
description = "testing-desc-%d" description = "testing-desc-%d"
@ -151,7 +148,7 @@ resource "opc_compute_ip_address_reservation" "test" {
resource "opc_compute_ip_address_association" "test" { resource "opc_compute_ip_address_association" "test" {
name = "testing-acc-%d" name = "testing-acc-%d"
ip_address_reservation = "${opc_compute_ip_address_reservation.test.name}" ip_address_reservation = "${opc_compute_ip_address_reservation.test.name}"
vnic = "${data.opc_compute_vnic.foo.name}" vnic = "${data.opc_compute_network_interface.eth0.vnic}"
description = "acctesting ip address association test %d" description = "acctesting ip address association test %d"
tags = ["tag1", "tag2"] tags = ["tag1", "tag2"]
}`, rInt, rInt, rInt, rInt, rInt, rInt, rInt) }`, rInt, rInt, rInt, rInt, rInt, rInt, rInt)

View File

@ -8,7 +8,7 @@ description: |-
# opc\_compute\_ip\_address\_association # opc\_compute\_ip\_address\_association
The ``opc_compute_ip_address_association`` resource creates and manages an IP address association in an OPC identity domain. The ``opc_compute_ip_address_association`` resource creates and manages an IP address association between an IP address reservation and a virtual NIC in an OPC identity domain.
## Example Usage ## Example Usage
@ -41,7 +41,7 @@ In addition to the above, the following variables are exported:
## Import ## Import
IP Address Prefix Set can be imported using the `resource name`, e.g. IP Address Associations can be imported using the `resource name`, e.g.
``` ```
terraform import opc_compute_ip_address_association.default example terraform import opc_compute_ip_address_association.default example