From eef43402b6d06380103c7563586be0e549590047 Mon Sep 17 00:00:00 2001
From: cody burkard <cody@onlab.us>
Date: Sat, 27 Sep 2014 03:38:05 -0700
Subject: [PATCH] check for vlan dependency

---
 examples/vlanhost.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/examples/vlanhost.py b/examples/vlanhost.py
index 00f63690..97c6e8e3 100755
--- a/examples/vlanhost.py
+++ b/examples/vlanhost.py
@@ -26,6 +26,8 @@
 
 from mininet.node import Host
 from mininet.topo import Topo
+from mininet.util import quietRun
+from mininet.log import error
 
 class VLANHost( Host ):
 
@@ -107,6 +109,11 @@ def exampleCustomTags( vlan ):
 
     setLogLevel( 'info' )
 
+    if not quietRun( 'which vconfig' ):
+        error( "Cannot find command 'vconfig'\nThe packge",
+               "'vlan' is required in Ubuntu or Debian,",
+               "or 'vconfig' in Fedora\n" )
+        exit()
     try:
         vlan = int( sys.argv[ 1 ] )
     except Exception:
-- 
GitLab