puppetlabs / puppet-lint

Check that your Puppet manifests conform to the style guide

Home Page:https://puppetlabs.github.io/puppet-lint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

numerous warnings during puppet-lint invocation

vchepkov opened this issue · comments

After updating gem to v3.3.0, observing numerous warnings during puppet-lint invocation.
At first I thought it could be system ruby related (macOS uses ruby 2.6), but after installing package using puppet_gem provider, same warnings are emitted

$ /opt/puppetlabs/puppet/bin/puppet-lint tests/dotnet.pp 
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint.rb:253: warning: already initialized constant PuppetLint::CheckLegacyFacts
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint.rb:253: warning: previous definition of CheckLegacyFacts was here
/usr/local/ruby/gems/puppet-lint-legacy_facts-check-1.0.4/lib/puppet-lint/plugins/legacy_facts.rb:2: warning: already initialized constant LEGACY_FACTS_VAR_TYPES
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb:10: warning: previous definition of LEGACY_FACTS_VAR_TYPES was here
/usr/local/ruby/gems/puppet-lint-legacy_facts-check-1.0.4/lib/puppet-lint/plugins/legacy_facts.rb:6: warning: already initialized constant UNCONVERTIBLE_FACTS
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb:13: warning: previous definition of UNCONVERTIBLE_FACTS was here
/usr/local/ruby/gems/puppet-lint-legacy_facts-check-1.0.4/lib/puppet-lint/plugins/legacy_facts.rb:19: warning: already initialized constant REGEX_FACTS
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb:26: warning: previous definition of REGEX_FACTS was here
/usr/local/ruby/gems/puppet-lint-legacy_facts-check-1.0.4/lib/puppet-lint/plugins/legacy_facts.rb:29: warning: already initialized constant EASY_FACTS
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb:36: warning: previous definition of EASY_FACTS was here
/usr/local/ruby/gems/puppet-lint-legacy_facts-check-1.0.4/lib/puppet-lint/plugins/legacy_facts.rb:101: warning: already initialized constant HASH_KEY_TYPES
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb:108: warning: previous definition of HASH_KEY_TYPES was here
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint.rb:253: warning: already initialized constant PuppetLint::CheckTopScopeFacts
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint.rb:253: warning: previous definition of CheckTopScopeFacts was here
/usr/local/ruby/gems/puppet-lint-top_scope_facts-check-1.0.1/lib/puppet-lint/plugins/top_scope_facts.rb:2: warning: already initialized constant TOP_SCOPE_FACTS_VAR_TYPES
/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/gems/puppet-lint-3.3.0/lib/puppet-lint/plugins/top_scope_facts/top_scope_facts.rb:17: warning: previous definition of TOP_SCOPE_FACTS_VAR_TYPES was here

puppet-lint: v3.3.0
puppet: 7.23.0 (ruby 2.7.7p221)
OS: macOS 13.2.1

Can you check the version of voxpupuli-puppet-lint-plugins you are pulling down?

You may need to update.

I'll try to uninstall everything and install it back

$ /opt/puppetlabs/puppet/bin/gem list|grep lint
puppet-lint (3.3.0)
puppet-lint-absolute_classname-check (3.1.0)
puppet-lint-anchor-check (1.1.0)
puppet-lint-file_ensure-check (1.1.0)
puppet-lint-leading_zero-check (1.1.0)
puppet-lint-lookup_in_parameter-check (1.1.0)
puppet-lint-manifest_whitespace-check (0.2.9)
puppet-lint-optional_default-check (1.1.0)
puppet-lint-param-docs (1.7.6)
puppet-lint-param-types (1.0.0)
puppet-lint-params_empty_string-check (1.1.0)
puppet-lint-resource_reference_syntax (1.2.0)
puppet-lint-strict_indent-check (2.1.0)
puppet-lint-topscope-variable-check (1.2.0)
puppet-lint-trailing_comma-check (1.0.0)
puppet-lint-unquoted_string-check (2.2.0)
puppet-lint-variable_contains_upcase (1.3.0)
puppet-lint-version_comparison-check (1.1.0)
voxpupuli-puppet-lint-plugins (4.0.0)

I had to remove every gem and install them back and warnings cleared /shrug