I am editing a script, which authenticates to openstack keystone to get a token. The API-Call works but I want to use variables instead of the direct values to make it more readable und reusable. But the problem is that it is necessary for the values to be in quotes (") and I can't figure out how to do that. I found some code examples [1], [2] to use variables in strings in general but I need to use some kind of escape sequence to place the values in quotes.
At the moment my string assignment looks like this:
params = '{"auth":{"passwordCredentials":{"username":"nodermatt", "password":"feelfree"}, "tenantId":"4"}}'
As you can see the values of username, password and tenantID are in quotes and I'd like it to replace them with variables:
osuser = "nodermatt"
ospassword = "feelfree"
ostenant = "4"
params = '{"auth":{"passwordCredentials":{"username":osuser, "password":ospassword}, "tenantId":ostenant}}'
I'd be very glad if could solve this "issue".
PS: If I missed a thread or a search result on google that matches my question, I'd be very gratefull for the link.
Thanks in advance! Best regards, Nicolas