diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 5142996ef7..508ba2f5e6 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -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 diff --git a/salt/modules/yumpkg5.py b/salt/modules/yumpkg5.py index a52135197f..9924988b22 100644 --- a/salt/modules/yumpkg5.py +++ b/salt/modules/yumpkg5.py @@ -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