fixed updated raised exceptions to be 2/3 compatible

This commit is contained in:
bharnden 2019-05-05 16:56:18 -07:00
parent feebd8704f
commit b42b5b1a5a
3 changed files with 3 additions and 4 deletions

View file

@ -432,7 +432,7 @@ class GreTap(CoreInterface):
return
if remoteip is None:
raise ValueError, "missing remote IP required for GRE TAP device"
raise ValueError("missing remote IP required for GRE TAP device")
args = [constants.IP_BIN, "link", "add", self.localname, "type", "gretap",
"remote", str(remoteip)]
if localip:

View file

@ -130,8 +130,7 @@ class Route(object):
try:
self.prefix = ipaddress.Ipv4Prefix(prefix)
except Exception, e:
raise ValueError, "Invalid prefix given to Route object: %s\n%s" % \
(prefix, e)
raise ValueError("Invalid prefix given to Route object: %s\n%s" % (prefix, e))
self.gw = gw
self.metric = metric

View file

@ -329,7 +329,7 @@ class Ns3WimaxNet(CoreNs3Net):
netif1, ns3dev1 = self.findns3dev(node1)
netif2, ns3dev2 = self.findns3dev(node2)
if not netif1 or not netif2:
raise ValueError, "interface not found"
raise ValueError("interface not found")
addr1, mask1 = self.ipv4netifaddr(netif1)
addr2, mask2 = self.ipv4netifaddr(netif2)
clargs1 = (addr1, mask1, addr2, mask2) + downclass