mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
modules.dpkg._get_pkg_info: use pythonic initializers
This commit is contained in:
parent
f1cf027308
commit
d3c6732539
1 changed files with 2 additions and 2 deletions
|
@ -254,7 +254,7 @@ def _get_pkg_info(*packages):
|
|||
:return:
|
||||
'''
|
||||
|
||||
ret = list()
|
||||
ret = []
|
||||
cmd = "dpkg-query -W -f='package:${binary:Package}\\n" \
|
||||
"revision:${binary:Revision}\\n" \
|
||||
"architecture:${Architecture}\\n" \
|
||||
|
@ -281,7 +281,7 @@ def _get_pkg_info(*packages):
|
|||
raise CommandExecutionError("Error getting packages information: {0}".format(call['stderr']))
|
||||
|
||||
for pkg_info in [elm for elm in re.split(r"----*", call['stdout']) if elm.strip()]:
|
||||
pkg_data = dict()
|
||||
pkg_data = {}
|
||||
pkg_info, pkg_descr = re.split(r"====*", pkg_info)
|
||||
for pkg_info_line in [el.strip() for el in pkg_info.split(os.linesep) if el.strip()]:
|
||||
key, value = pkg_info_line.split(":", 1)
|
||||
|
|
Loading…
Add table
Reference in a new issue