Add Amazon Linux support to bindep

This patch adds Amazon Linux support to bindep. It already uses yum
in the same way that CentOS/RHEL do, so the only real change is to
check for the platform text string.

Change-Id: I8ec1d7ca76a4984550e704817ce6efe6a898175f
This commit is contained in:
Major Hayden 2017-04-12 08:12:43 -05:00
parent 5061e10fa1
commit 5e2f06a284
2 changed files with 8 additions and 2 deletions

View File

@ -242,8 +242,8 @@ class Depends(object):
if distro in ["debian", "ubuntu"]:
atoms.add("dpkg")
self.platform = Dpkg()
elif distro in ["centos", "redhatenterpriseserver", "fedora",
"opensuseproject", "opensusetumbleweed",
elif distro in ["amazonami", "centos", "redhatenterpriseserver",
"fedora", "opensuseproject", "opensusetumbleweed",
"suselinux"]:
if distro == "redhatenterpriseserver":
# just short alias

View File

@ -62,6 +62,12 @@ class TestDepends(TestCase):
mock_checkoutput.assert_called_once_with(["lsb_release", "-cirs"],
stderr=subprocess.STDOUT)
def test_detects_amazon_linux(self):
with self._mock_lsb("AmazonAMI"):
depends = Depends("")
self.assertThat(
depends.platform_profiles(), Contains("platform:amazonami"))
def test_detects_centos(self):
with self._mock_lsb("CentOS"):
depends = Depends("")