mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Implement compatible 'info_installed'. Returned keys are common to other systems with other package managers
This commit is contained in:
parent
ca7d0d5025
commit
7b376fd5c3
1 changed files with 24 additions and 0 deletions
|
@ -96,6 +96,30 @@ list_updates = list_upgrades
|
|||
|
||||
|
||||
def info(*names, **kwargs):
|
||||
def info_installed(*names):
|
||||
'''
|
||||
Return the information of the named package(s), installed on the system.
|
||||
|
||||
CLI example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' pkg.info_installed <package1>
|
||||
salt '*' pkg.info_installed <package1> <package2> <package3> ...
|
||||
'''
|
||||
ret = dict()
|
||||
for pkg_name, pkg_nfo in __salt__['lowpkg.info'](*names).items():
|
||||
t_nfo = dict()
|
||||
# Translate dpkg-specific keys to a common structure
|
||||
for key, value in pkg_nfo.items():
|
||||
if key == 'source_rpm':
|
||||
t_nfo['source'] = value
|
||||
else:
|
||||
t_nfo[key] = value
|
||||
|
||||
ret[pkg_name] = t_nfo
|
||||
|
||||
return ret
|
||||
'''
|
||||
Return the information of the named package available for the system.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue