Project

General

Profile

Actions

Bug #25739

closed

katello-rhsm-consumer can fail, breaking the isntallation of katello-ca-consumer.rpm

Added by Evgeni Golov about 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Client/Agent
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

I have a host (well, container), where hostname -f returns an error:

[root@a8cc0652a1a1 ~]# hostname
a8cc0652a1a1
[root@a8cc0652a1a1 ~]# hostname -f
hostname.orig: Unknown host
[root@a8cc0652a1a1 ~]# echo $?
1

This results in katello-rhsm-consumer failing when executed:

[root@a8cc0652a1a1 ~]# /usr/bin/katello-rhsm-consumer
hostname: Unknown host
[root@a8cc0652a1a1 ~]# echo $?
1

Which in turn makes %post of katello-ca-consumer.rpm fail:

# rpm -Uvh http://katello.example.com/pub/katello-ca-consumer-latest.noarch.rpm

Retrieving http://katello.example.com/pub/katello-ca-consumer-latest.noarch.rpm
Preparing...                ##################################################
katello-ca-consumer-katello.##################################################
hostname: Unknown host
error: %post(katello-ca-consumer-katello.example.com-1.0-3.noarch) scriptlet failed, exit status 1

The problem here is that katello-rhsm-consumer is executed with set -e (which is good in general!), which makes it fail on the first subprocess fail instead of allowing us to handle the failure ourself.

Actions

Also available in: Atom PDF