Handle UnicodeEncodeError in validate_integer

validate_integer can be potentially passed user
supplied data which causes a UnicodeEncodeError
exception during validation rather than just ValueError.
This change handles the UnicodeEncode exception
so validate_integer treats it as invalid input.

Change-Id: I5177789299b02448ed53e1b7fc23ccdaee1b70d3
Partial-Bug: 1243037
Fix image cache periodic task concurrent access bug

This fix catch the exception and ignore a disk file absent
exception. It will defer the image cache clean to next round
image cache periodic task because it's not harmful.
Refer to detailed info, log analysis and root cause in defect.

Change-Id: I3a431bf389658f976edf5c847c04b7e0aac496fd
Closes-Bug: #1261442
Adds new method nova.utils.get_hash_str

Some modules are using their own method to generate hex from
string.
This patch adds a new method "get_hash_str" in nova.utils and
cleans every module needs to use it.

Change-Id: I2fa7dd2ea12c1d516224132d13454d109bb6c1e3
Merge "Adds new method nova.utils.get_hash_str"
Merge "Fix image cache periodic task concurrent access bug"
Merge "Handle UnicodeEncodeError in validate_integer"