Skip to content

Commit 124ac6f

Browse files
committed
Fix Linting
Fix Linting according to best Practices stated in PDK-Templates. PDK and the PDK-Templates themselves cannot currently be updated, because the current Rspec-Tests together with the custom spec_helper.rb cannot be used with recent PDK-Templates.
1 parent 3985da9 commit 124ac6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2459
-2474
lines changed

Diff for: .fixtures.yml

+9-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
1+
---
12
fixtures:
2-
repositories:
3-
stdlib:
4-
repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
5-
ref: "4.25.0"
6-
concat:
7-
repo: "git://github.com/puppetlabs/puppetlabs-concat.git"
8-
ref: "4.1.1"
9-
apt:
10-
repo: "git://github.com/puppetlabs/puppetlabs-apt.git"
11-
ref: "4.5.0"
12-
puppetserver_gem:
13-
repo: "git://github.com/puppetlabs/puppetlabs-puppetserver_gem.git"
14-
ref: "1.0.0"
153
forge_modules:
16-
yumrepo_core:
17-
repo: "puppetlabs/yumrepo_core"
18-
ref: "1.2.0"
19-
powershell:
20-
repo: "puppetlabs/powershell"
21-
ref: "4.1.0"
22-
zypprepo:
23-
repo: "puppet/zypprepo"
24-
ref: "3.1.0"
4+
powershell: puppetlabs/powershell
5+
yumrepo_core: puppetlabs/yumrepo_core
6+
zypprepo: puppet/zypprepo
7+
repositories:
8+
apt: https://github.com/puppetlabs/puppetlabs-apt
9+
concat: https://github.com/puppetlabs/puppetlabs-concat
10+
puppetserver_gem: https://github.com/puppetlabs/puppetlabs-puppetserver_gem
11+
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib
2512
symlinks:
2613
custom_datadog: "#{source_dir}/spec/custom_fixtures/custom_datadog"
27-
datadog_agent: "#{source_dir}"

Diff for: environments/centos7/Vagrantfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Vagrant.configure("2") do |config|
33
config.vm.provision "file", source: "../../environments/etc", destination: "$HOME/puppet"
44
config.vm.synced_folder "../../", "/puppet-datadog-agent"
55
config.vm.provision "shell", inline: <<-SHELL
6-
#install puppet 5
6+
# install puppet 5
77
rpm -ivh http://yum.puppetlabs.com/puppet5-release-el-7.noarch.rpm
88
yum install -y puppet
99
ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet

Diff for: environments/centos8/Vagrantfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Vagrant.configure("2") do |config|
33
config.vm.provision "file", source: "../../environments/etc", destination: "$HOME/puppet"
44
config.vm.synced_folder "../../", "/puppet-datadog-agent"
55
config.vm.provision "shell", inline: <<-SHELL
6-
#install puppet 6
6+
# install puppet 6
77
dnf install -y https://yum.puppetlabs.com/puppet-release-el-8.noarch.rpm
88
dnf install -y puppet
99

Diff for: environments/etc/manifests/site.pp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
node default {
2-
32
class { 'datadog_agent':
43
api_key => 'somenonnullapikeythats32charlong',
54
agent_extra_options => {
6-
use_http => true,
5+
use_http => true,
76
},
87
# Hostname is necessary for Agent to start up properly in container since 7.40.0
98
# https://github.com/DataDog/datadog-agent/issues/14152#issuecomment-1301842615
@@ -24,5 +23,4 @@
2423
username => 'status',
2524
password => 'hunter1',
2625
}
27-
2826
}

Diff for: environments/opensuse15/Vagrantfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Vagrant.configure("2") do |config|
55
config.vm.provision "file", source: "../../environments/etc", destination: "$HOME/puppet"
66
config.vm.synced_folder "../../", "/puppet-datadog-agent"
77
config.vm.provision "shell", inline: <<-SHELL
8-
#install puppet 6
8+
# install puppet 6
99
zypper ar -G https://yum.puppet.com/puppet/sles/15/x86_64/ puppet-repo
1010
zypper install -y puppet-agent
1111
ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet

Diff for: environments/ubuntu1604/Vagrantfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Vagrant.configure("2") do |config|
55
config.vm.synced_folder "../../", "/puppet-datadog-agent"
66
config.vm.provision "shell", inline: <<-SHELL
77
8-
#install puppet 4
8+
# install puppet 4
99
ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet
1010
1111
# install modules

Diff for: functions/tag6.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function datadog_agent::tag6(
99
) {
1010
if $tag_names =~ Array {
1111
$tags = $tag_names.reduce([]) |$_tags , $tag| {
12-
concat($_tags, datadog_agent::tag6($tag, $lookup_fact, $lookup_table))
12+
concat($_tags, datadog_agent::tag6($tag, $lookup_fact, $lookup_table))
1313
}
1414
} else {
1515
if $lookup_fact =~ String {

Diff for: lib/puppet/reports/datadog_reports.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def process
127127
Puppet.debug "Sending metrics for #{@msg_host} to Datadog"
128128
@dog.batch_metrics do
129129
metrics.each do |metric, data|
130-
data.values.each do |val|
130+
data.each_value do |val|
131131
name = "puppet.#{val[1].tr(' ', '_')}.#{metric}".downcase
132132
value = val[2]
133133
@dog.emit_point(name.to_s, value, host: @msg_host.to_s)
@@ -137,7 +137,7 @@ def process
137137

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

0 commit comments

Comments
 (0)