diff --git a/conf/test-settings.conf.in b/conf/test-settings.conf.in index 77597eb67..b36f7e798 100644 --- a/conf/test-settings.conf.in +++ b/conf/test-settings.conf.in @@ -19,6 +19,7 @@ along with this program. If not, see . # Django settings for Rockstor project. import os +import subprocess, distro DEBUG = ${django-settings-conf:debug} TEMPLATE_DEBUG = DEBUG @@ -384,4 +385,23 @@ UPDATE_CHANNELS = { 'description': 'Subscription channel for testing updates', 'url': 'rockstor.com/rockrepo-testing', }, -} \ No newline at end of file +} + +# Setup OS specific command paths via 'which cmd' calls +# N.B. this method will not work with an alias, ie in CentOS +# which ls +# alias ls='ls --color=auto' +# /usr/bin/ls +# The following have been tested in CentOS, openSUSE Leap15, and Tumbleweed +UDEVADM = subprocess.check_output(["which", "udevadm"]).rstrip() +SHUTDOWN = subprocess.check_output(["which", "shutdown"]).rstrip() +CHKCONFIG_BIN = subprocess.check_output(["which", "chkconfig"]).rstrip() + +# Establish our OS base id, name, and version: +# Use id for code path decisions. Others are for Web-UI display purposes. +# Examples given are for CentOS Rockstor variant, Leap 15, and Tumblweed. +OS_DISTRO_ID = distro.id() # rockstor, opensuse-leap, opensuse-tumbleweed +OS_DISTRO_NAME = distro.name() # Rockstor, openSUSE Leap, openSUSE Tumbleweed +# Note that the following will capture the build os version. +# For live updates (running system) we call distro.version() directly in code. +OS_DISTRO_VERSION = distro.version() # 3, 15.0 ,20181107 \ No newline at end of file