diff options
author | Nikolas Hermanns <nikolas.hermanns@ericsson.com> | 2017-05-04 11:37:07 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-04 11:37:07 +0000 |
commit | 180024bb19dcc52469db87bf92980674fa5f65c2 (patch) | |
tree | 640fd0a90426e5ff95af0549ee83a300519fe687 /odl-pipeline | |
parent | 19ff2816a46f1c4828ea104bbe0361e2d5b93ba5 (diff) | |
parent | 40e6368775836d58dd3b83c197b9ff8efc462262 (diff) |
Merge "Stop and start quagga when reinstalling"
Diffstat (limited to 'odl-pipeline')
-rw-r--r-- | odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py index 053e022..c0cf075 100644 --- a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py +++ b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py @@ -52,6 +52,11 @@ class ODLReInstaller(Service): self.odl_node = node LOG.info("ODL node found: {}".format(self.odl_node.name)) node.execute('systemctl stop opendaylight', as_root=True) + # rc 5 means the service is not there. + node.execute('systemctl stop bgpd', as_root=True, + check_exit_code=[0, 5]) + node.execute('systemctl stop zrpcd', as_root=True, + check_exit_code=[0, 5]) self.disconnect_ovs(node) @@ -90,8 +95,21 @@ class ODLReInstaller(Service): self.validate_ovs(node) LOG.info("OpenDaylight Upgrade Successful!") - @staticmethod - def reinstall_odl(node, odl_artifact): + def _start_service_if_enabled(self, node, service): + # rc 3 means service inactive + # rc 5 mean no service available + status, _ = node.execute('systemctl status {}'. + format(service), check_exit_code=[0, 3, 5]) + if 'service; enabled' in status: + LOG.info('Starting {}'.format(service)) + node.execute('systemctl start {}'.format(service), as_root=True) + + def reinstall_odl(self, node, odl_artifact): + # Check for Quagga + self._start_service_if_enabled(node, 'zrpcd') + self._start_service_if_enabled(node, 'bgpd') + + # Install odl tar_tmp_path = '/tmp/odl-artifact/' node.copy('to', odl_artifact, tar_tmp_path + odl_artifact) node.execute('rm -rf /opt/opendaylight/', as_root=True) |