Utilites for manipulating base64 & PEM

Add two new utility modules

  - keystone.common.base64utils
  - keystone.common.pemutils

Add two new unit tests to exercise the above.

  - keystone.tests.test_base64utils
  - keystone.tests.test_pemutils

Functionality in these utilities will be utilized to fix bug #1233838
in a subsequent commit. It is hoped these modules will moved to Oslo
common code. Each module has a doc string describing their purpose and
functionalty.

Change-Id: I3546674dcd9eddec2c378929dd3f759f667cfd5d
Partial-Bug: #1233838
Try decoding string to UTF-8 on error message fail

Database Errors from SQLAlchemy tend to get mangled into ASCII. If an
error is process that contains UTF-8 data in ASCII form if fails to
build the message and will lead to a 5xx error. Catch the error and try
to decode it to create the message again, if that doesn't work at least
fail gracefully.

Change-Id: Iecb1170387c51064918780dc6de07db7ca8aeeee
Closes-Bug: 1253905
Fix typo in keystone

1. Validate the user and tenant auth into in order to -> Validate the user
   and tenant auth info in order to
2. attmepting -> attempting
3. extnsion -> extension
4. identfier -> identifier
5. establed -> established
6. specifc -> specific
7. intitalized -> initialized
8. explicity -> explicitly
9. uniq -> unique

Change-Id: I8f4420e7c41cfdbc3f4751ed1c0b9a6e151b0940
Closes-Bug: #1254585
Updates .gitignore

To ignore swap files from getting into repository
currently the implemented ignore is *.swp
however vim adds more swap files if these files exists,
so improving this with *.sw?

Change-Id: I5c70908e32fc5316e395c72810fc45f5db8a7a77
Closes-Bug: #1255864
One transaction per call to sql assignment backend

There are numerous schedules that lead to inconsistent data in the
various grant tables and role table. These races arose from a lack of
synchronization during grant table modification (i.e., during grant
record creation + deletion and role deletion) and deletions of records
that grant records refer to (i.e., user, group, domain, and project
records). The races manifested as 404 errors in response to API
requests. This patch adds the necessary synchronization by way of
transactions.

Also removed pointless session.flush() calls at the ends of transactions.

Closes-Bug: #1246489
Change-Id: I958d48bafc7fcb95f1d9ea71e408b4cefc2469c9
Merge "Utilites for manipulating base64 & PEM"
Merge "Updates .gitignore"
Merge "One transaction per call to sql assignment backend"
Merge "Fix typo in keystone"
Merge "Try decoding string to UTF-8 on error message fail"