SHA256
1
0
forked from pool/salt
salt/fix-aptpkg.normalize_name-when-package-arch-is-all.patch

43 lines
1.5 KiB
Diff
Raw Normal View History

From 763d63b72b9a20f22555b665033899e10f091b60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Mon, 11 Jan 2021 15:45:28 +0000
Subject: [PATCH] Fix aptpkg.normalize_name when package arch is 'all'
Add test case of DEB package where arch is 'all'
---
salt/modules/aptpkg.py | 2 +-
tests/unit/modules/test_aptpkg.py | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py
index e001d2f11c..03e99af733 100644
--- a/salt/modules/aptpkg.py
+++ b/salt/modules/aptpkg.py
@@ -208,7 +208,7 @@ def normalize_name(name):
pkgname = name
pkgarch = __grains__["osarch"]
- return pkgname if pkgarch in (__grains__["osarch"], "any") else name
+ return pkgname if pkgarch in (__grains__["osarch"], "all", "any") else name
def parse_arch(name):
diff --git a/tests/unit/modules/test_aptpkg.py b/tests/unit/modules/test_aptpkg.py
index 51dfce29eb..eb3f9e2da7 100644
--- a/tests/unit/modules/test_aptpkg.py
+++ b/tests/unit/modules/test_aptpkg.py
@@ -808,6 +808,8 @@ class AptPkgTestCase(TestCase, LoaderModuleMockMixin):
assert result == "foo", result
result = aptpkg.normalize_name("foo:any")
assert result == "foo", result
+ result = aptpkg.normalize_name("foo:all")
+ assert result == "foo", result
result = aptpkg.normalize_name("foo:i386")
assert result == "foo:i386", result
--
2.29.2