Fixed several test failures on Python3

- Corrected places where `dict.keys()` was being treated as a list
- Corrected usage of `urllib.urlencode()`

Change-Id: I0a24b2f64fab6c905e20073ff7ebaa3c5ffe7c90
Fix AttributeError in Keypair._add_details()

_add_details() method copies keypair attributes retrieved
from Nova to an instance of Keypair class. Trying to set
attribute 'id' fails with AttributeError, because Keypair
class has a read-only property 'id'.

We can safely omit setting of attribute 'id', because it's
just an implementation detail (the id of a table row in a
database), and keypairs for a given tenant are uniquely
identified using attribute 'name'.

Fixes bug 1223934

Change-Id: I1045730e47e9e6ad31fcdfbaefdad77e2f3b2c3e
Merge "Fix AttributeError in Keypair._add_details()"