namespace_bug: Initial creation of namespace fails 17/18117/1
authorChristian Trautman <ctrautma@redhat.com>
Sun, 7 Aug 2016 01:34:22 +0000 (21:34 -0400)
committerChristian Trautman <ctrautma@redhat.com>
Sun, 7 Aug 2016 01:34:22 +0000 (21:34 -0400)
Initial creation of namespace fails because var/run/netns does not
exist.

JIRA: VSPERF-366

Change-Id: I02e5aef52e1675f303405b69c7461ca6482903af
Signed-off-by: Christian Trautman <ctrautma@redhat.com>
tools/namespace.py

index e6bcd81..9131398 100644 (file)
@@ -108,8 +108,8 @@ def get_system_namespace_list():
     Return tuple of strings for namespaces on the system
     :return: tuple of namespaces as string
     """
-    return tuple(os.listdir('/var/run/netns'))
-
+    return tuple(os.listdir('/var/run/netns')) if os.path.exists(
+        '/var/run/netns') else tuple()
 
 def get_vsperf_namespace_list():
     """