Install python dependencies early for CH ip.py
When using charmhelpers.contrib.network.ip apt install was quietly failing. Install python dependencies in the early install hook (before install.real). Charm-helpers sync to bring in apt_install with fatal=True Change-Id: I2aecd78d04c0ebdbf80ba17d2bd13659715a912f Partial-Bug: 1601972
This commit is contained in:
parent
11772792ce
commit
7cd6ab7e2b
@ -414,7 +414,7 @@ def ns_query(address):
|
|||||||
try:
|
try:
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
except ImportError:
|
except ImportError:
|
||||||
apt_install('python-dnspython')
|
apt_install('python-dnspython', fatal=True)
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
|
||||||
if isinstance(address, dns.name.Name):
|
if isinstance(address, dns.name.Name):
|
||||||
@ -458,7 +458,7 @@ def get_hostname(address, fqdn=True):
|
|||||||
try:
|
try:
|
||||||
import dns.reversename
|
import dns.reversename
|
||||||
except ImportError:
|
except ImportError:
|
||||||
apt_install("python-dnspython")
|
apt_install("python-dnspython", fatal=True)
|
||||||
import dns.reversename
|
import dns.reversename
|
||||||
|
|
||||||
rev = dns.reversename.from_address(address)
|
rev = dns.reversename.from_address(address)
|
||||||
|
@ -145,7 +145,7 @@ SWIFT_CODENAMES = OrderedDict([
|
|||||||
('mitaka',
|
('mitaka',
|
||||||
['2.5.0', '2.6.0', '2.7.0']),
|
['2.5.0', '2.6.0', '2.7.0']),
|
||||||
('newton',
|
('newton',
|
||||||
['2.8.0']),
|
['2.8.0', '2.9.0']),
|
||||||
])
|
])
|
||||||
|
|
||||||
# >= Liberty version->codename mapping
|
# >= Liberty version->codename mapping
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
|
# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
|
||||||
# by default.
|
# by default.
|
||||||
|
|
||||||
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml')
|
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml' 'dnspython')
|
||||||
|
|
||||||
check_and_install() {
|
check_and_install() {
|
||||||
pkg="${1}-${2}"
|
pkg="${1}-${2}"
|
||||||
|
Loading…
Reference in New Issue
Block a user