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 #23233 - updated yum_max_speed example to reflect to_bytes parsing #315
Conversation
If pulp understands these strings, why do we even convert them to bytes in the first place? I'd be happy with removing |
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.
I think we should submit a patch to stdlib to make the prefix case insensitive. As a short term fix the documentation should be improved here to mention the odd quirk.
templates/yum_importer.json.erb
Outdated
@@ -20,7 +20,7 @@ | |||
"proxy_password": null, | |||
<% end %> | |||
<% unless [nil, :undefined, :undef, ''].include?(scope['pulp::real_yum_max_speed']) -%> | |||
"max_speed": <%= scope['pulp::real_yum_max_speed'] %>, | |||
"max_speed": "<%= scope['pulp::real_yum_max_speed'] %>", |
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.
If pulp only understands bytes, this change should not be needed.
manifests/init.pp
Outdated
@@ -186,7 +186,7 @@ | |||
# | |||
# $proxy_password:: Proxy password for authentication | |||
# | |||
# $yum_max_speed:: The maximum download speed for a Pulp task, such as a sync. (e.g. "4 Kb" or 1Gb") | |||
# $yum_max_speed:: The maximum download speed for a Pulp task, such as a sync. (e.g. "4 kb" or 1gb") |
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.
to_bytes is weird. k[bB]
is used, all the others use upper case prefixes: M[Bb]
G[Bb]
etc.
@ekohl updated |
Thanks! |
Updated the init.pp description too since passing Kb fails with an error, as its the to bytes conversion is not happy with uppercase.