Variable 'domain_ref' referenced before assignment

Variable not declared before try...catch sentences trigger a
"Local variable 'domain_ref' referenced before assignment" error when
an exception is raised.

Co-Authored-By: David Stanek <dstanek@dstanek.com>
Change-Id: I0a63347cb316e3a5923243dd934a7fc51dbf1e13
Closes-Bug: #1274402
Rationalize the Assignment Grant Tables

Currently there are four different tables in the assignment sql
backend, one for each type of grant.  This leads to significantly
more complex code.

This patch rationalizes these four tables into a single Assignment
table, with the minimal of rework to calling functions of the
sql backend.  A subsequent patch will improve efficiency of the
calling code by taking advantage of a single Assignment table.

Blueprint: role-assignments-unified-sql

Change-Id: I7e604d718b29ad28b4d59458c7a528c01ff9804d
Merge "Variable 'domain_ref' referenced before assignment"