Skip to content

Commit e4fccb8

Browse files
committed
All debian/ubuntu systems supports arch 'all' pkgs
Arch 'all' is noarch in debian/ubuntu. In case users want to do limit for repository only supported arch 'all', this information need to be send to candlepin as fact.
1 parent b562a7a commit e4fccb8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/rhsmlib/facts/pkg_arches.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def get_arches_on_debian(self) -> Dict[str, str]:
6060
except Exception as e:
6161
log.error("Error getting dpkg foreign architecture: %s", e)
6262

63+
# All debian systems supports no-architecture packages (= 'all'), too
64+
arches.append("all")
65+
6366
return {"supported_architectures": ",".join(arches)}
6467

6568
def get_all(self) -> Dict[str, str]:

test/rhsmlib/facts/test_pkg_arches.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ def test_single_arch_on_debian(self, MockCheckOutput):
2424
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Debian"})
2525
MockCheckOutput.side_effect = self.helper_dpkg_no_foreign
2626
fact = collector.get_all()
27-
self.assertEqual(fact["supported_architectures"], "amd64")
27+
self.assertEqual(fact["supported_architectures"], "amd64,all")
2828

2929
@patch("subprocess.check_output")
3030
def test_single_arch_on_ubuntu(self, MockCheckOutput):
3131
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Ubuntu"})
3232
MockCheckOutput.side_effect = self.helper_dpkg_no_foreign
3333
fact = collector.get_all()
34-
self.assertEqual(fact["supported_architectures"], "amd64")
34+
self.assertEqual(fact["supported_architectures"], "amd64,all")
3535

3636
@patch("subprocess.check_output")
3737
def test_multi_arch_on_ubuntu(self, MockCheckOutput):
3838
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Debian"})
3939
MockCheckOutput.side_effect = self.helper_dpkg_foreign
4040
fact = collector.get_all()
41-
self.assertEqual(fact["supported_architectures"], "amd64,i386")
41+
self.assertEqual(fact["supported_architectures"], "amd64,i386,all")
4242

4343
@patch("subprocess.check_output")
4444
def test_multi_arch_on_debian(self, MockCheckOutput):
4545
collector = pkg_arches.SupportedArchesCollector(collected_hw_info={"distribution.name": "Ubuntu"})
4646
MockCheckOutput.side_effect = self.helper_dpkg_foreign
4747
fact = collector.get_all()
48-
self.assertEqual(fact["supported_architectures"], "amd64,i386")
48+
self.assertEqual(fact["supported_architectures"], "amd64,i386,all")
4949

5050
@patch("subprocess.check_output")
5151
def test_none_arch_on_redhat(self, MockCheckOutput):

0 commit comments

Comments
 (0)