awslabs / collectd-cloudwatch

A collectd plugin for sending data to Amazon CloudWatch
MIT License
199 stars 131 forks source link

Install script fails to detect distro on Debian #64

Open roman-cnd opened 6 years ago

roman-cnd commented 6 years ago

Hi,

The script fails on Debian

./setup.py
Traceback (most recent call last):
  File "./setup.py", line 964, in <module>
    main()
  File "./setup.py", line 957, in main
    install_plugin()
  File "./setup.py", line 869, in install_plugin
    install_packages(SYSTEM_DEPENDENCIES)
  File "./setup.py", line 261, in install_packages
    command = DISTRIBUTION_TO_INSTALLER[detect_linux_distribution()] + " ".join(packages)
KeyError: 'Debian GNU'

Because Debian is not in the DISTRIBUTION_TO_INSTALLER

root@stretch:~# cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
dummy-dum232 commented 6 years ago

Go to line 63 and add Debian GNU

DISTRIBUTION_TO_INSTALLER = { "Ubuntu": APT_INSTALL_COMMAND, "Red Hat Enterprise Linux Server": YUM_INSTALL_COMMAND, "Amazon Linux AMI": YUM_INSTALL_COMMAND, "CentOS Linux": YUM_INSTALL_COMMAND, "Debian GNU": APT_INSTALL_COMMAND, }

karatyman commented 6 years ago

FYI with the new Amazon Linux ami, you have to do this too, you'll get the same error except it will so "Amazon Linux" so just change "Amazon Linux AMI" to "Amazon Linux"

jhaoheng commented 4 years ago

@dgouldin thanks Does it make a new pull-request to fix this issue?