Skip to content

Commit

Permalink
Update http_check.pp
Browse files Browse the repository at this point in the history
  • Loading branch information
asenci committed Feb 18, 2022
1 parent f9a2042 commit 3a72b27
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions manifests/integrations/http_check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -241,40 +241,35 @@
$_instances = $instances
}

$instances_array = $_instances.map |$instance| {
$instances_array = datadog_agent::clean_empty($_instances.map |$instance| {
Hash($instance.map |$key, $value| {
case $key {
'sitename': {
Tuple(['name', $value])
}

'data', 'headers': {
$_value = datadog_agent::clean_empty($value)
if !$_value.is_a(Array) {
Tuple([$key, $_value])
}

$value_hash = Hash($_value.map |$item| {
$value_hash = Hash($value.map |$item| {
$_item = $item.split(':')
$i_key = $_item[0].rstrip
$i_value = $_item[1, - 1].join(':').lstrip

Tuple([$i_key, $i_value])
})

Tuple([$key, datadog_agent::clean_empty($value_hash)])
Tuple([$key, $value_hash])
}

'tags': {
Tuple([$key, datadog_agent::clean_empty($value)])
Tuple([$key, $value])
}

default: {
Tuple([$key, $value])
}
}
})
}
})

$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/http_check.yaml"
if $::datadog_agent::_agent_major_version > 5 {
Expand Down

0 comments on commit 3a72b27

Please sign in to comment.