Skip to content

Commit

Permalink
Handle the redis.conf changes to disable redis-server persistence
Browse files Browse the repository at this point in the history
during upgrade to r2.20
Closes-Bug: 1463749

Change-Id: I2777b763d3073f6b9dbe779597fddc95a8eadd55
  • Loading branch information
Shweta Naik committed Jun 11, 2015
1 parent f87764f commit 504459c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrail_provisioning/collector/upgrade.py
Expand Up @@ -61,6 +61,11 @@ def upgrade(self):
if os.path.exists('/etc/contrail/supervisord_analytics_files/contrail-alarm-gen.ini'):
os.remove('/etc/contrail/supervisord_analytics_files/contrail-alarm-gen.ini')

#Disable redis server persistence since that is not used by analytics in r2.20
#bug-1463749
if self._args.to_rel >= 2.2:
self.fix_redis()

self.restart()


Expand Down
8 changes: 8 additions & 0 deletions contrail_provisioning/common/upgrade.py
Expand Up @@ -172,6 +172,14 @@ def get_build(self, pkg='contrail-install-packages'):
return None
return pkg_rel

def fix_redis(self):
if os.path.exists('/var/lib/redis/dump.rdb'):
os.remove('/var/lib/redis/dump.rdb')
conf_file = '/etc/redis/redis.conf'
local("sudo sed -i 's/^save 900 1/#save 900 1/g' %s" % conf_file)
local("sudo sed -i 's/^save 300 10/#save 300 10/g' %s" % conf_file)
local("sudo sed -i 's/^save 60 10000/#save 60 10000/g' %s" % conf_file)

def _upgrade(self):
self._backup_config()
if self.pdist in ['centos']:
Expand Down
4 changes: 4 additions & 0 deletions contrail_provisioning/webui/upgrade.py
Expand Up @@ -31,6 +31,10 @@ def restart(self):
def upgrade(self):
self._upgrade()
self.upgrade_python_pkgs()
#Disable redis server persistence since that is not used by and webui in r2.20
#bug-1463749
if self._args.to_rel >= 2.2:
self.fix_redis()
self.restart()


Expand Down

0 comments on commit 504459c

Please sign in to comment.