Bug 1494575

Summary: RHEL7.* isn't subscribed to EUS channel with option --use-eus-channel
Product: Red Hat Satellite 5 Reporter: Pavel Studeník <pstudeni>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED ERRATA QA Contact: Martin Korbel <mkorbel>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: mkorbel, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-2.5.3-155-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 07:59:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1450111    

Description Pavel Studeník 2017-09-22 14:26:02 UTC
Description of problem:
I try to register RHEL7.0 to EUS channel as default by command rhnreg_ks  --use-eus-channel. I have synced channels 7.1-7.4. But the system is subscribed to rhel-x86_64-server-7. The RHEL6 works correct. The problem exists only for RHEL7.

I investigate more about this issue and problem is comparison of version. 

RHEL6 

server/rhnChannel.base_eus_channel_for_ver_rel_arch('6.5.0', '6.7.0')
server/rhnChannel.base_eus_channel_for_ver_rel_arch('6.5.0', '6.5.0')

RHEL7
server/rhnChannel.base_eus_channel_for_ver_rel_arch('7.1-1.el7_1', '7.2-9.el7', '7Server')
server/rhnChannel.base_eus_channel_for_ver_rel_arch('7.1-1.el7_1', '7.3-1.el7', '7Server')
server/rhnChannel.base_eus_channel_for_ver_rel_arch('7.1-1.el7_1', '7.1-1.el7', '7Server')
server/rhnChannel.base_eus_channel_for_ver_rel_arch('7.1-1.el7_1', '7.4-1.el7', '7Server')


The function rpm.labelCompare doesn't compare correct version of package. For example 7.1-1.el7_1' and '7.1-1.el7' it is not same version.


Version-Release number of selected component (if applicable):
spacewalk-backend-server-2.5.3-152.el6sat.noarch

How reproducible:
always

Steps to Reproduce:
1. synced eus channels 7.*
2. create new system 7.1 
3. rhnreg_ks .. --use-eus-channel

Actual results:
system is subscribed to base RHEL7 (not EUS channel) - rhel-x86_64-server-7

Expected results:
system is subscribed to EUS channel - rhel-x86_64-server-7.1.eus

Comment 1 Tomáš Kašpárek 2017-09-25 08:46:38 UTC
Weird I've just registered 7.1 server to rhel-x86_64-server-7.1.eus on two different Satellites.

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.1 (Maipo)

Comment 2 Tomáš Kašpárek 2017-09-27 12:29:57 UTC
spacewalk.git(master): 79b0ed8e2faaf2fa054ebf6263eb12afa662441c
spacewalk.git(master): db8eeb94687cb95a95a9e662bf9b330a363c53e0

Comment 3 Pavel Studeník 2017-09-29 10:16:09 UTC
I created pull request that subscribes nearby version of channel.

https://github.com/spacewalkproject/spacewalk/pull/579

For example:
System with release: redhat-release-server-7.0-1.el7.x86_64

Available channels:
rhel-x86_64-server-7.1.eus
rhel-x86_64-server-7.2.eus
rhel-x86_64-server-7.3.eus
rhel-x86_64-server-7.4.eus

The system will be registered to "rhel-x86_64-server-7.1.eus".

Comment 6 Tomáš Kašpárek 2017-11-01 10:09:15 UTC
spacewalk.git(master): 54cc74cf682f02b9b5e76a8383bbbf11ad55d4cd

Comment 8 Martin Korbel 2017-11-10 14:47:56 UTC
FAILQA on spacewalk-backend-2.5.3-156 and rhn-check-2.0.2-17 (client side)

Reproducer:
1. We have got Sat5.8 with EUS channels
> spacewalk-remove-channel -l
rhel-x86_64-server-7
	rhn-tools-rhel-x86_64-server-7
rhel-x86_64-server-7.1.eus
rhel-x86_64-server-7.2.eus
rhel-x86_64-server-7.3.eus
rhel-x86_64-server-7.4.eus


2. We have a client machine with RHEL7.1
> rpm -q  redhat-release-server
redhat-release-server-7.1-1.el7.x86_64

3. Register client to server with parameter --use-eus-channel
> rhnreg_ks --user aaaa --password xxx --use-eus-channel --force

4. Check the base channel of client
> yum repolist

Actual results:
...
rhel-x86_64-server-7
...

Expected results:
...
rhel-x86_64-server-7.1.eus
...



BTW:  The option "use-eus-channel" is not mentioned in man page.
> man rhnreg_ks | grep -c use-eus-channel
0

Comment 9 Tomáš Kašpárek 2017-11-14 09:55:04 UTC
spacewalk.git(master): cc907aab14259836f0c4ea33ad2229235620a9d6

Comment 11 Martin Korbel 2017-11-14 14:53:13 UTC
VERIFIED on spacewalk-backend-2.5.3-157

created a new bug about documentation bz1512988

reproducer via comment 8

result
...
rhel-x86_64-server-7.1.eus
...

Comment 14 errata-xmlrpc 2017-12-13 07:59:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:3445