]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-deploy: properly set the DISTRO for the chacra endpoint
authorAndrew Schoen <aschoen@redhat.com>
Fri, 6 Nov 2015 18:35:02 +0000 (12:35 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Fri, 6 Nov 2015 18:35:02 +0000 (12:35 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
ceph-deploy/build/build

index c756ad7ab06b627ee94eb8c6ab4f68b67f02d487..c257e6e6c801b2d8decb38db4ff7952bc6323ada 100644 (file)
@@ -35,12 +35,51 @@ then
         # Tag tree and update version number in change log and
         # in setup.py before building.
 
+        get_rpm_dist() {
+            LSB_RELEASE=/usr/bin/lsb_release
+            [ ! -x $LSB_RELEASE ] && echo unknown && exit
+
+            ID=`$LSB_RELEASE --short --id`
+
+            case $ID in
+            RedHatEnterpriseServer)
+                DISTRO_VERSION=`$LSB_RELEASE --short --release | cut -d. -f1`
+                DISTRO=rhel
+                ;;
+            CentOS)
+                DISTRO_VERSION=`$LSB_RELEASE --short --release | cut -d. -f1`
+                DISTRO=centos
+                ;;
+            Fedora)
+                DISTRO_VERSION=`$LSB_RELEASE --short --release`
+                DISTRO=fedora
+                ;;
+            SUSE\ LINUX)
+                DESC=`$LSB_RELEASE --short --description`
+                DISTRO_VERSION=`$LSB_RELEASE --short --release`
+                case $DESC in
+                *openSUSE*)
+                        DISTRO=opensuse
+                    ;;
+                *Enterprise*)
+                        DISTRO=sles
+                        ;;
+                    esac
+                ;;
+            *)
+                DIST=unknown
+                DISTRO=unknown
+                ;;
+            esac
+
+        }
+
+        get_rpm_dist
+
         REPO=rpm-repo
         BUILDAREA=./rpmbuild
         DIST=el6
         RPM_BUILD=$(lsb_release -s -c)
-        DISTRO_VERSION=`$LSB_RELEASE --short --release | cut -d. -f1`
-        DISTRO=`python -c "exec 'import platform; print platform.linux_distribution()[0].lower()'"`
 
         [ "$TEST" = true ] && chacra_ref="test" || chacra_ref="$BRANCH"
         chacra_endpoint="ceph-deploy/${chacra_ref}/${DISTRO}/${DISTRO_VERSION}"