~thedac/charms/trusty/keystone/status-every-hook

« back to all changes in this revision

Viewing changes to charmhelpers/contrib/network/ip.py

  • Committer: Liam Young
  • Date: 2015-09-28 12:39:04 UTC
  • mfrom: (177.2.1 keystone.lp1499643)
  • Revision ID: liam.young@canonical.com-20150928123904-omyimc2cu68kzvdo
[hopem, r=gnuoy] Sync charmhelpers to get fix for bug 1499643

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from functools import partial
24
24
 
25
25
from charmhelpers.core.hookenv import unit_get
26
 
from charmhelpers.fetch import apt_install
 
26
from charmhelpers.fetch import apt_install, apt_update
27
27
from charmhelpers.core.hookenv import (
28
28
    log,
29
29
    WARNING,
32
32
try:
33
33
    import netifaces
34
34
except ImportError:
35
 
    apt_install('python-netifaces')
 
35
    apt_update(fatal=True)
 
36
    apt_install('python-netifaces', fatal=True)
36
37
    import netifaces
37
38
 
38
39
try:
39
40
    import netaddr
40
41
except ImportError:
41
 
    apt_install('python-netaddr')
 
42
    apt_update(fatal=True)
 
43
    apt_install('python-netaddr', fatal=True)
42
44
    import netaddr
43
45
 
44
46