Browse Source

Collapse some code

Enis Afgan 11 năm trước cách đây
mục cha
commit
1885421d09

+ 1 - 3
cloudbridge/providers/openstack/resources.py

@@ -495,9 +495,7 @@ class OpenStackKeyPair(BaseKeyPair):
         :return: Unencrypted private key or ``None`` if not available.
         :return: Unencrypted private key or ``None`` if not available.
 
 
         """
         """
-        if hasattr(self._key_pair, 'private_key'):
-            return self._key_pair.private_key
-        return None
+        return getattr(self._key_pair, 'private_key', None)
 
 
 
 
 class OpenStackSecurityGroup(BaseSecurityGroup):
 class OpenStackSecurityGroup(BaseSecurityGroup):