Fix inconsistent doc string and code of db_sync

db_sync may downgrade but current doc string only says
upgrade, and it says having return value which seems not
true.

Change-Id: Ib7bbb597f621985aba956302034eb1c5d0b3ff1f
Closes-Bug: #1264193
Fix the incorrect log message when creating images

When using "nova image-create my_server_id name" to create an image, the
glance api log image id is incorrect in the method create().

Change-Id: I938279526ed5adf5b95ec5f67e78c6465f890898
Closes-bug: #1263647
Check image id format before executing operations

DB2 will raise 'CLI0109E String data right truncation' error if
the given query parameter is longer than the column definition.
As a result, user will run into 500 instead of 404 error though
the malformed id is not existed in DB.
This fix will add image id format checking before executing real
operations.

Closes-Bug: #1263684

Change-Id: I1ab3e38724014032d9290e7dde3f8b6d23b6df6c
Merge "Fix the incorrect log message when creating images"
Merge "Fix inconsistent doc string and code of db_sync"
Merge "Check image id format before executing operations"