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

modulesync 2023-8-23 #69

Merged
merged 9 commits into from
Aug 26, 2023
Merged

modulesync 2023-8-23 #69

merged 9 commits into from
Aug 26, 2023

Conversation

zilchms
Copy link
Contributor

@zilchms zilchms commented Aug 23, 2023

No description provided.

@@ -1,36 +1,41 @@
require 'puppetdb'
require 'puppet'
require 'puppet/util/puppetdb'
# require 'puppet/util/puppetdb'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make this optional. something like this:

begin
  require 'voxpupuli/rubocop/rake'
puppetdb = Puppet::Util::Puppetdb.config.server_urls[0]}
rescue LoadError
  puppetdb = "https://#{Puppet[:server]}:8081"
end

and then use that in line 11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried to get that to work, but predefining variables outside of a class without using global variables and therefore making rubocop happy is not working.
Is there a reason we should even try to load puppet::util::puppetdb? as far as i am concerned we have a hardcoded defaultvalue which we mention in the readme. The other case is setting the env variable. We cover both of these cases right now. Is there something I am missing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the nice thing about puppet::util::puppetdb is that it reads the local puppetdb.conf. You can move the whole block, including the require statement, into the class.

@zilchms zilchms merged commit add96d7 into master Aug 26, 2023
6 checks passed
@zilchms zilchms deleted the modulesync branch August 26, 2023 05:04
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

Successfully merging this pull request may close these issues.

2 participants