diff --git a/bigtop-packages/src/common/bigtop-select/conf-select b/bigtop-packages/src/common/bigtop-select/conf-select index ff47b20b59..cb097db16f 100644 --- a/bigtop-packages/src/common/bigtop-select/conf-select +++ b/bigtop-packages/src/common/bigtop-select/conf-select @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/bigtop-packages/src/common/bigtop-select/distro-select b/bigtop-packages/src/common/bigtop-select/distro-select index c967771cc8..b4d9557cf1 100644 --- a/bigtop-packages/src/common/bigtop-select/distro-select +++ b/bigtop-packages/src/common/bigtop-select/distro-select @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file @@ -157,7 +157,7 @@ def listPackages( packages ): if packages == None: packages = leaves - packages.sort() + packages = sorted(packages) for pkg in packages: linkname = current + "/" + pkg if os.path.isdir(linkname): @@ -168,13 +168,11 @@ def listPackages( packages ): # Print the avaialable package names def printPackages(): - packages = leaves.keys() - packages.sort() + packages = sorted(leaves.keys()) print("Packages:") for pkg in packages: print(" " + pkg) - groups = aliases.keys() - groups.sort() + groups = sorted(aliases.keys()) print("Aliases:") for pkg in groups: print(" " + pkg) @@ -199,8 +197,7 @@ def printVersions(): print("ERROR: Unexpected file/directory found in %s: %s" % (root, f)) sys.exit(1) - keys = result.keys() - keys.sort() + keys = sorted(result.keys()) for k in keys: print(result[k]) @@ -221,9 +218,9 @@ def setPackages(packages, version, rpm_mode): sys.exit(1) if not os.path.isdir(current): - os.mkdir(current, 0755) + os.mkdir(current, 0o755) - packages.sort() + packages = sorted(packages) for pkg in packages: linkname = current + "/" + pkg if os.path.islink(linkname) and rpm_mode: