-
Notifications
You must be signed in to change notification settings - Fork 987
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
Conversation
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 } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"
@tbrisker any more comments on that one? |
There was a problem hiding this 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.
No description provided.