Skip to content

Commit

Permalink
Closes-Bug: #1491955 - Sources.list needs to be cleaned up to prevent…
Browse files Browse the repository at this point in the history
… apt-get update errors

In upgrade scenario, /etc/apt/sources.list needs to be cleaned to remove old Smgr repo entry
The repo we are adding needs to be removed if present at time of install
Temp files used to create local repo in Smgr sources file need to be removed if present

Patch 2:
Implemented review comments.
Check for --all --nonsm-mon case was missing, added

Patch 3:
Bharat setup bug fix: exit_status wrong location for apt.conf -> TESTED
Cleanup of setup repo put in main function before setup repos -> TESTED
local repo in sources.list -> TESTED
Monitoring set to false by default and set to true by monitoring install

Change-Id: Idfde6c04543a4c721239ad106da19a472998f6f9
  • Loading branch information
nitishkrishna committed Sep 3, 2015
1 parent 2868200 commit 8708776
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions build/deb_server_manager_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,20 @@ function usage()
echo ""
}

function setup_smgr_repos()
function cleanup_smgr_repos()
{

echo "$space$arrow Cleaning up existing sources.list and Server Manager sources file"
local_repo="deb file:/opt/contrail/contrail_server_manager ./"
sed -i "s|$local_repo||g" /etc/apt/sources.list
if [ -f /etc/apt/sources.list.d/smgr_sources.list ]; then
rm /etc/apt/sources.list.d/smgr_sources.list
fi

}

function setup_smgr_repos()
{
# Push this to makefile - Copy only the file we need into installer.
if [ ${rel[1]} == "14.04" ]; then
cp /opt/contrail/contrail_server_manager/ubuntu_14_04_1_sources.list /etc/apt/sources.list.d/smgr_sources.list
Expand Down Expand Up @@ -85,8 +96,8 @@ function setup_smgr_repos()
apt_auth="APT::Get::AllowUnauthenticated \"true\";"
set +e
grep --quiet "$apt_auth" /etc/apt/apt.conf
set -e
exit_status=$?
set -e
if [ $exit_status != "0" ]; then
echo "$apt_auth" >> /etc/apt/apt.conf
fi
Expand Down Expand Up @@ -188,6 +199,7 @@ while [ "$1" != "" ]; do
shift
done

cleanup_smgr_repos
setup_smgr_repos

if [ "$SM" != "" ]; then
Expand Down Expand Up @@ -299,7 +311,7 @@ if [ "$WEBUI" != "" ] && [ "$NOWEBUI" == "" ]; then
echo "$arrow Completed Installing Web Server Manager"
fi

if [ "$SMMON" != "" ]; then
if [ "$SMMON" != "" ] && [ "$NOSMMON" == "" ]; then
echo "$arrow Server Manager Monitoring"
echo "$space$arrow$install_str Server Manager Monitoring"
apt-get -y install contrail-server-manager-monitoring >> $log_file 2>&1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ fi
echo $HOST_IP

sed -i "s/127.0.0.1/$HOST_IP/g" /opt/contrail/server_manager/sm-sandesh-config.ini
sed -i "s/monitoring * = .*/monitoring = true/g" /opt/contrail/server_manager/sm-config.ini

0 comments on commit 8708776

Please sign in to comment.