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

Problem with number values in connection_params #487

Open
vadimstroganov opened this issue Jan 31, 2019 · 3 comments
Open

Problem with number values in connection_params #487

vadimstroganov opened this issue Jan 31, 2019 · 3 comments

Comments

@vadimstroganov
Copy link

Hello!

I have a problem with the connection_params, if I specify values consisting only of numbers.

for-core call coerce_options for connection_params.

coerce_options suggests it takes a Hash and converts all the values to underlying Ruby types. So a username that is only numbers is converted to a number.

After the conversion, the string "12345" is converted to the number 12345. And after that, a request for authentication of OpenStack API is sent.

In this case, OpenStack API in the response body is an empty string.

Then an error occurs. (can't decode JSON; response.body = "")

https://github.com/fog/fog-openstack/blob/master/lib/fog/openstack/auth/token/v3.rb#L58

I already wrote about this here fog/fog-core#247

Probably the best way would be to wrap the parameters after call coerce_options into a string?

@cyrylas
Copy link

cyrylas commented Feb 5, 2019

Is that related to #426? I think I have already fixed that.

@vadimstroganov
Copy link
Author

No, #426 about tenantId and tenantName keys.
My problem arises with openstack_ keys.

@vadimstroganov
Copy link
Author

In #488 for the keys starting with openstack_ I call a conversion to string.

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

No branches or pull requests

2 participants