We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a3c966 commit 45c0806Copy full SHA for 45c0806
upcloud_api/server.py
@@ -92,11 +92,13 @@ def save(self):
92
use add_IP, add_storage, remove_IP, remove_storage instead.
93
"""
94
95
- kwargs = {
96
- field: getattr(self, field)
+ # dict comprehension that also works with 2.6
+ # http://stackoverflow.com/questions/21069668/alternative-to-dict-comprehension-prior-to-python-2-7
97
+ kwargs = dict(
98
+ (field, getattr(self, field))
99
for field in self.updateable_fields
100
if hasattr(self, field)
- }
101
+ )
102
103
self.cloud_manager.modify_server(self.uuid, **kwargs)
104
self._reset(kwargs)
0 commit comments