diff options
author | Nikolas Hermanns <nikolas.hermanns@ericsson.com> | 2017-03-28 11:36:12 +0200 |
---|---|---|
committer | Nikolas Hermanns <nikolas.hermanns@ericsson.com> | 2017-03-31 08:45:34 +0000 |
commit | 6e3875bb506dc99a46e06df032590c11f63ac555 (patch) | |
tree | 8be5389b7eecf035c4390b401dfdab0c89b2eb74 /odl-pipeline/lib/odl_reinstaller | |
parent | 6f750095ce1db59b3772c3461d4178ce12b11ae0 (diff) |
If not ODL is installed install it on first controller
Change-Id: I0fa5f3e6141a92b99c446569dae8b8db631176ec
Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com>
Diffstat (limited to 'odl-pipeline/lib/odl_reinstaller')
-rw-r--r-- | odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py index 7bf1e8d..372c200 100644 --- a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py +++ b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py @@ -40,7 +40,11 @@ class ODLReInstaller(Service): self.nodes = NodeManager(node_config['servers']).get_nodes() for node in self.nodes: node.execute('ovs-vsctl del-controller br-int', as_root=True) + first_controller = None for node in self.nodes: + if not first_controller: + if 'controller' in node.execute('echo $HOSTNAME')[0]: + first_controller = node # Check if ODL runs on this node rv, _ = node.execute('ps aux |grep -v grep |grep karaf', as_root=True, check_exit_code=[0, 1]) @@ -52,6 +56,8 @@ class ODLReInstaller(Service): self.disconnect_ovs(node) # Upgrade ODL + if not self.odl_node: + self.odl_node = first_controller self.reinstall_odl(self.odl_node, odl_artifact) # Wait for ODL to come back up |