Merge "Add Amazon Linux support to bindep"

This commit is contained in:
Jenkins 2017-04-21 12:02:47 +00:00 committed by Gerrit Code Review
commit c47e81959e
2 changed files with 8 additions and 2 deletions

View File

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

View File

@ -62,6 +62,12 @@ class TestDepends(TestCase):
mock_checkoutput.assert_called_once_with(["lsb_release", "-cirs"], mock_checkoutput.assert_called_once_with(["lsb_release", "-cirs"],
stderr=subprocess.STDOUT) 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): def test_detects_centos(self):
with self._mock_lsb("CentOS"): with self._mock_lsb("CentOS"):
depends = Depends("") depends = Depends("")