mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
remove pkg arch from list_pkgs output
This commit is contained in:
parent
32b476594a
commit
f222cc02ad
@ -209,15 +209,13 @@ def list_pkgs(*args):
|
||||
|
||||
salt '*' pkg.list_pkgs
|
||||
'''
|
||||
cmd = 'rpm -qa --queryformat ' \
|
||||
'"%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}\n"'
|
||||
cmd = 'rpm -qa --queryformat "%{NAME}_|-%{VERSION}_|-%{RELEASE}\n"'
|
||||
ret = {}
|
||||
for line in __salt__['cmd.run'](cmd).splitlines():
|
||||
name, version, rel, arch = line.split('_|-')
|
||||
name, version, rel = line.split('_|-')
|
||||
pkgver = version
|
||||
if rel:
|
||||
pkgver += '-{0}'.format(rel)
|
||||
pkgver += '.{0}'.format(arch)
|
||||
__salt__['pkg_resource.add_pkg'](ret, name, pkgver)
|
||||
__salt__['pkg_resource.sort_pkglist'](ret)
|
||||
return ret
|
||||
|
@ -109,15 +109,13 @@ def list_pkgs():
|
||||
|
||||
salt '*' pkg.list_pkgs
|
||||
'''
|
||||
cmd = 'rpm -qa --queryformat ' \
|
||||
'"%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}\n"'
|
||||
cmd = 'rpm -qa --queryformat "%{NAME}_|-%{VERSION}_|-%{RELEASE}\n"'
|
||||
ret = {}
|
||||
for line in __salt__['cmd.run'](cmd).splitlines():
|
||||
name, version, rel, arch = line.split('_|-')
|
||||
name, version, rel = line.split('_|-')
|
||||
pkgver = version
|
||||
if rel:
|
||||
pkgver += '-{0}'.format(rel)
|
||||
pkgver += '.{0}'.format(arch)
|
||||
__salt__['pkg_resource.add_pkg'](ret, name, pkgver)
|
||||
__salt__['pkg_resource.sort_pkglist'](ret)
|
||||
return ret
|
||||
|
Loading…
Reference in New Issue
Block a user