Bug 754180 - rlIsRHEL 4 does not match RHEL4 Desktop
Summary: rlIsRHEL 4 does not match RHEL4 Desktop
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Muller
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-15 16:12 UTC by Karel Volný
Modified: 2016-09-20 02:08 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-08 11:39:49 UTC
Type: ---


Attachments (Terms of Use)

Description Karel Volný 2011-11-15 16:12:56 UTC
Description of problem:
Please see https://beaker.engineering.redhat.com/recipes/331315

The distro is identified as

:: [   LOG    ] :: Distro:       : Red Hat Desktop release 4 (Nahant Update 9)


however, the conditional code path after "if rlIsRHEL 4" does not trigger

Comment 1 Matej Kollar 2012-05-14 11:54:49 UTC
I think problem is somewhere here:

> __INTERNAL_rlIsDistro(){
>   local distro="$(lsb_release -ds)"
>   local whole="$(lsb_release -rs)"
>   local major="$(lsb_release -rs | cut -d '.' -f 1)"
>   echo $distro | grep -q "$1" || return 1
>   shift
>   [ -z "$1" ] && return 0
>   for arg in $@
>   do
>     if [ "$arg" == "$whole" ] || [ "$arg" == "$major" ]
>     then
>       return 0
>     fi
>   done
>   return 1
> }

> rlIsRHEL(){
>   __INTERNAL_rlIsDistro "Red Hat Enterprise Linux" "$@"
> }

As on RHEL5 Update 9

  # cat /etc/redhat-release 
  Red Hat Desktop release 4 (Nahant Update 9)
  # lsb_release -ds
  "Red Hat Desktop release 4 (Nahant Update 9)"

So there is not string "Red Hat Enterprise Linux" but
"Red Hat Desktop release".

It would be very nice to have this fixed... like really really nice...

(Maybe

> rlIsRHEL(){
>   __INTERNAL_rlIsDistro "Red Hat Enterprise Linux" "$@" \
>   || __INTERNAL_rlIsDistro "Red Hat Desktop release" "$@"
> }

might do the trick...)

Comment 4 Karel Volný 2013-01-03 10:38:53 UTC
seems that it works ... from http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2013/01/3569/356958/752028/9892042/TESTOUT.log

RHEL4 - turn off selinux check

selinux-policy-targeted-sources-1.17.30-2.152.el4
:: [   PASS   ] :: Checking for the presence of selinux-policy-targeted-sources rpm

:: [13:42:04] :: [ INFO    ] :: No initdb in RHEL4/5


^ these three are triggered by rlIsRHEL

and the release string is:

:: [   LOG    ] :: Distro:       : Red Hat Desktop release 4 (Nahant Update 9)


so, VERIFIED, and I guess it may get closed as well, thanks for fixing!


Note You need to log in before you can comment on or make changes to this bug.