Check that region ID is not an empty string

It generates an ID when a POST request to /regions has an empty string as ID

Change-Id: I49afd1f8c2e09ed31329bd8d1d88ca7f29ef7be9
Closes-Bug: 1322639
Refactor set domain-id and mapping code

Applied function separation refactorings to the
_set_domain_id_and_mapping function in the identity/core module in an
attempt to make it more readable.

Change-Id: I921a05b0164bc6afa329e98c26faf4cf4f336f2f
Do not consume trust uses when create token fails

Currently, remaining trust uses are consumed even when create token
fails. We should only consume trust uses when successfully creating
a token.

Change-Id: I55a726250312fa81ed9556dfd530e96f72548930
Closes-Bug: #1335037
Merge "Do not consume trust uses when create token fails"
Merge "Refactor set domain-id and mapping code"
Merge "Check that region ID is not an empty string"