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..

Change-Id: I00d78d2a4299a8efd37cab143b937027bd76ee4e
  • Loading branch information
Raj Reddy committed May 20, 2016
1 parent cf689fb commit 0d9e462
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contrail_provisioning/common/upgrade.py
Expand Up @@ -161,13 +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']:
with settings(warn_only=True):
with settings(warn_only = True):
local('DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge\
%s' % rem_pkgs)
%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 0d9e462

Please sign in to comment.