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

Fix Linting #794

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
32 changes: 9 additions & 23 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
---
fixtures:
repositories:
stdlib:
repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
ref: "4.25.0"
concat:
repo: "git://github.com/puppetlabs/puppetlabs-concat.git"
ref: "4.1.1"
apt:
repo: "git://github.com/puppetlabs/puppetlabs-apt.git"
ref: "4.5.0"
puppetserver_gem:
repo: "git://github.com/puppetlabs/puppetlabs-puppetserver_gem.git"
ref: "1.0.0"
forge_modules:
yumrepo_core:
repo: "puppetlabs/yumrepo_core"
ref: "1.2.0"
powershell:
repo: "puppetlabs/powershell"
ref: "4.1.0"
zypprepo:
repo: "puppet/zypprepo"
ref: "3.1.0"
powershell: puppetlabs/powershell
yumrepo_core: puppetlabs/yumrepo_core
zypprepo: puppet/zypprepo
repositories:
apt: https://github.com/puppetlabs/puppetlabs-apt
concat: https://github.com/puppetlabs/puppetlabs-concat
puppetserver_gem: https://github.com/puppetlabs/puppetlabs-puppetserver_gem
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib
symlinks:
custom_datadog: "#{source_dir}/spec/custom_fixtures/custom_datadog"
datadog_agent: "#{source_dir}"
2 changes: 1 addition & 1 deletion environments/centos7/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "file", source: "../../environments/etc", destination: "$HOME/puppet"
config.vm.synced_folder "../../", "/puppet-datadog-agent"
config.vm.provision "shell", inline: <<-SHELL
#install puppet 5
# install puppet 5
rpm -ivh http://yum.puppetlabs.com/puppet5-release-el-7.noarch.rpm
yum install -y puppet
ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet
Expand Down
2 changes: 1 addition & 1 deletion environments/centos8/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "file", source: "../../environments/etc", destination: "$HOME/puppet"
config.vm.synced_folder "../../", "/puppet-datadog-agent"
config.vm.provision "shell", inline: <<-SHELL
#install puppet 6
# install puppet 6
dnf install -y https://yum.puppetlabs.com/puppet-release-el-8.noarch.rpm
dnf install -y puppet
Expand Down
4 changes: 1 addition & 3 deletions environments/etc/manifests/site.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
node default {

class { 'datadog_agent':
api_key => 'somenonnullapikeythats32charlong',
agent_extra_options => {
use_http => true,
use_http => true,
},
# Hostname is necessary for Agent to start up properly in container since 7.40.0
# https://github.com/DataDog/datadog-agent/issues/14152#issuecomment-1301842615
Expand All @@ -24,5 +23,4 @@
username => 'status',
password => 'hunter1',
}

}
2 changes: 1 addition & 1 deletion environments/opensuse15/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "file", source: "../../environments/etc", destination: "$HOME/puppet"
config.vm.synced_folder "../../", "/puppet-datadog-agent"
config.vm.provision "shell", inline: <<-SHELL
#install puppet 6
# install puppet 6
zypper ar -G https://yum.puppet.com/puppet/sles/15/x86_64/ puppet-repo
zypper install -y puppet-agent
ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet
Expand Down
2 changes: 1 addition & 1 deletion environments/ubuntu1604/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Vagrant.configure("2") do |config|
config.vm.synced_folder "../../", "/puppet-datadog-agent"
config.vm.provision "shell", inline: <<-SHELL
#install puppet 4
# install puppet 4
ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet
# install modules
Expand Down
2 changes: 1 addition & 1 deletion functions/tag6.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function datadog_agent::tag6(
) {
if $tag_names =~ Array {
$tags = $tag_names.reduce([]) |$_tags , $tag| {
concat($_tags, datadog_agent::tag6($tag, $lookup_fact, $lookup_table))
concat($_tags, datadog_agent::tag6($tag, $lookup_fact, $lookup_table))
}
} else {
if $lookup_fact =~ String {
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/reports/datadog_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def process
Puppet.debug "Sending metrics for #{@msg_host} to Datadog"
@dog.batch_metrics do
metrics.each do |metric, data|
data.values.each do |val|
data.each_value do |val|
name = "puppet.#{val[1].tr(' ', '_')}.#{metric}".downcase
value = val[2]
@dog.emit_point(name.to_s, value, host: @msg_host.to_s)
Expand All @@ -137,7 +137,7 @@ def process

facts = Puppet::Node::Facts.indirection.find(host).values
facts_tags = REPORT_FACT_TAGS.map { |name| "#{name}:#{facts.dig(*name.split('.'))}" }
trusted_facts = (Puppet.lookup(:trusted_information) { Hash.new }).to_h
trusted_facts = (Puppet.lookup(:trusted_information) { {} }).to_h
trusted_fact_tags = REPORT_TRUSTED_FACT_TAGS.map { |name| "#{name}:#{trusted_facts.dig(*name.split('.'))}" }
dog_tags = facts_tags + trusted_fact_tags

Expand Down
Loading