[Proposal]

--- /tmp/netplan.io-0.36.1/netplan/cli/commands/ip.py   2018-04-23 
15:12:16.000000000 +0000
+++ /usr/share/netplan/netplan/cli/commands/ip.py       2018-05-04 
20:01:32.380195381 +0000
@@ -21,6 +21,7 @@
 import os
 import sys
 import subprocess
+from subprocess import CalledProcessError
 
 import netplan.cli.utils as utils
 
@@ -139,7 +140,10 @@
 
         # Extract out of the generator our mapping in a dict.
         logging.debug('command ip leases: running %s', argv)
-        out = subprocess.check_output(argv, universal_newlines=True)
+        try:
+            out = subprocess.check_output(argv, universal_newlines=True)
+        except CalledProcessError as e:
+            sys.exit("Failed to execute. Please make sure the interface %s is 
managed by netplan and configured to DHCP" % (self.interface))
         mapping = {}
         mapping_s = out.split(',')
         for keyvalue in mapping_s:

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1768823

Title:
  netplan ip leases <interface>

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1768823/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to