docker-archive / dockercloud-agent

Agent to manage docker in nodes controlled by Docker Cloud
https://cloud.docker.com/
Apache License 2.0
34 stars 21 forks source link

CLOUD-2643 Update dependence #24

Closed tifayuki closed 8 years ago

fermayo commented 8 years ago

@tifayuki have you tested the new RPM in all RPM-based supported distros? Also, why didn't you use the same mechanism we use in the install-agent.sh script to detect the distro?

get_distribution_type()
{
    local lsb_dist
    lsb_dist="$(lsb_release -si 2> /dev/null || echo "unknown")"
    if [ "$lsb_dist" = "unknown" ]; then
        if [ -r /etc/lsb-release ]; then
            lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")"
        elif [ -r /etc/debian_version ]; then
            lsb_dist='debian'
        elif [ -r /etc/fedora-release ]; then
            lsb_dist='fedora'
        elif [ -r /etc/centos-release ]; then
            lsb_dist='centos'
        elif [ -r /etc/redhat-release ]; then
            lsb_dist='rhel'
        elif [ -r /etc/os-release ]; then
            lsb_dist="$(. /etc/os-release && echo "$ID")"
        fi
    fi
    lsb_dist="$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')"
    echo $lsb_dist
}
tifayuki commented 8 years ago

@fermayo I looked at how install-agent.sh detected the distro: 1) only a few distro have lsb-release command 2) debian_version, fedora-release, centos-release, redhat-release is not a standard format. It may only contain a string that cannot be parsed to distro/version. I mean we can get the distro, but not the version. 3) os-release works for ubuntu, debian,fedora, centos as I tested.

tifayuki commented 8 years ago

@fermayo I tested the RPM on centos 7 and fedora 24