Skip to content

Commit

Permalink
Closes-Bug: #1584154
Browse files Browse the repository at this point in the history
make the upgrade_contrail re-entrant by ignoring error of removal of packages,
as those would have been removed in earlier runs..

(cherry picked from commit 0d9e462)

Conflicts:
	contrail_provisioning/common/upgrade.py
Change-Id: I00d78d2a4299a8efd37cab143b937027bd76ee4e
  • Loading branch information
Raj Reddy committed May 20, 2016
1 parent 1a29ae5 commit 70f6d10
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions contrail_provisioning/common/upgrade.py
Expand Up @@ -9,7 +9,7 @@
import argparse
import stat
from distutils.version import LooseVersion

from fabric.api import settings
from fabric.api import local

class ContrailUpgrade(object):
Expand Down Expand Up @@ -161,12 +161,14 @@ def _replace_package(self):
rem_pkgs = ' '.join([x for (x,y) in self.upgrade_data['replace']])
add_pkgs = ' '.join([y for (x,y) in self.upgrade_data['replace']])
if self.pdist in ['Ubuntu']:
local('DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge\
%s' % rem_pkgs)
with settings(warn_only = True):
local('DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge\
%s' % rem_pkgs)
local('DEBIAN_FRONTEND=noninteractive apt-get -y install --reinstall\
%s' % add_pkgs)
else:
local('rpm -e --nodeps %s' % rem_pkgs)
with settings(warn_only = True):
local('rpm -e --nodeps %s' % rem_pkgs)
cmd = 'yum -y --nogpgcheck --disablerepo=*'
cmd += ' --enablerepo=contrail* install %s' % add_pkgs
local(cmd)
Expand Down

0 comments on commit 70f6d10

Please sign in to comment.