I found that if I use “knife data bag” to create an item in a data bag, the item id can include both upper and lower-case letters, but if I use the web app to try to create a data bag, it doesn’t allow upper-case characters in the item id?
The reason I ran across this is that I have a recipe that uses node[‘hostname’’] to get the hostname which I then use to select the item in the data bag, and in Windows at least, the node[‘hostname’] seems to be returning the (short) hostname in all caps.
In other words, if the hostname is “foo”, then node[‘hostname’] is returning “FOO”, so I need to make the item IDs in the data bag with caps.
Is this a bug in the web app?
Also, is there a way that I can lower-case the node[‘hostname’], something like lowercase(node[‘hostname’])?
I can’t speak to the issue you’re seeing in Manage, but to convert any String in ruby to lowercase or uppercase, you’d use downcase and upcase, respectively.
I found that if I use “knife data bag” to create an item in a data bag, the item id can include both upper and lower-case letters, but if I use the web app to try to create a data bag, it doesn’t allow upper-case characters in the item id?
The reason I ran across this is that I have a recipe that uses node[‘hostname’’] to get the hostname which I then use to select the item in the data bag, and in Windows at least, the node[‘hostname’] seems to be returning the (short) hostname in all caps.
In other words, if the hostname is “foo”, then node[‘hostname’] is returning “FOO”, so I need to make the item IDs in the data bag with caps.
Is this a bug in the web app?
Also, is there a way that I can lower-case the node[‘hostname’], something like lowercase(node[‘hostname’])?