From ea7c8795f5eb12d67f59b862e487333d2b1a681b Mon Sep 17 00:00:00 2001
From: Brandon Heller <brandonh@stanford.edu>
Date: Sat, 12 Dec 2009 02:54:39 -0800
Subject: [PATCH] Ensure netns is in the path.

---
 mininet.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mininet.py b/mininet.py
index bba518ea..d58e88f4 100755
--- a/mininet.py
+++ b/mininet.py
@@ -796,6 +796,10 @@ def init():
       # Note: this script must be run as root 
       # Perhaps we should do so automatically!
       print "*** Mininet must run as root."; exit( 1 )
+   # If which produces no output, then netns is not in the path.
+   # May want to loosen this to handle netns in the current dir.
+   if not quietRun(['which', 'netns']):
+       raise Exception("Could not find netns; see INSTALL")
    fixLimits()
 
 if __name__ == '__main__':
-- 
GitLab