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

fixes #2023 - Don't try to save os=nil in the fact importer #318

Closed
wants to merge 1 commit into from

Conversation

ohadlevy
Copy link
Member

I've tried to address all possible places where empty set of facts (e.g. we
dont have the facts just yet as its a brand new install) could lead to the
operating system value disappering.

i believe the issue happened because of a boolean == string compareing (e.g.
some left overs in cache might lead to if "false" which is true.

I've also ensured that we get an exception if the operating system value is empty
or if it does not pass validations.

I've tried to address all possible places where empty set of facts (e.g. we
dont have the facts just yet as its a brand new install) could lead to the
operating system value disappering.

i believe the issue happened because of a boolean == string compareing (e.g.
some left overs in cache might lead to if "false" which is true.

I've also ensured that we get an exception if the operating system value is empty
or if it does not pass validations.
@@ -116,7 +116,7 @@ def self.import(yaml)
r.import_log_messages report
# if we are using storeconfigs then we already have the facts
# so we can refresh foreman internal fields accordingly
host.populateFieldsFromFacts if Setting[:using_storeconfigs]
host.populateFieldsFromFacts if Setting[:using_storeconfigs] == false
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be == true ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, thanks!

@domcleal
Copy link
Contributor

I'd like to include domcleal@fc6f072. Without it, the setting default is getting initialised as a string:

1.8.7 :001 > Setting.where(:name => :using_storeconfigs).first.default.class
 => String 

This seems to be leaking through if there's no user-specified value.

@GregSutcliffe
Copy link
Member

Code looks solid to me :)

@ohadlevy
Copy link
Member Author

merged including dominics patch thanks!

@ohadlevy ohadlevy closed this Dec 19, 2012
LiorKGOW pushed a commit to LiorKGOW/foreman that referenced this pull request Oct 20, 2022
…an#318)

* Fixes #28463 - Fix missing roles in the assigned roles list

* Fixes #28463 - Fix missing roles in the assigned roles list
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.

3 participants