From 5e2f06a28455bb8f7872afdf87089332cc80a101 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Wed, 12 Apr 2017 08:12:43 -0500 Subject: [PATCH] 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 --- bindep/depends.py | 4 ++-- bindep/tests/test_depends.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bindep/depends.py b/bindep/depends.py index 8d568c0..036e9ab 100644 --- a/bindep/depends.py +++ b/bindep/depends.py @@ -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 diff --git a/bindep/tests/test_depends.py b/bindep/tests/test_depends.py index 4e10580..0a3ecc2 100644 --- a/bindep/tests/test_depends.py +++ b/bindep/tests/test_depends.py @@ -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("")