Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/datadog: Update to datadog_monitor still used d.GetOk #12497

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions builtin/providers/datadog/resource_datadog_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ func resourceDatadogMonitorUpdate(d *schema.ResourceData, meta interface{}) erro
}

o := datadog.Options{
NotifyNoData: datadog.Bool(d.Get("notify_no_data").(bool)),
NotifyNoData: datadog.Bool(d.Get("notify_no_data").(bool)),
RequireFullWindow: datadog.Bool(d.Get("require_full_window").(bool)),
IncludeTags: datadog.Bool(d.Get("include_tags").(bool)),
}
if attr, ok := d.GetOk("thresholds"); ok {
thresholds := attr.(map[string]interface{})
Expand All @@ -340,9 +342,6 @@ func resourceDatadogMonitorUpdate(d *schema.ResourceData, meta interface{}) erro
}
}

if attr, ok := d.GetOk("notify_no_data"); ok {
o.SetNotifyNoData(attr.(bool))
}
if attr, ok := d.GetOk("new_host_delay"); ok {
o.SetNewHostDelay(attr.(int))
}
Expand All @@ -369,12 +368,6 @@ func resourceDatadogMonitorUpdate(d *schema.ResourceData, meta interface{}) erro
}
o.Silenced = s
}
if attr, ok := d.GetOk("include_tags"); ok {
o.SetIncludeTags(attr.(bool))
}
if attr, ok := d.GetOk("require_full_window"); ok {
o.SetRequireFullWindow(attr.(bool))
}
if attr, ok := d.GetOk("locked"); ok {
o.SetLocked(attr.(bool))
}
Expand Down
131 changes: 67 additions & 64 deletions command/internal_plugin_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import (
datadogprovider "github.com/hashicorp/terraform/builtin/providers/datadog"
digitaloceanprovider "github.com/hashicorp/terraform/builtin/providers/digitalocean"
dmeprovider "github.com/hashicorp/terraform/builtin/providers/dme"
dnsprovider "github.com/hashicorp/terraform/builtin/providers/dns"
dnsimpleprovider "github.com/hashicorp/terraform/builtin/providers/dnsimple"
dnsprovider "github.com/hashicorp/terraform/builtin/providers/dns"
dockerprovider "github.com/hashicorp/terraform/builtin/providers/docker"
dynprovider "github.com/hashicorp/terraform/builtin/providers/dyn"
externalprovider "github.com/hashicorp/terraform/builtin/providers/external"
fastlyprovider "github.com/hashicorp/terraform/builtin/providers/fastly"
fileprovisioner "github.com/hashicorp/terraform/builtin/provisioners/file"
githubprovider "github.com/hashicorp/terraform/builtin/providers/github"
googleprovider "github.com/hashicorp/terraform/builtin/providers/google"
grafanaprovider "github.com/hashicorp/terraform/builtin/providers/grafana"
Expand All @@ -37,6 +38,7 @@ import (
ignitionprovider "github.com/hashicorp/terraform/builtin/providers/ignition"
influxdbprovider "github.com/hashicorp/terraform/builtin/providers/influxdb"
libratoprovider "github.com/hashicorp/terraform/builtin/providers/librato"
localexecprovisioner "github.com/hashicorp/terraform/builtin/provisioners/local-exec"
logentriesprovider "github.com/hashicorp/terraform/builtin/providers/logentries"
mailgunprovider "github.com/hashicorp/terraform/builtin/providers/mailgun"
mysqlprovider "github.com/hashicorp/terraform/builtin/providers/mysql"
Expand All @@ -54,6 +56,7 @@ import (
rabbitmqprovider "github.com/hashicorp/terraform/builtin/providers/rabbitmq"
rancherprovider "github.com/hashicorp/terraform/builtin/providers/rancher"
randomprovider "github.com/hashicorp/terraform/builtin/providers/random"
remoteexecprovisioner "github.com/hashicorp/terraform/builtin/provisioners/remote-exec"
rundeckprovider "github.com/hashicorp/terraform/builtin/providers/rundeck"
scalewayprovider "github.com/hashicorp/terraform/builtin/providers/scaleway"
softlayerprovider "github.com/hashicorp/terraform/builtin/providers/softlayer"
Expand All @@ -68,9 +71,6 @@ import (
vaultprovider "github.com/hashicorp/terraform/builtin/providers/vault"
vcdprovider "github.com/hashicorp/terraform/builtin/providers/vcd"
vsphereprovider "github.com/hashicorp/terraform/builtin/providers/vsphere"
fileprovisioner "github.com/hashicorp/terraform/builtin/provisioners/file"
localexecprovisioner "github.com/hashicorp/terraform/builtin/provisioners/local-exec"
remoteexecprovisioner "github.com/hashicorp/terraform/builtin/provisioners/remote-exec"

"github.com/hashicorp/terraform/plugin"
"github.com/hashicorp/terraform/terraform"
Expand All @@ -80,78 +80,81 @@ import (
)

var InternalProviders = map[string]plugin.ProviderFunc{
"alicloud": alicloudprovider.Provider,
"archive": archiveprovider.Provider,
"arukas": arukasprovider.Provider,
"atlas": atlasprovider.Provider,
"aws": awsprovider.Provider,
"azure": azureprovider.Provider,
"azurerm": azurermprovider.Provider,
"bitbucket": bitbucketprovider.Provider,
"chef": chefprovider.Provider,
"clc": clcprovider.Provider,
"alicloud": alicloudprovider.Provider,
"archive": archiveprovider.Provider,
"arukas": arukasprovider.Provider,
"atlas": atlasprovider.Provider,
"aws": awsprovider.Provider,
"azure": azureprovider.Provider,
"azurerm": azurermprovider.Provider,
"bitbucket": bitbucketprovider.Provider,
"chef": chefprovider.Provider,
"clc": clcprovider.Provider,
"cloudflare": cloudflareprovider.Provider,
"cloudstack": cloudstackprovider.Provider,
"cobbler": cobblerprovider.Provider,
"consul": consulprovider.Provider,
"datadog": datadogprovider.Provider,
"digitalocean": digitaloceanprovider.Provider,
"dme": dmeprovider.Provider,
"dns": dnsprovider.Provider,
"dnsimple": dnsimpleprovider.Provider,
"docker": dockerprovider.Provider,
"dyn": dynprovider.Provider,
"external": externalprovider.Provider,
"fastly": fastlyprovider.Provider,
"github": githubprovider.Provider,
"google": googleprovider.Provider,
"grafana": grafanaprovider.Provider,
"heroku": herokuprovider.Provider,
"icinga2": icinga2provider.Provider,
"ignition": ignitionprovider.Provider,
"influxdb": influxdbprovider.Provider,
"librato": libratoprovider.Provider,
"cobbler": cobblerprovider.Provider,
"consul": consulprovider.Provider,
"datadog": datadogprovider.Provider,
"digitalocean": digitaloceanprovider.Provider,
"dme": dmeprovider.Provider,
"dns": dnsprovider.Provider,
"dnsimple": dnsimpleprovider.Provider,
"docker": dockerprovider.Provider,
"dyn": dynprovider.Provider,
"external": externalprovider.Provider,
"fastly": fastlyprovider.Provider,
"github": githubprovider.Provider,
"google": googleprovider.Provider,
"grafana": grafanaprovider.Provider,
"heroku": herokuprovider.Provider,
"icinga2": icinga2provider.Provider,
"ignition": ignitionprovider.Provider,
"influxdb": influxdbprovider.Provider,
"librato": libratoprovider.Provider,
"logentries": logentriesprovider.Provider,
"mailgun": mailgunprovider.Provider,
"mysql": mysqlprovider.Provider,
"newrelic": newrelicprovider.Provider,
"nomad": nomadprovider.Provider,
"ns1": ns1provider.Provider,
"null": nullprovider.Provider,
"openstack": openstackprovider.Provider,
"opsgenie": opsgenieprovider.Provider,
"packet": packetprovider.Provider,
"pagerduty": pagerdutyprovider.Provider,
"mailgun": mailgunprovider.Provider,
"mysql": mysqlprovider.Provider,
"newrelic": newrelicprovider.Provider,
"nomad": nomadprovider.Provider,
"ns1": ns1provider.Provider,
"null": nullprovider.Provider,
"openstack": openstackprovider.Provider,
"opsgenie": opsgenieprovider.Provider,
"packet": packetprovider.Provider,
"pagerduty": pagerdutyprovider.Provider,
"postgresql": postgresqlprovider.Provider,
"powerdns": powerdnsprovider.Provider,
"profitbricks": profitbricksprovider.Provider,
"rabbitmq": rabbitmqprovider.Provider,
"rancher": rancherprovider.Provider,
"random": randomprovider.Provider,
"rundeck": rundeckprovider.Provider,
"scaleway": scalewayprovider.Provider,
"softlayer": softlayerprovider.Provider,
"spotinst": spotinstprovider.Provider,
"powerdns": powerdnsprovider.Provider,
"profitbricks": profitbricksprovider.Provider,
"rabbitmq": rabbitmqprovider.Provider,
"rancher": rancherprovider.Provider,
"random": randomprovider.Provider,
"rundeck": rundeckprovider.Provider,
"scaleway": scalewayprovider.Provider,
"softlayer": softlayerprovider.Provider,
"spotinst": spotinstprovider.Provider,
"statuscake": statuscakeprovider.Provider,
"template": templateprovider.Provider,
"terraform": terraformprovider.Provider,
"test": testprovider.Provider,
"tls": tlsprovider.Provider,
"triton": tritonprovider.Provider,
"ultradns": ultradnsprovider.Provider,
"vault": vaultprovider.Provider,
"vcd": vcdprovider.Provider,
"vsphere": vsphereprovider.Provider,
"template": templateprovider.Provider,
"terraform": terraformprovider.Provider,
"test": testprovider.Provider,
"tls": tlsprovider.Provider,
"triton": tritonprovider.Provider,
"ultradns": ultradnsprovider.Provider,
"vault": vaultprovider.Provider,
"vcd": vcdprovider.Provider,
"vsphere": vsphereprovider.Provider,

}

var InternalProvisioners = map[string]plugin.ProvisionerFunc{
"file": fileprovisioner.Provisioner,
"local-exec": localexecprovisioner.Provisioner,
"remote-exec": remoteexecprovisioner.Provisioner,
"file": fileprovisioner.Provisioner,
"local-exec": localexecprovisioner.Provisioner,
"remote-exec": remoteexecprovisioner.Provisioner,

}

func init() {
// Legacy provisioners that don't match our heuristics for auto-finding
// built-in provisioners.
InternalProvisioners["chef"] = func() terraform.ResourceProvisioner { return new(chefprovisioner.ResourceProvisioner) }
}