Bug 901732 - Monitoring Parent can not be set
Summary: Monitoring Parent can not be set
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite Proxy 5
Classification: Red Hat
Component: Installer
Version: 550
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks: sat560-lowbug
TreeView+ depends on / blocked
 
Reported: 2013-01-18 22:12 UTC by Dimitar Yordanov
Modified: 2013-10-01 21:54 UTC (History)
3 users (show)

Fixed In Version: spacewalk-proxy-installer-1.10.3-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-01 21:54:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dimitar Yordanov 2013-01-18 22:12:45 UTC
Description of problem:
Monitoring Parent can not be set

Version-Release number of selected component (if applicable):
spacewalk-proxy-installer-1.7.6-4

How reproducible:
100%

Steps to Reproduce:
1. Register EL[56] system to Satellite
2. Add rhn-tools channel
3. Add provisioning entitlement
4. yum install spacewalk-proxy-installer
5. Stop the Satellite server (rhn-satellite stop)  
6. ./configure-proxy.sh --force-own-ca  --monitoring-parent=test


Actual results:
Always the Satellite to which the RHN-Proxy is activated will be used.

Expected results:
The installation script (configure-proxy.sh) code imply other behaviour.

Is seems there is a misspell MONITORING_PARENT_IP -> MONITORING_PARENT and seems even if set RESOLVED_IP will not be influenced:

        --enable-scout=*) ENABLE_SCOUT=$(echo $1 | cut -d= -f2-);;
        --monitoring-parent=*) MONITORING_PARENT_IP=$(echo $1 | cut -d= -f2-);;
        --monitoring-parent-ip=*) MONITORING_PARENT_IP=$(echo $1 | cut -d= -f2-);;
        --populate-config-channel=*) POPULATE_CONFIG_CHANNEL=$(echo $1 | cut -d= -f2-);;
        --start-services=*) START_SERVICES=$(echo $1 | cut -d= -f2-);;
        *) echo Error: Invalid option $1
    esac
    shift
done

default_or_input () {
	local MSG="$1"
	local VARIABLE="$2"
	local DEFAULT="$3"

	local INPUT
	local CURRENT_VALUE=$(eval "echo \$$VARIABLE")
	#in following code is used not so common expansion
	#var_a=${var_b:-word}
	#which is like: var_a = $var_b ? word
	DEFAULT=${CURRENT_VALUE:-$DEFAULT}
	local VARIABLE_ISSET=$(set | grep "^$VARIABLE=")

	echo -n "$MSG [$DEFAULT]: "
	if [ "$INTERACTIVE" = "1" -a  -z "$VARIABLE_ISSET" ]; then
		read INPUT
	elif [ -z "$VARIABLE_ISSET" ]; then
		echo $DEFAULT
	else
		eval "DEFAULT=\$$VARIABLE"
		echo $DEFAULT
	fi
	if [ -z "$INPUT" ]; then
		INPUT="$DEFAULT"
	fi
	eval "$VARIABLE='$INPUT'"
}




    default_or_input "Monitoring parent" MONITORING_PARENT "$RHN_PARENT"
    #RESOLVED_IP=$(/usr/bin/getent hosts $RHN_PARENT | cut -f1 -d' ')
    # FIX dyordano ? 
    RESOLVED_IP=$(/usr/bin/getent hosts ${MONITORING_PARENT:-$RHN_PARENT} | cut -f1 -d' ')
    default_or_input "Monitoring parent IP" MONITORING_PARENT_IP "$RESOLVED_IP"



Additional info:

Comment 1 Michael Mráka 2013-05-14 13:41:27 UTC
Both issues fixed in psacewalk nightly by
commit 0528fb84ca703c09d7dccd40e96ee3b07b8be7e8
    901732 - set default ip to monitoring_parent primary ip
commit 041444ceb1d0c9f547114ed83686f8d20730ef15
    901732 - fixed typo in MONITORING_PARENT name

Comment 3 Clifford Perry 2013-10-01 21:54:42 UTC
Satellite 5.6 has been released. This bug was tracked under the release.  

This bug was either VERIFIED or RELEASE_PENDING (re-verified prior shortly
before release). 

Moving to CLOSED CURRENT_RELEASE. 

Text from Upgrade Erratum follows:

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.

http://rhn.redhat.com/errata/RHEA-2013-1395.html


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