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

Refs #34385 - use Foreman::Plugin.installed? instead of defined? #526

Merged
merged 1 commit into from Mar 16, 2022

Conversation

Ron-Lavi
Copy link
Member

@Ron-Lavi Ron-Lavi commented Feb 3, 2022

No description provided.

@@ -1,6 +1,6 @@
module ForemanOpenscap
def self.with_katello?
defined?(::Katello)
Foreman::Plugin.installed?("Katello")
Copy link
Member

Choose a reason for hiding this comment

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

Is the plugin really named 'Katello'? 🤔

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 it's katello

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

just katello lowered case though :O

@@ -5,14 +5,14 @@
FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
# Add factories from foreman_ansible
FactoryBot.definition_file_paths << File.join(ForemanAnsible::Engine.root, '/test/factories')
FactoryBot.definition_file_paths << File.join(ForemanPuppet::Engine.root, '/test/factories') if defined?(ForemanPuppet)
FactoryBot.definition_file_paths << File.join(ForemanPuppet::Engine.root, '/test/factories') if Foreman::Plugin.installed?("foreman_puppet")
Copy link
Member

Choose a reason for hiding this comment

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

this is quite soon in the init proces and just for tests, I'd go with defined?(ForemanPuppet::Engine)` here, but probably both will work, so I'm fine both ways ^_^

Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Ron-Lavi
Copy link
Member Author

@lzap @adiabramovitch could you take a look?

@@ -5,14 +5,14 @@
FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
# Add factories from foreman_ansible
FactoryBot.definition_file_paths << File.join(ForemanAnsible::Engine.root, '/test/factories')
FactoryBot.definition_file_paths << File.join(ForemanPuppet::Engine.root, '/test/factories') if defined?(ForemanPuppet)
FactoryBot.definition_file_paths << File.join(ForemanPuppet::Engine.root, '/test/factories') if defined?(ForemanPuppet::Engine)

Choose a reason for hiding this comment

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

Just out of curiosity, Why are these changes needed if you stayed with the defined? method?

Copy link
Member Author

Choose a reason for hiding this comment

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

As @ezr-ondrej mentioned: #526 (comment)

Copy link

Choose a reason for hiding this comment

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

Then LGTM :)

@ares
Copy link
Member

ares commented Mar 16, 2022

Thanks @Ron-Lavi and all the reviewers, merging!

@ares ares merged commit ef6fc4a into theforeman:master Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants