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 #29984 - Validate all ovirt volume attrs are string #7873

Merged
merged 1 commit into from
Aug 30, 2020

Conversation

shiramax
Copy link
Contributor

@shiramax shiramax commented Aug 2, 2020

No description provided.

@theforeman-bot
Copy link
Member

Issues: #29984

@@ -353,6 +353,7 @@ def new_interface(attr = {})

def new_volume(attr = {})
set_preallocated_attributes!(attr, attr[:preallocate])
raise "VM volume attributes are not set properly" unless attr.all? { |key, value| value.is_a? String }
Copy link
Member

Choose a reason for hiding this comment

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

Should this be a Foreman::Exception? Also, maybe indicate how they should be set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tbrisker
done.
If I would write how they should be set it could a bit misleading, In hammer, I'm expecting this all parameters to be received as a big string (in comma-separated values) but in those values, I'm expecting int/string/bool values.
In the UI it could be a bit different.

Copy link
Member

Choose a reason for hiding this comment

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

in that case, would it be possible it fails here when an integer/bool is passed? perhaps this validation should be done in a different place if it differs depending on the source?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope. it shouldn't fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it just that it could get "0" or "false"

@shiramax
Copy link
Contributor Author

@tbrisker any more comments on that one?

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

Thanks @shiramax , missed this one.

@tbrisker tbrisker merged commit 21324ca into theforeman:develop Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants