Skip to content

Commit

Permalink
Merge pull request #6743 from svanharmelen/b-network-acl
Browse files Browse the repository at this point in the history
provider/cloudstack: list network ACLs with VPC IDs
  • Loading branch information
Sander van Harmelen committed May 23, 2016
2 parents 5fcc089 + 6a08e89 commit cd5ada1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion builtin/providers/cloudstack/resource_cloudstack_network_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,22 @@ func resourceCloudStackNetworkACLCreate(d *schema.ResourceData, meta interface{}
func resourceCloudStackNetworkACLRead(d *schema.ResourceData, meta interface{}) error {
cs := meta.(*cloudstack.CloudStackClient)

vpc, ok := d.GetOk("vpc_id")
if !ok {
vpc, ok = d.GetOk("vpc")
}
if !ok {
return errors.New("Either `vpc_id` or [deprecated] `vpc` must be provided.")
}

// Retrieve the vpc ID
vpcid, e := retrieveID(cs, "vpc", vpc.(string))
if e != nil {
return e.Error()
}

// Get the network ACL list details
f, count, err := cs.NetworkACL.GetNetworkACLListByID(d.Id())
f, count, err := cs.NetworkACL.GetNetworkACLListByID(d.Id(), cloudstack.WithVPCID(vpcid))
if err != nil {
if count == 0 {
log.Printf(
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cd5ada1

Please sign in to comment.