Host "get" is case-insensitive while host "update" is not
Bug #996879 reported by
Gabriel Hurley
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Joe Gordon |
Bug Description
Using the hosts API extension with a host named "node1" I can make the following three GET calls and get the same result:
http://
http://
http://
But if I make an update call (PUT), only the lowercase (correct) version works.
http://
Otherwise a 500 response is returned due to the API not catching exception.
Changed in nova: | |
status: | New → Confirmed |
Changed in nova: | |
importance: | Undecided → Low |
importance: | Low → Medium |
Changed in nova: | |
assignee: | nobody → Ying Chun Guo (daisy-ycguo) |
Changed in nova: | |
assignee: | Ying Chun Guo (daisy-ycguo) → nobody |
Changed in nova: | |
milestone: | none → grizzly-rc1 |
Changed in nova: | |
assignee: | nobody → Joe Gordon (jogo) |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | grizzly-rc1 → 2013.1 |
To post a comment you must log in.
When getting hosts, it uses SQLAlchemy to query database, which is case insensitive.
When updating hosts, firstly it will check whether the host exists. Scheduler RPC API is used to get the host list. And then, it will verify whether the host name is in the host list, where case is sensitive.
The domain names of URL are not case-sensitive, while the rest of the URL might be. If we change the "GET" url to case sensitive, we need to change the definition of table "services". If we change the "PUT" url to be case insensitive, we just need to change the code to covert all characters to lower case when comparing. It's quite easy. I perfer the easier one.
REFER TO: http:// dev.mysql. com/doc/ refman/ 5.0/en/ case-sensitivit y.html
"For nonbinary strings (CHAR, VARCHAR, TEXT), string searches use the collation of the comparison operands. The default character set and collation are latin1 and latin1_swedish_ci, so nonbinary string comparisons are case insensitive by default."