]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ptl-tool: update for python3 29095/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 17 Jul 2019 18:14:31 +0000 (11:14 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 17 Jul 2019 18:14:31 +0000 (11:14 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/script/ptl-tool.py

index 6d37467477b3a1727bd802f40e831a7224e60aff..569d2746c8bc390d67370362b9c4342f1865ae2f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/python3
 
 # README:
 #
@@ -215,8 +215,8 @@ def build_branch(args):
         log.info("Detaching HEAD onto base: {}".format(base))
         try:
             base_path = args.base_path + base
-            base = filter(lambda r: r.path == base_path, G.refs)[0]
-        except IndexError:
+            base = next(ref for ref in G.refs if ref.path == base_path)
+        except StopIteration:
             log.error("Branch " + base + " does not exist!")
             sys.exit(1)