Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@
PLUGIN_CONFIGURATION_INCLUDE_LINE = 'Include "/etc/collectd-cloudwatch.conf"\r\n'
APT_INSTALL_COMMAND = "apt-get install -y "
YUM_INSTALL_COMMAND = "yum install -y "
SYSTEM_DEPENDENCIES = ["python-pip", "python-setuptools"]
APK_INSTALL_COMMAND = "apk --no-cache add "
SYSTEM_DEPENDENCIES = {
"Ubuntu": ["python-pip", "python-setuptools"],
"Red Hat Enterprise Linux Server": ["python-pip", "python-setuptools"],
"Amazon Linux AMI": ["python-pip", "python-setuptools"],
"Amazon Linux": ["python-pip", "python-setuptools"],
"CentOS Linux": ["python-pip", "python-setuptools"],
"Alpine Linux": ["python2-dev", "py-setuptools"],
}
PIP_INSTALLATION_FLAGS = " install --quiet --upgrade --force-reinstall "
EASY_INSTALL_COMMAND = "easy_install -U --quiet "
PYTHON_DEPENDENCIES = ["requests"]
Expand All @@ -67,6 +75,7 @@
"Amazon Linux AMI": YUM_INSTALL_COMMAND,
"Amazon Linux": YUM_INSTALL_COMMAND,
"CentOS Linux": YUM_INSTALL_COMMAND,
"Alpine Linux": APK_INSTALL_COMMAND,
}


Expand Down Expand Up @@ -260,7 +269,8 @@ def detect_pip():


def install_packages(packages):
command = DISTRIBUTION_TO_INSTALLER[detect_linux_distribution()] + " ".join(packages)
distribution = detect_linux_distribution()
command = DISTRIBUTION_TO_INSTALLER[distribution] + " ".join(packages[distribution])
Command(command, "Installing dependencies").run()


Expand Down