Ensure python2 is installed before hook execution
Change-Id: I724eaea5f09191b548e5497f9bb2c777f882d290 Closes-Bug: 1606906
This commit is contained in:
parent
e95488afa0
commit
41b60eb037
|
@ -103,7 +103,7 @@ SUPPORTED_TRANSPORTS = ['udp', 'udpu', 'multicast', 'unicast']
|
|||
DEPRECATED_TRANSPORT_VALUES = {"multicast": "udp", "unicast": "udpu"}
|
||||
|
||||
|
||||
@hooks.hook()
|
||||
@hooks.hook('install.real')
|
||||
def install():
|
||||
ubuntu_release = lsb_release()['DISTRIB_CODENAME'].lower()
|
||||
if CompareHostReleases(ubuntu_release) >= 'zesty':
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
hooks.py
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
|
||||
# by default.
|
||||
|
||||
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml' 'dnspython')
|
||||
|
||||
check_and_install() {
|
||||
pkg="${1}-${2}"
|
||||
if ! dpkg -s ${pkg} 2>&1 > /dev/null; then
|
||||
apt-get -y install ${pkg}
|
||||
fi
|
||||
}
|
||||
|
||||
PYTHON="python"
|
||||
|
||||
for dep in ${DEPS[@]}; do
|
||||
check_and_install ${PYTHON} ${dep}
|
||||
done
|
||||
|
||||
exec ./hooks/install.real
|
|
@ -0,0 +1 @@
|
|||
hooks.py
|
Loading…
Reference in New Issue