From 5ed6732b1d757a5103ecfe79629f965c30e13236 Mon Sep 17 00:00:00 2001 From: Kumar Harsh Date: Fri, 3 Mar 2017 11:15:06 +0530 Subject: [PATCH] From R3.0 socket files are moved to /var/run from /tmp Hence for upgrade to releases 3.0 or greater edit correct path in toragent init script . Change-Id: If255df7ee9c8e747c9878ee630fdb4ddfd0fa25a Closes-Bug: #1666218 --- contrail_provisioning/compute/upgrade.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrail_provisioning/compute/upgrade.py b/contrail_provisioning/compute/upgrade.py index 70a72262..0fa6b4f5 100644 --- a/contrail_provisioning/compute/upgrade.py +++ b/contrail_provisioning/compute/upgrade.py @@ -4,6 +4,7 @@ # """Upgrade's Contrail Compute components.""" +import os from distutils.version import LooseVersion from setup import ComputeSetup @@ -83,6 +84,11 @@ def fix_nova_params(self): nova_conf_file) local("service %s start" % openstack_compute_service) + def fix_tor_agent_init_script(self): + for tor_file in os.listdir('/etc/init.d/'): + if 'contrail-tor-agent' in tor_file: + local("cp /etc/init.d/contrail-vrouter-agent /etc/init.d/%s " % (tor_file)) + def upgrade(self): self.disable_apt_get_auto_start() self._upgrade() @@ -97,6 +103,9 @@ def upgrade(self): if (self._args.from_rel < LooseVersion('2.20') and self._args.to_rel >= LooseVersion('2.20')): self.compute_setup.fixup_contrail_vrouter_nodemgr() + if 'toragent' in self._args.roles: + if (self._args.to_rel >= LooseVersion('3.00')): + self.fix_tor_agent_init_script() self.enable_apt_get_auto_start() def main():