The resource variable, originally containing the resource type, i.e.
'lease', was reassigned with a lease object before being used in the
exception message. As a result, the message displayed a dictionary of
lease values, instead of "type 'lease'".
Change-Id: If4cb03cfb4a895c11e3952f0f1b79e0c7d14de8c
Closes-Bug: #1786030
(cherry picked from commit 92e26f3417)