diff options
author | Philipp Hahn <hahn@univention.de> | 2020-07-23 08:44:41 +0200 |
---|---|---|
committer | Daniel Berrange <berrange@redhat.com> | 2020-08-18 09:48:25 +0000 |
commit | 57770081971f3f52002926ea7aa2d1bb135216c4 (patch) | |
tree | 630cce6dcb08fc6d5fa68aa9942dd8e27e4205d3 /libvirt-override-virStoragePool.py | |
parent | d49e85080794e8d8dcf99cda717c969d6a519d71 (diff) | |
download | libvirt-python-57770081971f3f52002926ea7aa2d1bb135216c4.tar.gz |
override: Convert to list comprehension
:%s/retlist = list()\n\s*\(for \w\+ in ret\):\n\s*retlist.append(\(.*\))\n\n\s*return retlist/return [\2 \1]/
Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'libvirt-override-virStoragePool.py')
-rw-r--r-- | libvirt-override-virStoragePool.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libvirt-override-virStoragePool.py b/libvirt-override-virStoragePool.py index 669df3e..d631cd2 100644 --- a/libvirt-override-virStoragePool.py +++ b/libvirt-override-virStoragePool.py @@ -4,8 +4,4 @@ if ret is None: raise libvirtError("virStoragePoolListAllVolumes() failed") - retlist = list() - for volptr in ret: - retlist.append(virStorageVol(self._conn, _obj=volptr)) - - return retlist + return [virStorageVol(self._conn, _obj=volptr) for volptr in ret] |