Fix: set proper session name from path with trailing slash
authorAntoine Busque <antoinebusque@gmail.com>
Thu, 31 Jul 2014 15:44:42 +0000 (11:44 -0400)
committerAntoine Busque <antoinebusque@gmail.com>
Thu, 31 Jul 2014 15:44:42 +0000 (11:44 -0400)
fd-info.py

index 052f293ed0398bb07f258552361b9867a9ff26fd..dc4509a74bc0010ae12ef8c646b129c9f1be5745 100755 (executable)
@@ -84,7 +84,10 @@ class FDInfo():
         # Keys: PID, values: {pname, fds}
         self.json_metadata = {}
         # Used to identify session in database
-        self.session_name = self.args.path.split('/')[-2]
+        if self.args.path[-1] == '/':
+            self.session_name = self.args.path.split('/')[-3]
+        else:
+            self.session_name = self.args.path.split('/')[-2]
         # Hyphens in collections names are an incovenience in mongo
         self.session_name = self.session_name.replace('-', '_')
 
This page took 0.02392 seconds and 5 git commands to generate.