mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #28076 from redmcg/2015.8
Replace option 'i' with an explicit queryformat
This commit is contained in:
commit
f990a21029
1 changed files with 19 additions and 2 deletions
|
@ -426,10 +426,27 @@ def info(*packages):
|
|||
salt '*' lowpkg.info apache2 bash
|
||||
'''
|
||||
|
||||
cmd = packages and "rpm -qi {0}".format(' '.join(packages)) or "rpm -qai"
|
||||
cmd = packages and "rpm -q {0}".format(' '.join(packages)) or "rpm -qa"
|
||||
|
||||
# Locale needs to be en_US instead of C, because RPM otherwise will yank the timezone from the timestamps
|
||||
call = __salt__['cmd.run_all'](cmd + " --queryformat '-----\n'",
|
||||
call = __salt__['cmd.run_all'](cmd + (" --queryformat 'Name: %{NAME}\n"
|
||||
"Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n"
|
||||
"Version: %{VERSION}\n"
|
||||
"Vendor: %{VENDOR}\n"
|
||||
"Release: %{RELEASE}\n"
|
||||
"Build Date: %{BUILDTIME:date}\n"
|
||||
"Install Date: %|INSTALLTIME?{%{INSTALLTIME:date}}:{(not installed)}|\n"
|
||||
"Build Host: %{BUILDHOST}\n"
|
||||
"Group: %{GROUP}\n"
|
||||
"Source RPM: %{SOURCERPM}\n"
|
||||
"Size: %{LONGSIZE}\n"
|
||||
"%|LICENSE?{License: %{LICENSE}\n}|"
|
||||
"Signature: %|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:{%|SIGGPG?{%{SIGGPG:pgpsig}}:{%|SIGPGP?{%{SIGPGP:pgpsig}}:{(none)}|}|}|}|\n"
|
||||
"%|PACKAGER?{Packager: %{PACKAGER}\n}|"
|
||||
"%|URL?{URL: %{URL}\n}|"
|
||||
"Summary: %{SUMMARY}\n"
|
||||
"Description:\n%{DESCRIPTION}\n"
|
||||
"-----\n'"),
|
||||
output_loglevel='trace', env={'LC_ALL': 'en_US', 'TZ': 'UTC'}, clean_env=True)
|
||||
if call['retcode'] != 0:
|
||||
comment = ''
|
||||
|
|
Loading…
Add table
Reference in a new issue