diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-09-12 17:22:29 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-09-12 17:22:29 -0400 |
commit | 78dd5e2783dbf06c0e2d6569423d1bbb24dcfa89 (patch) | |
tree | 5749b5681b3ff00071f3a4fd42f66027886b5193 /cloudinit/netinfo.py | |
parent | 3ac51517c6e561a4c3590af972b95602aa496afd (diff) | |
download | vyos-cloud-init-78dd5e2783dbf06c0e2d6569423d1bbb24dcfa89.tar.gz vyos-cloud-init-78dd5e2783dbf06c0e2d6569423d1bbb24dcfa89.zip |
netinfo: log error on failure of route info
Diffstat (limited to 'cloudinit/netinfo.py')
-rw-r--r-- | cloudinit/netinfo.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py index 1bdca9f7..8d4df342 100644 --- a/cloudinit/netinfo.py +++ b/cloudinit/netinfo.py @@ -21,10 +21,13 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import cloudinit.util as util +from cloudinit.log import logging import re from prettytable import PrettyTable +LOG = logging.getLogger() + def netdev_info(empty=""): fields = ("hwaddr", "addr", "bcast", "mask") @@ -168,8 +171,9 @@ def route_pformat(): lines = [] try: routes = route_info() - except Exception: + except Exception as e: lines.append(util.center('Route info failed', '!', 80)) + util.logexc(LOG, "Route info failed: %s" % e) routes = None if routes is not None: fields = ['Route', 'Destination', 'Gateway', |