Hi Aaron:
Thanks for your kinkdly suggession. I have tried your proposol and test in
my repository. This is the new version.
Add dump_cmd executable checker in ovs-tcpdump
Signed-off-by: Liu Chang <[email protected]>
diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
index 269c252..911c608 100755
--- a/utilities/ovs-tcpdump.in
+++ b/utilities/ovs-tcpdump.in
@@ -371,6 +371,9 @@ def argv_tuples(lst):
except StopIteration:
pass
+def py_which(executable):
+ return any(os.access(os.path.join(path,executable),os.X_OK)
+ for path in os.environ["PATH"].split(os.pathsep))
def main():
db_sock = 'unix:@RUNDIR@/db.sock'
@@ -416,6 +419,10 @@ def main():
print("Error: must at least specify an interface with '-i' option")
sys.exit(1)
+ if not py_which(dump_cmd):
+ print("Error: unable to execute '%s' (check PATH)"%dump_cmd)
+ sys.exit(1)
+
if '-l' not in tcpdargs:
tcpdargs.insert(0, '-l')
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev