Skip to content

Commit

Permalink
Merge pull request #38 from saiprasannasastry/dsbrng25b-remove_licens…
Browse files Browse the repository at this point in the history
…e_check

Dsbrng25b remove license check
  • Loading branch information
saiprasannasastry authored Sep 3, 2019
2 parents 2987781 + 12182ba commit 423c9ae
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions infoblox/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
requestor := &ibclient.WapiHttpRequestor{}

conn, err := ibclient.NewConnector(hostConfig, transportConfig, requestBuilder, requestor)
objMgr := ibclient.NewObjectManager(conn, "terraform", "")
err = CheckCloudLicense(objMgr, "cloud")
if err != nil {
return nil, err
}
return conn, err
}

//CheckCloudLicense checks whether the user has applied License to
//Infoblox Server.
func CheckCloudLicense(objMgr *ibclient.ObjectManager, licenseType string) (err error) {
license, err := objMgr.GetLicense()

if err != nil {
return

}
for _, v := range license {
if strings.ToLower(v.Licensetype) == licenseType {
if v.ExpirationStatus != "DELETED" && v.ExpirationStatus != "EXPIRED" {
return
}

}
}
err = fmt.Errorf("%s license is not applied/deleted for the grid. Apply the license and try again", licenseType)
return
}

0 comments on commit 423c9ae

Please sign in to comment.