mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add is_installed to the pacman module
This commit is contained in:
parent
0b6ce7e4ed
commit
3e6eeeb371
@ -21,6 +21,19 @@ def _list_removed(old, new):
|
||||
pkgs.append(pkg)
|
||||
return pkgs
|
||||
|
||||
def is_installed(pkg):
|
||||
'''
|
||||
Returns a bool if the package is installed or not
|
||||
|
||||
CLI Example:
|
||||
salt '*' pkg.is_installed <package name>
|
||||
'''
|
||||
pkgs = list_pkgs()
|
||||
if pkgs.has_key(name):
|
||||
return pkgs[name]
|
||||
else:
|
||||
return ''
|
||||
|
||||
def list_pkgs():
|
||||
'''
|
||||
List the packages currently installed in a dict:
|
||||
|
Loading…
Reference in New Issue
Block a user