summaryrefslogtreecommitdiffstats
path: root/odl-pipeline/lib/odl_reinstaller
diff options
context:
space:
mode:
authorNikolas Hermanns <nikolas.hermanns@ericsson.com>2017-03-28 11:25:51 +0200
committerNikolas Hermanns <nikolas.hermanns@ericsson.com>2017-03-28 14:41:17 +0200
commit02e6dccc8179dead5e1140e4b639de5da94390bd (patch)
tree93d853353782683d8405a0a4d51aeca210ea4200 /odl-pipeline/lib/odl_reinstaller
parent5960fab7230bebbffc439457d5542d086cb3f8af (diff)
Add possibility to install rpms
Change-Id: I1e5950e3331e76d71aca748f962ba2c5c3ea7541 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.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py
index 655f816..7bf1e8d 100644
--- a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py
+++ b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py
@@ -85,19 +85,25 @@ class ODLReInstaller(Service):
LOG.info("OpenDaylight Upgrade Successful!")
@staticmethod
- def reinstall_odl(node, odl_tarball):
+ def reinstall_odl(node, odl_artifact):
tar_tmp_path = '/tmp/odl-artifact/'
- node.copy('to', odl_tarball, tar_tmp_path + odl_tarball)
+ node.copy('to', odl_artifact, tar_tmp_path + odl_artifact)
node.execute('rm -rf /opt/opendaylight/*', as_root=True)
node.execute('mkdir -p /opt/opendaylight/*', as_root=True)
- LOG.info('Extracting %s to /opt/opendaylight/ on node %s'
- % (odl_tarball, node.name))
- node.execute('tar -zxf %s --strip-components=1 -C '
- '/opt/opendaylight/'
- % (tar_tmp_path + odl_tarball), as_root=True)
- node.execute('chown -R odl:odl /opt/opendaylight', as_root=True)
+ if 'tar.gz' in odl_artifact:
+ LOG.info('Extracting %s to /opt/opendaylight/ on node %s'
+ % (odl_artifact, node.name))
+ node.execute('tar -zxf %s --strip-components=1 -C '
+ '/opt/opendaylight/'
+ % (tar_tmp_path + odl_artifact), as_root=True)
+ node.execute('chown -R odl:odl /opt/opendaylight', as_root=True)
+ if '.rpm' in odl_artifact:
+ LOG.info('Installing %s on node %s'
+ % (odl_artifact, node.name))
+ node.execute('yum remove -y opendaylight; yum install -y %s'
+ % (tar_tmp_path + odl_artifact), as_root=True)
node.execute('rm -rf ' + tar_tmp_path, as_root=True)
- LOG.info('Installing and Starting Opendaylight on node %s' % node.name)
+ LOG.info('Starting Opendaylight on node %s' % node.name)
node.execute('puppet apply -e "include opendaylight" '
'--modulepath=/etc/puppet/modules/ '
'--verbose --debug --trace --detailed-exitcodes',