mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Implement package info function
This commit is contained in:
parent
0668f1da53
commit
cabe863b81
1 changed files with 22 additions and 0 deletions
|
@ -301,3 +301,25 @@ def _get_pkg_install_time(pkg):
|
|||
iso_time = datetime.datetime.fromtimestamp(os.path.getmtime(location)).isoformat()
|
||||
|
||||
return iso_time
|
||||
|
||||
|
||||
def info(*packages):
|
||||
'''
|
||||
Return a detailed package(s) summary information.
|
||||
If no packages specified, all packages will be returned.
|
||||
|
||||
:param packages:
|
||||
:return:
|
||||
|
||||
CLI example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' lowpkg.info apache2 bash
|
||||
'''
|
||||
|
||||
ret = dict()
|
||||
for pkg in _get_pkg_info(*packages):
|
||||
ret[pkg['package']] = pkg
|
||||
|
||||
return ret
|
||||
|
|
Loading…
Add table
Reference in a new issue