wrap scapy with explicit imports
pylint can't handle scapy's magical imports.
diff --git a/src/python/oftest/packet.py b/src/python/oftest/packet.py
new file mode 100644
index 0000000..67dffb2
--- /dev/null
+++ b/src/python/oftest/packet.py
@@ -0,0 +1,27 @@
+# Distributed under the OpenFlow Software License (see LICENSE)
+# Copyright (c) 2010 The Board of Trustees of The Leland Stanford Junior University
+# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
+"""
+Wrap scapy to satisfy pylint
+"""
+
+try:
+ import scapy.layers.l2
+ import scapy.layers.inet
+ import scapy.layers.inet6
+except ImportError:
+ sys.exit("Need to install scapy for packet parsing")
+
+Ether = scapy.layers.l2.Ether
+LLC = scapy.layers.l2.LLC
+SNAP = scapy.layers.l2.SNAP
+Dot1Q = scapy.layers.l2.Dot1Q
+IP = scapy.layers.inet.IP
+IPOption = scapy.layers.inet.IPOption
+IPv6 = scapy.layers.inet6.IPv6
+ARP = scapy.layers.inet.ARP
+TCP = scapy.layers.inet.TCP
+UDP = scapy.layers.inet.UDP
+ICMP = scapy.layers.inet.ICMP
+ICMPv6Unknown = scapy.layers.inet6.ICMPv6Unknown
+ICMPv6EchoRequest = scapy.layers.inet6.ICMPv6EchoRequest
diff --git a/src/python/oftest/parse.py b/src/python/oftest/parse.py
index 7963c0c..0d57443 100644
--- a/src/python/oftest/parse.py
+++ b/src/python/oftest/parse.py
@@ -4,13 +4,7 @@
import sys
import socket
-try:
- import scapy.all as scapy
-except:
- try:
- import scapy as scapy
- except:
- sys.exit("Need to install scapy for packet parsing")
+import packet as scapy
def parse_mac(mac_str):
"""
diff --git a/src/python/oftest/test_parse.py b/src/python/oftest/test_parse.py
index 7143350..b6c8fce 100755
--- a/src/python/oftest/test_parse.py
+++ b/src/python/oftest/test_parse.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import unittest
import parse
-import scapy.all as scapy
+import packet as scapy
class TestPacketToFlowMatchV3(unittest.TestCase):
def test_tcp(self):
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index e87b7a0..26c25d3 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -4,14 +4,7 @@
import types
import time
import re
-
-try:
- import scapy.all as scapy
-except:
- try:
- import scapy as scapy
- except:
- sys.exit("Need to install scapy for packet parsing")
+import packet as scapy
import oftest
import oftest.controller