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

Installer complains about deprecated settings #38

Open
mattock opened this issue Sep 11, 2018 · 6 comments
Open

Installer complains about deprecated settings #38

mattock opened this issue Sep 11, 2018 · 6 comments

Comments

@mattock
Copy link
Member

mattock commented Sep 11, 2018

Warning: Setting autosign is deprecated. 
   (location: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:1169:in `issue_deprecation_warning')
Warning: Setting ca is deprecated. 
   (location: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/settings.rb:1169:in `issue_deprecation_warning')
@mattock
Copy link
Member Author

mattock commented Sep 19, 2018

These complaints started with recent Puppet 5.x versions. These settings are in puppet.conf generated by the Foreman project's puppet modules. As Foreman needs to support Puppet 4, there may not be an easy way to make the upstream remove those settings. We may have to fork some of foreman's puppet modules or alternatively suppress these warnings by modifying the Kafo-generated puppet.conf or puppet command-line.

@mattock
Copy link
Member Author

mattock commented Sep 26, 2018

This problem can probably be circumvented by adding

disable_warnings=deprecations

to the puppet.conf that Kafo initially creates.

@mattock
Copy link
Member Author

mattock commented Sep 26, 2018

The deprecation warnings seem to be premature.

@mattock
Copy link
Member Author

mattock commented Sep 26, 2018

Also, the deprecation warnings appear after the first installer run, when the puppet modules have already configured puppet.conf.

@mattock
Copy link
Member Author

mattock commented Sep 26, 2018

The following patch removes all warnings:

--- puppet_strings_module_parser.rb     2018-09-26 10:26:48.788890570 +0000
+++ puppet_strings_module_parser.rb.new 2018-09-26 10:28:52.408890570 +0000
@@ -37,7 +37,7 @@
       @file = file = File.expand_path(file)
       raise KafoParsers::ModuleName, "File not found #{file}, check your answer file" unless File.exists?(file)

-      command = "#{self.class.puppet_bin} strings generate --emit-json-stdout #{file}"
+      command = "#{self.class.puppet_bin} strings generate --format json --disable_warnings=deprecations #{file}"
       @raw_json = `#{command}`
       unless $?.success?
         raise KafoParsers::ParseError, "'#{command}' returned error\n#{@raw_json}"

The --format json option was introduced in puppet-strings 1.2.0. Adapting the above command depending on puppet-string version is one way to resolve this.

@mattock
Copy link
Member Author

mattock commented Dec 31, 2018

Applying the above patch seems to fail with latest gem versions. Debug and resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant