diff --git a/novaclient/v1_1/keypairs.py b/novaclient/v1_1/keypairs.py index 28bd760c1..cd9e5852f 100644 --- a/novaclient/v1_1/keypairs.py +++ b/novaclient/v1_1/keypairs.py @@ -32,7 +32,15 @@ def _add_details(self, info): dico = 'keypair' in info and \ info['keypair'] or info for (k, v) in dico.items(): - setattr(self, k, v) + # NOTE(rpodolyaka): keypair name allows us to uniquely identify + # a specific keypair, while its id attribute + # is nothing more than an implementation + # detail. We can safely omit the id attribute + # here to ensure setattr() won't raise + # AttributeError trying to set read-only + # property id + if k != 'id': + setattr(self, k, v) @property def id(self):